Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.beans.beancontext.BeanContextServicesSupport

java.lang.Object
    |
    +----java.beans.beancontext.BeanContextChildSupport
            |
            +----java.beans.beancontext.BeanContextSupport
                    |
                    +----java.beans.beancontext.BeanContextServicesSupport

public class BeanContextServicesSupport
extends BeanContextSupport
implements BeanContextServices

This helper class provides a utility implementation of the java.beans.beancontext.BeanContextServices interface.

Since this class directly implements the BeanContextServices interface, the class can, and is intended to be used either by subclassing this implementation, or via ad-hoc delegation of an instance of this class from another.

Since:
JDK1.2

Inner Class Summary
 BeanContextServicesSupport.BCSSChild
 
static   BeanContextServicesSupport.BCSSServiceProvider
subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider.
 
Inner classes inherited from class java.beans.beancontext.BeanContextSupport
 BeanContextSupport.BCSChild, BeanContextSupport.BCSIterator
 

Field Summary
ArrayList  bcsListeners
 
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
 

Constructor Summary
 BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dTime, boolean visible)

Construct a BeanContextServicesSupport instance

 BeanContextServicesSupport(BeanContextServices peer, Locale lcle, boolean dtime)
Create an instance using the specified Locale and design mode.
 BeanContextServicesSupport(BeanContextServices peer, Locale lcle)
Create an instance using the specified locale
 BeanContextServicesSupport(BeanContextServices peer)
Create an instance with a peer
 BeanContextServicesSupport()
Create an instance that is not a delegate of another object
 

Method Summary
void  addBeanContextServicesListener(BeanContextServicesListener bcsl)
add a BeanContextServicesListener
boolean  addService(Class serviceClass, BeanContextServiceProvider bcsp)
add a service
boolean  addService(Class serviceClass, BeanContextServiceProvider bcsp, boolean fireEvent)
add a service
void  bcsPreDeserializationHook(ObjectInputStream ois)
called from BeanContextSupport readObject before it deserializes the children ...
void  bcsPreSerializationHook(ObjectOutputStream oos)
called from BeanContextSupport writeObject before it serializes the children ...
void  childJustRemovedHook(Object child, BeanContextSupport.BCSChild bcsc)
called from superclass child removal operations after a child has been successfully removed.
BeanContextSupport.BCSChild  createBCSChild(Object targetChild)

Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set.

BeanContextServicesSupport.BCSSServiceProvider  createBCSSServiceProvider(Class sc, BeanContextServiceProvider bcsp)
subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.
void  fireServiceAdded(Class serviceClass)
Fire a BeanContextServiceEvent notifying of a new service
void  fireServiceAdded(BeanContextServiceAvailableEvent bcssae)
 
void  fireServiceRevoked(Class serviceClass, boolean revokeNow)
Fire a BeanContextServiceEvent notifying of a service being revoked
BeanContextServices  getBeanContextServicesPeer()
 
static BeanContextServicesListener  getChildBeanContextServicesListener(Object child)
 
Iterator  getCurrentServiceClasses()
 
Iterator  getCurrentServiceSelectors(Class serviceClass)
 
Object  getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl)
obtain a service which may be delegated
boolean  hasService(Class serviceClass)
has a service, which may be delegated
void  initialize()
called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state.
void  releaseBeanContextResources()
called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext.
void  releaseService(BeanContextChild child, Object requestor, Object service)
release a service
void  removeBeanContextServicesListener(BeanContextServicesListener bcsl)
remove a BeanContextServicesListener
void  revokeService(Class serviceClass, BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)
remove a service
void  serviceAvailable(BeanContextServiceAvailableEvent bcssae)
BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.
 
Methods inherited from class java.beans.beancontext.BeanContextSupport
 add, addAll, addBeanContextMembershipListener, avoidingGui, bcsChildren, bcsPreDeserializationHook, bcsPreSerializationHook, childDeserializedHook, childJustAddedHook, childJustRemovedHook, classEquals, clear, contains, containsAll, containsKey, copyChildren, createBCSChild, deserialize, dontUseGui, fireChildrenAdded, fireChildrenRemoved, getBeanContextPeer, getChildBeanContextChild, getChildBeanContextMembershipListener, getChildPropertyChangeListener, getChildSerializable, getChildVetoableChangeListener, getChildVisibility, getLocale, getResource, getResourceAsStream, initialize, instantiateChild, isDesignTime, isEmpty, isSerializing, iterator, needsGui, okToUseGui, propertyChange, readChildren, remove, remove, removeAll, removeBeanContextMembershipListener, retainAll, serialize, setDesignTime, setLocale, size, toArray, toArray, validatePendingAdd, validatePendingRemove, vetoableChange, writeChildren
 
Methods inherited from class java.beans.beancontext.BeanContextChildSupport
 addPropertyChangeListener, addVetoableChangeListener, firePropertyChange, fireVetoableChange, getBeanContext, getBeanContextChildPeer, initializeBeanContextResources, isDelegated, releaseBeanContextResources, removePropertyChangeListener, removeVetoableChangeListener, serviceAvailable, serviceRevoked, setBeanContext, validatePendingSetBeanContext
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

services

protected transient HashMap services

bcsListeners

protected transient ArrayList bcsListeners
Constructor Detail

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle,
                                  boolean dTime,
                                  boolean visible)

Construct a BeanContextServicesSupport instance

Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
lcle - The current Locale for this BeanContext.
dtime - The initial state, true if in design mode, false if runtime.
visible - The initial visibility.

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle,
                                  boolean dtime)
Create an instance using the specified Locale and design mode.
Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
lcle - The current Locale for this BeanContext.
dtime - The initial state, true if in design mode, false if runtime.

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer,
                                  Locale lcle)
Create an instance using the specified locale
Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
lcle - The current Locale for this BeanContext.

BeanContextServicesSupport

public BeanContextServicesSupport(BeanContextServices peer)
Create an instance with a peer
Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer

BeanContextServicesSupport

public BeanContextServicesSupport()
Create an instance that is not a delegate of another object
Method Detail

initialize

public void initialize()
called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state. subclasses may envelope this method, but should not override it or call it directly.
Overrides:
initialize in class BeanContextSupport

getBeanContextServicesPeer

public BeanContextServices getBeanContextServicesPeer()
Returns:
the instance of BeanContext this object is providing the implemen tation for.

createBCSChild

protected BeanContextSupport.BCSChild createBCSChild(Object targetChild)

Subclasses can override this method to insert their own subclass of Child without having to override add() or the other Collection methods that add children to the set.

Parameters:
targetChild - the child to create the Child on behalf of
Overrides:
createBCSChild in class BeanContextSupport

createBCSSServiceProvider

protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(Class sc,
                                                                                   BeanContextServiceProvider bcsp)
subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.

addBeanContextServicesListener

public void addBeanContextServicesListener(BeanContextServicesListener bcsl)
add a BeanContextServicesListener
Implements:
addBeanContextServicesListener in interface BeanContextServices

removeBeanContextServicesListener

public void removeBeanContextServicesListener(BeanContextServicesListener bcsl)
remove a BeanContextServicesListener
Implements:
removeBeanContextServicesListener in interface BeanContextServices

addService

public boolean addService(Class serviceClass,
                          BeanContextServiceProvider bcsp)
add a service
Implements:
addService in interface BeanContextServices

addService

protected boolean addService(Class serviceClass,
                             BeanContextServiceProvider bcsp,
                             boolean fireEvent)
add a service
Implements:
addService in interface BeanContextServices

revokeService

public void revokeService(Class serviceClass,
                          BeanContextServiceProvider bcsp,
                          boolean revokeCurrentServicesNow)
remove a service
Implements:
revokeService in interface BeanContextServices

hasService

public boolean hasService(Class serviceClass)
has a service, which may be delegated
Implements:
hasService in interface BeanContextServices

getService

public Object getService(BeanContextChild child,
                         Object requestor,
                         Class serviceClass,
                         Object serviceSelector,
                         BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException
obtain a service which may be delegated
Implements:
getService in interface BeanContextServices

releaseService

public void releaseService(BeanContextChild child,
                           Object requestor,
                           Object service)
release a service
Implements:
releaseService in interface BeanContextServices

getCurrentServiceClasses

public Iterator getCurrentServiceClasses()
Implements:
getCurrentServiceClasses in interface BeanContextServices
Returns:
an iterator for all the currently registered service classes.

getCurrentServiceSelectors

public Iterator getCurrentServiceSelectors(Class serviceClass)
Implements:
getCurrentServiceSelectors in interface BeanContextServices
Returns:
an iterator for all the currently available service selectors (if any) available for the specified service.

serviceAvailable

public void serviceAvailable(BeanContextServiceAvailableEvent bcssae)
BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself. subclasses may override or envelope this method to implement their own propagation semantics.
Overrides:
serviceAvailable in class BeanContextChildSupport

getChildBeanContextServicesListener

protected static final BeanContextServicesListener getChildBeanContextServicesListener(Object child)
Returns:
the BeanContextServicesListener (if any) of the specified child

childJustRemovedHook

protected void childJustRemovedHook(Object child,
                                    BeanContextSupport.BCSChild bcsc)
called from superclass child removal operations after a child has been successfully removed. called with child synchronized. This subclass uses this hook to immediately revoke any services being used by this child if it is a BeanContextChild. subclasses may envelope this method in order to implement their own child removal side-effects.
Overrides:
childJustRemovedHook in class BeanContextSupport

releaseBeanContextResources

protected void releaseBeanContextResources()
called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext. This method revokes any services obtained from its parent. subclasses may envelope this method to implement their own semantics.
Overrides:
releaseBeanContextResources in class BeanContextChildSupport

fireServiceAdded

protected final void fireServiceAdded(Class serviceClass)
Fire a BeanContextServiceEvent notifying of a new service

fireServiceAdded

protected final void fireServiceAdded(BeanContextServiceAvailableEvent bcssae)

fireServiceRevoked

protected final void fireServiceRevoked(Class serviceClass,
                                        boolean revokeNow)
Fire a BeanContextServiceEvent notifying of a service being revoked

bcsPreSerializationHook

protected void bcsPreSerializationHook(ObjectOutputStream oos) throws IOException
called from BeanContextSupport writeObject before it serializes the children ... This class will serialize any Serializable BeanContextServiceProviders herein. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children
Overrides:
bcsPreSerializationHook in class BeanContextSupport

bcsPreDeserializationHook

protected void bcsPreDeserializationHook(ObjectInputStream ois) throws IOException, ClassNotFoundException
called from BeanContextSupport readObject before it deserializes the children ... This class will deserialize any Serializable BeanContextServiceProviders serialized earlier thus making them available to the children when they deserialized. subclasses may envelope this method to insert their own serialization processing that has to occur prior to serialization of the children
Overrides:
bcsPreDeserializationHook in class BeanContextSupport

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.