|
|||||||||
| Home >> All >> java >> beans >> [ beancontext overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.beans.beancontext
Interface BeanContextServices

- All Superinterfaces:
- BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServicesListener, java.util.Collection, java.beans.DesignMode, java.util.EventListener, java.lang.Iterable, java.beans.Visibility
- All Known Implementing Classes:
- BeanContextServicesSupport
- public interface BeanContextServices
- extends BeanContext, BeanContextServicesListener
Allows a BeanContext to provide services to its children.
- Since:
- 1.2
| Field Summary |
| Fields inherited from interface java.beans.beancontext.BeanContext |
globalHierarchyLock |
| Fields inherited from interface java.beans.DesignMode |
PROPERTYNAME |
| Method Summary | |
void |
addBeanContextServicesListener(BeanContextServicesListener listener)
Add a listener on all adds and removes of services. |
boolean |
addService(java.lang.Class serviceClass,
BeanContextServiceProvider provider)
Register a service to make it available to others. |
java.util.Iterator |
getCurrentServiceClasses()
Get a list of all service classes supported. |
java.util.Iterator |
getCurrentServiceSelectors(java.lang.Class serviceClass)
Get a list of valid service selectors for the specified service class. |
java.lang.Object |
getService(BeanContextChild requestorChild,
java.lang.Object requestor,
java.lang.Class serviceClass,
java.lang.Object serviceSelector,
BeanContextServiceRevokedListener listener)
Get a service from this BeanContextServices. |
boolean |
hasService(java.lang.Class serviceClass)
Tell whether the specified service class is available. |
void |
releaseService(BeanContextChild requestorChild,
java.lang.Object requestor,
java.lang.Object service)
Release your copy of this service. |
void |
removeBeanContextServicesListener(BeanContextServicesListener listener)
Remove a listener on all adds and removes of services. |
void |
revokeService(java.lang.Class serviceClass,
BeanContextServiceProvider provider,
boolean revokeNow)
Make it so that no one else can use this service. |
| Methods inherited from interface java.beans.beancontext.BeanContext |
addBeanContextMembershipListener, getResource, getResourceAsStream, instantiateChild, removeBeanContextMembershipListener |
| Methods inherited from interface java.util.Collection |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface java.beans.beancontext.BeanContextChild |
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext |
| Methods inherited from interface java.beans.Visibility |
avoidingGui, dontUseGui, needsGui, okToUseGui |
| Methods inherited from interface java.beans.DesignMode |
isDesignTime, setDesignTime |
| Methods inherited from interface java.beans.beancontext.BeanContextServicesListener |
serviceAvailable |
| Methods inherited from interface java.beans.beancontext.BeanContextServiceRevokedListener |
serviceRevoked |
| Method Detail |
addService
public boolean addService(java.lang.Class serviceClass, BeanContextServiceProvider provider)
- Register a service to make it available to others.
This class may refuse to add the service based on whatever
information it can gather, including whether the service
provider is trusted.
revokeService
public void revokeService(java.lang.Class serviceClass, BeanContextServiceProvider provider, boolean revokeNow)
- Make it so that no one else can use this service.
If
revokeNowisfalse, the only effect of this method is to make all subsequent calls togetService()on this service class fail.If it is
true, a message is also sent out to all listeners on the service and all references to it are released.
releaseService
public void releaseService(BeanContextChild requestorChild, java.lang.Object requestor, java.lang.Object service)
- Release your copy of this service.
If all copies of the service's class have been relinquished by the requestor, the
BeanContextServiceRevokedListenerpreviously registered bygetService()will be unregistered.
getService
public java.lang.Object getService(BeanContextChild requestorChild, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector, BeanContextServiceRevokedListener listener) throws java.util.TooManyListenersException
- Get a service from this
BeanContextServices.The specified listener will be registered to receive a revocation notice for the specified serviceClass. One notification per service class per requestor object will be sent.
The listener will be unregistered when all services that were obtained by that requestor for that service class are released.
If the requested service class is not available, or if this
BeanContextServicesobject chooses not honor the request because the service class has been revoked or for some other reason, then this method will returnnull.This method may throw unchecked exceptions, so watch out.
getCurrentServiceClasses
public java.util.Iterator getCurrentServiceClasses()
- Get a list of all service classes supported.
This method must synchronize on
BeanContext.globalHierarchyLock.
getCurrentServiceSelectors
public java.util.Iterator getCurrentServiceSelectors(java.lang.Class serviceClass)
- Get a list of valid service selectors for the specified service class.
If the specified service class does not have a finite number of valid service selectors, it should return
null. If it takes a generalIntegerparameter, for example, you may as well returnnullor 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.
hasService
public boolean hasService(java.lang.Class serviceClass)
- Tell whether the specified service class is available.
Iff getService() could return a non-null value for the
specified service, this method will return
true.
addBeanContextServicesListener
public void addBeanContextServicesListener(BeanContextServicesListener listener)
- Add a listener on all adds and removes of services.
removeBeanContextServicesListener
public void removeBeanContextServicesListener(BeanContextServicesListener listener)
- Remove a listener on all adds and removes of services.
|
|||||||||
| Home >> All >> java >> beans >> [ beancontext overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC