Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.beans.beancontext

Interface BeanContextServiceProvider

java.lang.Object
|
+--java.beans.beancontext.BeanContextServiceProvider


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.

Since:Author:

Method Summary

java.util.IteratorgetCurrentServiceSelectors(java.beans.beancontext.BeanContextServices services, java.lang.Class serviceClass)

Get a list of valid service selectors for the specified service class.
java.lang.ObjectgetService(java.beans.beancontext.BeanContextServices services, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector)

Get a service.
voidreleaseService(java.beans.beancontext.BeanContextServices services, java.lang.Object requestor, java.lang.Object service)

Release the service.

Method Details

getCurrentServiceSelectors

public Iterator getCurrentServiceSelectors(java.beans.beancontext.BeanContextServices services, java.lang.Class serviceClass)

Get a list of valid service selectors for the specified service class. This method is called from 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.

Parameters:

Returns:

See Also:


getService

public Object getService(java.beans.beancontext.BeanContextServices services, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector)

Get a service. Called from 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.

This method may throw unchecked exceptions, so watch out.

Parameters:

Returns:

See Also:


releaseService

public void releaseService(java.beans.beancontext.BeanContextServices services, java.lang.Object requestor, java.lang.Object service)

Release the service.

Called by BeanContextServices.releaseService().

Most BeanContextServiceProviders won't have to do anything here.

Parameters:

See Also: