| java.lang.Object java.beans.beancontext.BeanContextChildSupport java.beans.beancontext.BeanContextSupport java.beans.beancontext.BeanContextServicesSupport
BeanContextServicesSupport | public class BeanContextServicesSupport extends BeanContextSupport implements BeanContextServices,Serializable(Code) | | This support class implements BeanContextServices interface.
This class can be used directly, or be a super class of your class, or be a
delegate of your implementation that needs to support
BeanContextServices interface.
|
Inner Class :protected static class BCSSServiceProvider implements Serializable | |
Field Summary | |
protected transient ArrayList | bcsListeners A list of registered BeanContextServicesListener s. | protected transient BCSSProxyServiceProvider | proxy A proxy service provider that delegates service requests to the parent
context. | final static long | serialVersionUID | protected transient int | serializable The number of serializable service providers currently registered. | protected transient HashMap | services A map of all registered services - key is service class, value is
BCSSServiceProvider object. |
Method Summary | |
public void | addBeanContextServicesListener(BeanContextServicesListener listener) | public boolean | addService(Class serviceClass, BeanContextServiceProvider provider) Add a service to this context. | protected boolean | addService(Class serviceClass, BeanContextServiceProvider provider, boolean fireEvent) Add a service to this context. | protected void | bcsPreDeserializationHook(ObjectInputStream ois) Deserializes all serializable services and their providers before the
children of this context is deserialized.
First a int is read, indicating the number of services to
read. | protected void | bcsPreSerializationHook(ObjectOutputStream oos) Serializes all serializable services and their providers before the
children of this context is serialized.
First a int is writtern, indicating the number of
serializable services. | protected void | childJustRemovedHook(Object child, BCSChild bcsChild) This method is called everytime a child is removed from this context. | protected BCSChild | createBCSChild(Object child, Object proxyPeer) Creates a BCSSChild object to company the given child. | protected BCSSServiceProvider | createBCSSServiceProvider(Class serviceClass, BeanContextServiceProvider provider) Creates a BCSSServiceProvider to company the given
service. | final protected void | fireServiceAdded(Class serviceClass) Fires a BeanContextServiceAvailableEvent to registered
BeanContextServicesListener s. | final protected void | fireServiceAdded(BeanContextServiceAvailableEvent event) Fires a BeanContextServiceAvailableEvent to registered
BeanContextServicesListener s. | final protected void | fireServiceRevoked(Class serviceClass, boolean revokeNow) Fires a BeanContextServiceRevokedEvent to registered
BeanContextServicesListener s. | final protected void | fireServiceRevoked(BeanContextServiceRevokedEvent event) Fires a BeanContextServiceRevokedEvent to registered
BeanContextServicesListener s. | public BeanContextServices | getBeanContextServicesPeer() Returns the peer of this context casted as
BeanContextServices . | final protected static BeanContextServicesListener | getChildBeanContextServicesListener(Object child) Returns the given child casted to
BeanContextServicesListener , or null if it does not
implements the interface. | public Iterator | getCurrentServiceClasses() Returns an iterator of all registered service classes, with
removed() disabled. | public Iterator | getCurrentServiceSelectors(Class serviceClass) Returns the service selectors of the specified service. | public Object | getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) Get a service instance on behalf of the specified child of this context,
by calling the registered service provider, or by delegating to the
parent context. | public boolean | hasService(Class serviceClass) Checks whether a service is registed in this context or the parent
context. | public void | initialize() | protected void | initializeBeanContextResources() Called after the parent context is updated. | protected void | releaseBeanContextResources() Called before the parent context is updated. | public void | releaseService(BeanContextChild child, Object requestor, Object service) Release a service which has been requested previously. | public void | removeBeanContextServicesListener(BeanContextServicesListener listener) | public void | revokeService(Class serviceClass, BeanContextServiceProvider serviceProvider, boolean revokeCurrentServicesNow) Revokes a service in this bean context.
The given service provider is unregistered and a
BeanContextServiceRevokedEvent is fired. | public void | serviceAvailable(BeanContextServiceAvailableEvent event) Notify all listeners and children that implements
BeanContextServices of the event. | public void | serviceRevoked(BeanContextServiceRevokedEvent event) Notify all listeners and children that implements
BeanContextServices of the event. |
bcsListeners | protected transient ArrayList bcsListeners(Code) | | A list of registered BeanContextServicesListener s. All
access to this object should be synchronized on itself.
|
proxy | protected transient BCSSProxyServiceProvider proxy(Code) | | A proxy service provider that delegates service requests to the parent
context.
|
serialVersionUID | final static long serialVersionUID(Code) | | |
serializable | protected transient int serializable(Code) | | The number of serializable service providers currently registered.
|
services | protected transient HashMap services(Code) | | A map of all registered services - key is service class, value is
BCSSServiceProvider object. All access to this object
should be synchronized on itself.
|
BeanContextServicesSupport | public BeanContextServicesSupport()(Code) | | Constructs a standard BeanContextServicesSupport .
|
BeanContextServicesSupport | public BeanContextServicesSupport(BeanContextServices peer)(Code) | | Constructs a BeanContextServicesSupport which is a
delegate of the given peer.
Parameters: peer - the peer of this context |
BeanContextServicesSupport | public BeanContextServicesSupport(BeanContextServices peer, Locale locale)(Code) | | Constructs a BeanContextServicesSupport which is a
delegate of the given peer.
Parameters: peer - the peer of this context Parameters: locale - the locale of this context |
BeanContextServicesSupport | public BeanContextServicesSupport(BeanContextServices peer, Locale locale, boolean designTime)(Code) | | Constructs a BeanContextServicesSupport which is a
delegate of the given peer.
Parameters: peer - the peer of this context Parameters: locale - the locale of this context Parameters: designTime - whether in design mode or not |
BeanContextServicesSupport | public BeanContextServicesSupport(BeanContextServices peer, Locale locale, boolean designTime, boolean okToUseGui)(Code) | | Constructs a BeanContextServicesSupport which is a
delegate of the given peer.
Parameters: peer - the peer of this context Parameters: locale - the locale of this context Parameters: designTime - whether in design mode or not Parameters: okToUseGui - whether GUI is usable or not |
addService | protected boolean addService(Class serviceClass, BeanContextServiceProvider provider, boolean fireEvent)(Code) | | Add a service to this context.
If the service already exists in the context, simply return false.
Otherwise, the service is added and event is fired if required.
Parameters: serviceClass - the service class Parameters: provider - the provider of the service Parameters: fireEvent - the flag indicating to fire event or not true if the service is added; or false if the context already hasthis service |
createBCSSServiceProvider | protected BCSSServiceProvider createBCSSServiceProvider(Class serviceClass, BeanContextServiceProvider provider)(Code) | | Creates a BCSSServiceProvider to company the given
service.
Parameters: serviceClass - the service class Parameters: provider - the service provider a BCSSServiceProvider to company the given service |
fireServiceAdded | final protected void fireServiceAdded(Class serviceClass)(Code) | | Fires a BeanContextServiceAvailableEvent to registered
BeanContextServicesListener s.
Parameters: serviceClass - the service that has been added |
fireServiceAdded | final protected void fireServiceAdded(BeanContextServiceAvailableEvent event)(Code) | | Fires a BeanContextServiceAvailableEvent to registered
BeanContextServicesListener s.
Parameters: event - the event |
fireServiceRevoked | final protected void fireServiceRevoked(Class serviceClass, boolean revokeNow)(Code) | | Fires a BeanContextServiceRevokedEvent to registered
BeanContextServicesListener s.
Parameters: serviceClass - the service that has been revoked Parameters: revokeNow - whether to terminate service immediately |
fireServiceRevoked | final protected void fireServiceRevoked(BeanContextServiceRevokedEvent event)(Code) | | Fires a BeanContextServiceRevokedEvent to registered
BeanContextServicesListener s.
Parameters: event - the event |
getBeanContextServicesPeer | public BeanContextServices getBeanContextServicesPeer()(Code) | | Returns the peer of this context casted as
BeanContextServices .
the peer of this context casted asBeanContextServices |
getChildBeanContextServicesListener | final protected static BeanContextServicesListener getChildBeanContextServicesListener(Object child)(Code) | | Returns the given child casted to
BeanContextServicesListener , or null if it does not
implements the interface.
Parameters: child - a child the given child casted toBeanContextServicesListener , or null if it doesnot implements the interface |
initialize | public void initialize()(Code) | | |
releaseService | public void releaseService(BeanContextChild child, Object requestor, Object service)(Code) | | Release a service which has been requested previously.
Parameters: child - the child that request the service Parameters: requestor - the requestor object Parameters: service - the service instance throws: IllegalArgumentException - if child is not a child of this context |
Methods inherited from java.beans.beancontext.BeanContextSupport | public boolean add(Object child)(Code)(Java Doc) public boolean addAll(Collection collection)(Code)(Java Doc) public void addBeanContextMembershipListener(BeanContextMembershipListener listener)(Code)(Java Doc) public boolean avoidingGui()(Code)(Java Doc) protected Iterator bcsChildren()(Code)(Java Doc) protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException(Code)(Java Doc) protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException(Code)(Java Doc) protected void childDeserializedHook(Object child, BCSChild bcsChild)(Code)(Java Doc) protected void childJustAddedHook(Object child, BCSChild bcsChild)(Code)(Java Doc) protected void childJustRemovedHook(Object child, BCSChild bcsChild)(Code)(Java Doc) final protected static boolean classEquals(Class clz1, Class clz2)(Code)(Java Doc) public void clear()(Code)(Java Doc) public boolean contains(Object child)(Code)(Java Doc) public boolean containsAll(Collection collection)(Code)(Java Doc) public boolean containsKey(Object child)(Code)(Java Doc) final protected Object[] copyChildren()(Code)(Java Doc) protected BCSChild createBCSChild(Object child, Object proxyPeer)(Code)(Java Doc) final protected void deserialize(ObjectInputStream ois, Collection collection) throws IOException, ClassNotFoundException(Code)(Java Doc) public void dontUseGui()(Code)(Java Doc) final protected void fireChildrenAdded(BeanContextMembershipEvent event)(Code)(Java Doc) final protected void fireChildrenRemoved(BeanContextMembershipEvent event)(Code)(Java Doc) public BeanContext getBeanContextPeer()(Code)(Java Doc) final protected static BeanContextChild getChildBeanContextChild(Object child)(Code)(Java Doc) final protected static BeanContextMembershipListener getChildBeanContextMembershipListener(Object child)(Code)(Java Doc) final protected static PropertyChangeListener getChildPropertyChangeListener(Object child)(Code)(Java Doc) final protected static Serializable getChildSerializable(Object child)(Code)(Java Doc) final protected static VetoableChangeListener getChildVetoableChangeListener(Object child)(Code)(Java Doc) final protected static Visibility getChildVisibility(Object child)(Code)(Java Doc) public Locale getLocale()(Code)(Java Doc) public URL getResource(String resourceName, BeanContextChild child)(Code)(Java Doc) public InputStream getResourceAsStream(String resourceName, BeanContextChild child) throws IllegalArgumentException(Code)(Java Doc) protected void initialize()(Code)(Java Doc) public Object instantiateChild(String beanName) throws IOException, ClassNotFoundException(Code)(Java Doc) public boolean isDesignTime()(Code)(Java Doc) public boolean isEmpty()(Code)(Java Doc) public boolean isSerializing()(Code)(Java Doc) public Iterator iterator()(Code)(Java Doc) public boolean needsGui()(Code)(Java Doc) public void okToUseGui()(Code)(Java Doc) public void propertyChange(PropertyChangeEvent event)(Code)(Java Doc) final public void readChildren(ObjectInputStream ois) throws IOException, ClassNotFoundException(Code)(Java Doc) public boolean remove(Object child)(Code)(Java Doc) protected boolean remove(Object child, boolean setChildBC)(Code)(Java Doc) public boolean removeAll(Collection collection)(Code)(Java Doc) public void removeBeanContextMembershipListener(BeanContextMembershipListener listener)(Code)(Java Doc) public boolean retainAll(Collection collection)(Code)(Java Doc) final protected void serialize(ObjectOutputStream oos, Collection collection) throws IOException(Code)(Java Doc) public void setDesignTime(boolean designTime)(Code)(Java Doc) public void setLocale(Locale newLocale) throws PropertyVetoException(Code)(Java Doc) public int size()(Code)(Java Doc) public Object[] toArray()(Code)(Java Doc) public Object[] toArray(Object[] array)(Code)(Java Doc) protected boolean validatePendingAdd(Object child)(Code)(Java Doc) protected boolean validatePendingRemove(Object child)(Code)(Java Doc) public void vetoableChange(PropertyChangeEvent pce) throws PropertyVetoException(Code)(Java Doc) final public void writeChildren(ObjectOutputStream oos) throws IOException(Code)(Java Doc)
|
|
|