|
|||||||||
| 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
Class BeanContextServicesSupport

java.lang.Objectjava.beans.beancontext.BeanContextChildSupport
java.beans.beancontext.BeanContextSupport
java.beans.beancontext.BeanContextServicesSupport
- All Implemented Interfaces:
- BeanContext, BeanContextChild, BeanContextServiceRevokedListener, BeanContextServices, BeanContextServicesListener, java.util.Collection, java.beans.DesignMode, java.util.EventListener, java.lang.Iterable, java.beans.PropertyChangeListener, java.io.Serializable, java.beans.VetoableChangeListener, java.beans.Visibility
- public class BeanContextServicesSupport
- extends BeanContextSupport
- implements BeanContextServices
- extends BeanContextSupport
- Since:
- 1.2
| Nested Class Summary | |
protected class |
BeanContextServicesSupport.BCSSChild
|
protected class |
BeanContextServicesSupport.BCSSProxyServiceProvider
|
protected static class |
BeanContextServicesSupport.BCSSServiceProvider
|
| Nested classes inherited from class java.beans.beancontext.BeanContextSupport |
BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator |
| Field Summary | |
protected java.util.ArrayList |
bcsListeners
|
protected BeanContextServicesSupport.BCSSProxyServiceProvider |
proxy
|
protected int |
serializable
|
private static long |
serialVersionUID
|
protected java.util.HashMap |
services
|
| Fields inherited from class java.beans.beancontext.BeanContextSupport |
bcmListeners, children, designTime, locale, okToUseGui |
| Fields inherited from class java.beans.beancontext.BeanContextChildSupport |
beanContext, beanContextChildPeer, pcSupport, rejectedSetBCOnce, vcSupport |
| Fields inherited from interface java.beans.beancontext.BeanContext |
globalHierarchyLock |
| Fields inherited from interface java.beans.DesignMode |
PROPERTYNAME |
| Constructor Summary | |
BeanContextServicesSupport()
|
|
BeanContextServicesSupport(BeanContextServices peer)
|
|
BeanContextServicesSupport(BeanContextServices peer,
java.util.Locale locale)
|
|
BeanContextServicesSupport(BeanContextServices peer,
java.util.Locale locale,
boolean dtime)
|
|
BeanContextServicesSupport(BeanContextServices peer,
java.util.Locale locale,
boolean dtime,
boolean visible)
|
|
| Method Summary | |
void |
addBeanContextServicesListener(BeanContextServicesListener listener)
Add a listener on all adds and removes of services. |
boolean |
addService(java.lang.Class serviceClass,
BeanContextServiceProvider bcsp)
Register a service to make it available to others. |
protected boolean |
addService(java.lang.Class serviceClass,
BeanContextServiceProvider bcsp,
boolean fireEvent)
|
protected void |
bcsPreDeserializationHook(java.io.ObjectInputStream ois)
|
protected void |
bcsPreSerializationHook(java.io.ObjectOutputStream oos)
|
protected void |
childJustRemovedHook(java.lang.Object child,
BeanContextSupport.BCSChild bcsc)
|
protected BeanContextSupport.BCSChild |
createBCSChild(java.lang.Object targetChild,
java.lang.Object peer)
|
protected BeanContextServicesSupport.BCSSServiceProvider |
createBCSSServiceProvider(java.lang.Class sc,
BeanContextServiceProvider bcsp)
|
protected void |
fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
|
protected void |
fireServiceAdded(java.lang.Class serviceClass)
|
protected void |
fireServiceRevoked(BeanContextServiceRevokedEvent event)
|
protected void |
fireServiceRevoked(java.lang.Class serviceClass,
boolean revokeNow)
|
BeanContextServices |
getBeanContextServicesPeer()
|
protected static BeanContextServicesListener |
getChildBeanContextServicesListener(java.lang.Object child)
|
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 child,
java.lang.Object requestor,
java.lang.Class serviceClass,
java.lang.Object serviceSelector,
BeanContextServiceRevokedListener bcsrl)
Get a service from this BeanContextServices. |
boolean |
hasService(java.lang.Class serviceClass)
Tell whether the specified service class is available. |
void |
initialize()
|
protected void |
initializeBeanContextResources()
Called by setBeanContext() to grab resources when the parent has been set. |
protected void |
releaseBeanContextResources()
Called by setBeanContext() to release resources of a what will soon no longer be the parent. |
void |
releaseService(BeanContextChild child,
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 bcsp,
boolean revokeCurrentServicesNow)
Make it so that no one else can use this service. |
void |
serviceAvailable(BeanContextServiceAvailableEvent bcssae)
Called by BeanContextServices whenever a service is made available. |
void |
serviceRevoked(BeanContextServiceRevokedEvent bcssre)
Called by BeanContextServices.revokeService() to indicate that a service has been revoked. |
| Methods inherited from class java.beans.beancontext.BeanContextChildSupport |
addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, isDelegated, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, validatePendingSetBeanContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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 |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
bcsListeners
protected transient java.util.ArrayList bcsListeners
proxy
protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy
serializable
protected transient int serializable
services
protected transient java.util.HashMap services
| Constructor Detail |
BeanContextServicesSupport
public BeanContextServicesSupport()
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer)
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer, java.util.Locale locale)
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer, java.util.Locale locale, boolean dtime)
BeanContextServicesSupport
public BeanContextServicesSupport(BeanContextServices peer, java.util.Locale locale, boolean dtime, boolean visible)
| Method Detail |
addBeanContextServicesListener
public void addBeanContextServicesListener(BeanContextServicesListener listener)
- Description copied from interface:
BeanContextServices - Add a listener on all adds and removes of services.
- Specified by:
addBeanContextServicesListenerin interfaceBeanContextServices
addService
public boolean addService(java.lang.Class serviceClass, BeanContextServiceProvider bcsp)
- Description copied from interface:
BeanContextServices - 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.
- Specified by:
addServicein interfaceBeanContextServices
addService
protected boolean addService(java.lang.Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
bcsPreDeserializationHook
protected void bcsPreDeserializationHook(java.io.ObjectInputStream ois) throws java.lang.ClassNotFoundException, java.io.IOException, gnu.classpath.NotImplementedException
- Overrides:
bcsPreDeserializationHookin classBeanContextSupport
bcsPreSerializationHook
protected void bcsPreSerializationHook(java.io.ObjectOutputStream oos) throws java.io.IOException, gnu.classpath.NotImplementedException
- Overrides:
bcsPreSerializationHookin classBeanContextSupport
childJustRemovedHook
protected void childJustRemovedHook(java.lang.Object child, BeanContextSupport.BCSChild bcsc) throws gnu.classpath.NotImplementedException
- Overrides:
childJustRemovedHookin classBeanContextSupport
createBCSChild
protected BeanContextSupport.BCSChild createBCSChild(java.lang.Object targetChild, java.lang.Object peer)
- Overrides:
createBCSChildin classBeanContextSupport
createBCSSServiceProvider
protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(java.lang.Class sc, BeanContextServiceProvider bcsp) throws gnu.classpath.NotImplementedException
fireServiceAdded
protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
fireServiceAdded
protected final void fireServiceAdded(java.lang.Class serviceClass)
fireServiceRevoked
protected final void fireServiceRevoked(BeanContextServiceRevokedEvent event)
fireServiceRevoked
protected final void fireServiceRevoked(java.lang.Class serviceClass, boolean revokeNow)
getBeanContextServicesPeer
public BeanContextServices getBeanContextServicesPeer() throws gnu.classpath.NotImplementedException
getChildBeanContextServicesListener
protected static final BeanContextServicesListener getChildBeanContextServicesListener(java.lang.Object child) throws gnu.classpath.NotImplementedException
getCurrentServiceClasses
public java.util.Iterator getCurrentServiceClasses()
- Description copied from interface:
BeanContextServices - Get a list of all service classes supported.
This method must synchronize on
BeanContext.globalHierarchyLock.- Specified by:
getCurrentServiceClassesin interfaceBeanContextServices
getCurrentServiceSelectors
public java.util.Iterator getCurrentServiceSelectors(java.lang.Class serviceClass)
- Description copied from interface:
BeanContextServices - 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.- Specified by:
getCurrentServiceSelectorsin interfaceBeanContextServices
getService
public java.lang.Object getService(BeanContextChild child, java.lang.Object requestor, java.lang.Class serviceClass, java.lang.Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws java.util.TooManyListenersException, gnu.classpath.NotImplementedException
- Description copied from interface:
BeanContextServices - 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.
- Specified by:
getServicein interfaceBeanContextServices
hasService
public boolean hasService(java.lang.Class serviceClass)
- Description copied from interface:
BeanContextServices - 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.- Specified by:
hasServicein interfaceBeanContextServices
initialize
public void initialize()
- Overrides:
initializein classBeanContextSupport
initializeBeanContextResources
protected void initializeBeanContextResources()
throws gnu.classpath.NotImplementedException
- Description copied from class:
BeanContextChildSupport - Called by
setBeanContext()to grab resources when the parent has been set.This method is meant to be overriden.
BeanContextChildSupport's implementation does nothing.- Overrides:
initializeBeanContextResourcesin classBeanContextChildSupport
releaseBeanContextResources
protected void releaseBeanContextResources()
throws gnu.classpath.NotImplementedException
- Description copied from class:
BeanContextChildSupport - Called by
setBeanContext()to release resources of a what will soon no longer be the parent.This method is meant to be overriden.
BeanContextChildSupport's implementation does nothing.- Overrides:
releaseBeanContextResourcesin classBeanContextChildSupport
releaseService
public void releaseService(BeanContextChild child, java.lang.Object requestor, java.lang.Object service) throws gnu.classpath.NotImplementedException
- Description copied from interface:
BeanContextServices - 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.- Specified by:
releaseServicein interfaceBeanContextServices
removeBeanContextServicesListener
public void removeBeanContextServicesListener(BeanContextServicesListener listener)
- Description copied from interface:
BeanContextServices - Remove a listener on all adds and removes of services.
- Specified by:
removeBeanContextServicesListenerin interfaceBeanContextServices
revokeService
public void revokeService(java.lang.Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow) throws gnu.classpath.NotImplementedException
- Description copied from interface:
BeanContextServices - 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.- Specified by:
revokeServicein interfaceBeanContextServices
serviceAvailable
public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
- Description copied from interface:
BeanContextServicesListener - Called by
BeanContextServiceswhenever a service is made available.- Specified by:
serviceAvailablein interfaceBeanContextServicesListener- Overrides:
serviceAvailablein classBeanContextChildSupport
serviceRevoked
public void serviceRevoked(BeanContextServiceRevokedEvent bcssre)
- Description copied from interface:
BeanContextServiceRevokedListener - Called by
BeanContextServices.revokeService()to indicate that a service has been revoked. If you have a reference to such a service, it should be discarded and may no longer function properly.getService()will no longer work on the specified service class after this event has been fired.- Specified by:
serviceRevokedin interfaceBeanContextServiceRevokedListener- Overrides:
serviceRevokedin classBeanContextChildSupport
|
|||||||||
| Home >> All >> java >> beans >> [ beancontext overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC