Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface BeanContextServiceProvider
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<E> |
|
Object |
|
void |
|
public Iterator<E> getCurrentServiceSelectors(BeanContextServices services, Class<T> serviceClass)
Get a list of valid service selectors for the specified service class. This method is called fromBeanContextServices.getCurrentServiceSelectors()
.If the specified service class does not have a finite number of valid service selectors, it should return
null
. If it takes a generalInteger
parameter, for example, you may as well returnnull
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
.
- Parameters:
services
- theBeanContextServices
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.
- Returns:
- a list of valid service selectors for the service class, or
null
.
public Object getService(BeanContextServices services, Object requestor, Class<T> serviceClass, Object serviceSelector)
Get a service. Called fromBeanContextServices.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 returnnull
. This method may throw unchecked exceptions, so watch out.
- Parameters:
services
- theBeanContextServices
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
- theClass
of the service being requested.serviceSelector
- a parameter to customize the service returned with.
- Returns:
- an instance of
serviceClass
(such thatinstanceof
serviceClass is true), ornull
.
public void releaseService(BeanContextServices services, Object requestor, Object service)
Release the service.Called by
BeanContextServices.releaseService()
.Most
BeanContextServiceProvider
s won't have to do anything here.
- Parameters:
services
- theBeanContextServices
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 relinquish