|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanContextServiceProvider
An actual factory for services.
It is the BeanContextServiceProvider
's responsibility to
register itself with whatever BeanContextServices
object
it wishes to provide services through using the
addService()
method.
If for some reason it can no longer provide services for a particular
class, this class must invoke
BeanContextServices.revokeService(serviceClass,this,true)
for all the places it has registered the service.
Method Summary | |
---|---|
Iterator |
getCurrentServiceSelectors(BeanContextServices services,
Class serviceClass)
Get a list of valid service selectors for the specified service class. |
Object |
getService(BeanContextServices services,
Object requestor,
Class serviceClass,
Object serviceSelector)
Get a service. |
void |
releaseService(BeanContextServices services,
Object requestor,
Object service)
Release the service. |
Method Detail |
---|
Object getService(BeanContextServices services, Object requestor, Class serviceClass, Object serviceSelector)
BeanContextServices.getService()
.
If the requested service class is not available, or if this
BeanContextServiceProvider
chooses not honor the
request for some reason, then this method will return
null
.
services
- the BeanContextServices
that wants
to get the service. Only weak references to this will
be retained, and it will never be changed, only queried
in a read-only manner.requestor
- the actual requestor of the service. Only
weak references to this will be retained, and it will
never be changed, only queried in a read-only manner.serviceClass
- the Class
of the service being
requested.serviceSelector
- a parameter to customize the service
returned with.
serviceClass
(such that
instanceof
serviceClass is true), or
null
.BeanContextServices.getService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Class,java.lang.Object,java.beans.beancontext.BeanContextServiceRevokedListener)
void releaseService(BeanContextServices services, Object requestor, Object service)
Called by BeanContextServices.releaseService()
.
Most BeanContextServiceProvider
s won't have to do
anything here.
services
- the BeanContextServices
that wants
to release the service. Only weak references to this will
be retained, and it will never be changed, only queried
in a read-only manner.requestor
- the original requestor of the service.service
- the service to relinquishBeanContextServices.releaseService(java.beans.beancontext.BeanContextChild,java.lang.Object,java.lang.Object)
Iterator getCurrentServiceSelectors(BeanContextServices services, Class serviceClass)
BeanContextServices.getCurrentServiceSelectors()
.
If the specified service class does not have a finite number of
valid service selectors, it should return null
.
If it takes a general Integer
parameter, for
example, you may as well return null
or the poor
soul who called this method will be iterating all day.
If it has no valid service selectors, it should still return an empty
Iterator
.
services
- the BeanContextServices
that wants
to get the service selectors. Only weak references to this will
be retained, and it will never be changed, only queried
in a read-only manner.serviceClass
- the service class to get selectors for.
null
.BeanContextServices.getCurrentServiceSelectors(java.lang.Class)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |