WebFlow
Class BeanContextServicesSupport

WebFlow.BeanContextServicesSupport

public class BeanContextServicesSupport


Inner Class Summary
protected  class BeanContextServicesSupport.BCSSChild
           
protected  class BeanContextServicesSupport.BCSSProxyServiceProvider
           
protected static class BeanContextServicesSupport.BCSSServiceProvider
          subclasses may subclass this nested class to add behaviors for each BeanContextServicesProvider.
 
Field Summary
protected  java.util.ArrayList bcsListeners
           
protected  BeanContextServicesSupport.BCSSProxyServiceProvider proxy
           
protected  int serializable
           
protected  myHashMap services
          all accesses to the protected transient HashMap services field should be synchronized on that object
 
Constructor Summary
BeanContextServicesSupport(WebFlow.BeanContextServices peer, org.omg.CORBA.ORB orb)
           Construct a BeanContextServicesSupport instance
 
Method Summary
 void addBeanContextServicesListener(WebFlow.BeanContextServicesListener bcsl)
          add a BeanContextServicesListener
 boolean addService(java.lang.String serviceClass, WebFlow.BeanContextServiceProvider bcsp)
          add a service
protected  boolean addService(java.lang.String serviceClass, WebFlow.BeanContextServiceProvider bcsp, boolean fireEvent)
          add a service
protected  void childJustRemovedHook(java.lang.Object child, WebFlow.BCSChild bcsc)
          called from superclass child removal operations after a child has been successfully removed.
protected  WebFlow.BCSChild createBCSChild(org.omg.CORBA.Object targetChild, org.omg.CORBA.Object peer)
           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.
protected  BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(java.lang.String sc, WebFlow.BeanContextServiceProvider bcsp)
          subclasses can override this method to create new subclasses of BCSSServiceProvider without having to overrride addService() in order to instantiate.
protected  void fireServiceAdded(WebFlow.BeanContextServiceAvailableEvent bcssae)
           
protected  void fireServiceAdded(java.lang.String serviceClass)
          Fire a BeanContextServiceEvent notifying of a new service
protected  void fireServiceRevoked(WebFlow.BeanContextServiceRevokedEvent bcsre)
          Fire a BeanContextServiceEvent notifying of a service being revoked
protected  void fireServiceRevoked(java.lang.String serviceClass, boolean revokeNow)
           
 WebFlow.BeanContextServices getBeanContextServicesPeer()
           
protected static WebFlow.BeanContextServicesListener getChildBeanContextServicesListener(java.lang.Object child)
           
 java.util.Iterator getCurrentServiceClasses()
           
 WebFlow.Iterator getCurrentServiceSelectors(java.lang.String serviceClass)
           
 org.omg.CORBA.Object getService(WebFlow.BeanContextChild child, org.omg.CORBA.Object requestor, java.lang.String serviceClass, org.omg.CORBA.Object serviceSelector, WebFlow.BeanContextServiceRevokedListener bcsrl)
          obtain a service which may be delegated
 boolean hasService(java.lang.String serviceClass)
          has a service, which may be delegated
 void initialize()
          called by BeanContextSupport superclass during construction and deserialization to initialize subclass transient state.
protected  void initializeBeanContextResources()
          called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext.
 boolean isEqual(org.omg.CORBA.Object o1, org.omg.CORBA.Object o2)
           
protected  void releaseBeanContextResources()
          called from setBeanContext to notify a BeanContextChild to release resources obtained from the nesting BeanContext.
 void releaseService(WebFlow.BeanContextChild child, org.omg.CORBA.Object requestor, org.omg.CORBA.Object service)
          release a service
 void removeBeanContextServicesListener(WebFlow.BeanContextServicesListener bcsl)
          remove a BeanContextServicesListener
 void revokeService(java.lang.String serviceClass, WebFlow.BeanContextServiceProvider bcsp, boolean revokeCurrentServicesNow)
          remove a service
 void serviceAvailable(WebFlow.BeanContextServiceAvailableEvent bcssae)
          BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.
 void serviceRevoked(WebFlow.BeanContextServiceRevokedEvent bcssre)
          BeanContextServicesListener callback, propagates event to all currently registered listeners and BeanContextServices children, if this BeanContextService does not already implement this service itself.
 

Field Detail

services

protected transient myHashMap services
all accesses to the protected transient HashMap services field should be synchronized on that object

serializable

protected transient int serializable

proxy

protected transient BeanContextServicesSupport.BCSSProxyServiceProvider proxy

bcsListeners

protected transient java.util.ArrayList bcsListeners
Constructor Detail

BeanContextServicesSupport

public BeanContextServicesSupport(WebFlow.BeanContextServices peer,
                                  org.omg.CORBA.ORB orb)
                           throws java.lang.NullPointerException

Construct a BeanContextServicesSupport instance

Parameters:
peer - The peer BeanContext we are supplying an implementation for, if null the this object is its own peer
Method Detail

isEqual

public boolean isEqual(org.omg.CORBA.Object o1,
                       org.omg.CORBA.Object o2)

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.

getBeanContextServicesPeer

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

createBCSChild

protected WebFlow.BCSChild createBCSChild(org.omg.CORBA.Object targetChild,
                                          org.omg.CORBA.Object peer)

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
peer - the peer if the targetChild and peer are related by BeanContextProxy

createBCSSServiceProvider

protected BeanContextServicesSupport.BCSSServiceProvider createBCSSServiceProvider(java.lang.String sc,
                                                                                   WebFlow.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(WebFlow.BeanContextServicesListener bcsl)
                                    throws java.lang.NullPointerException
add a BeanContextServicesListener

removeBeanContextServicesListener

public void removeBeanContextServicesListener(WebFlow.BeanContextServicesListener bcsl)
                                       throws java.lang.NullPointerException
remove a BeanContextServicesListener

addService

public boolean addService(java.lang.String serviceClass,
                          WebFlow.BeanContextServiceProvider bcsp)
add a service

addService

protected boolean addService(java.lang.String serviceClass,
                             WebFlow.BeanContextServiceProvider bcsp,
                             boolean fireEvent)
                      throws java.lang.NullPointerException,
                             java.lang.IllegalArgumentException
add a service

revokeService

public void revokeService(java.lang.String serviceClass,
                          WebFlow.BeanContextServiceProvider bcsp,
                          boolean revokeCurrentServicesNow)
                   throws java.lang.NullPointerException,
                          java.lang.IllegalArgumentException
remove a service

hasService

public boolean hasService(java.lang.String serviceClass)
                   throws java.lang.NullPointerException
has a service, which may be delegated

getService

public org.omg.CORBA.Object getService(WebFlow.BeanContextChild child,
                                       org.omg.CORBA.Object requestor,
                                       java.lang.String serviceClass,
                                       org.omg.CORBA.Object serviceSelector,
                                       WebFlow.BeanContextServiceRevokedListener bcsrl)
                                throws java.util.TooManyListenersException,
                                       java.lang.UnsupportedOperationException,
                                       java.lang.NullPointerException,
                                       java.lang.IllegalArgumentException
obtain a service which may be delegated

releaseService

public void releaseService(WebFlow.BeanContextChild child,
                           org.omg.CORBA.Object requestor,
                           org.omg.CORBA.Object service)
                    throws java.lang.NullPointerException,
                           java.lang.IllegalArgumentException
release a service

getCurrentServiceClasses

public java.util.Iterator getCurrentServiceClasses()
Returns:
an iterator for all the currently registered service classes.

getCurrentServiceSelectors

public WebFlow.Iterator getCurrentServiceSelectors(java.lang.String serviceClass)
Returns:
an iterator for all the currently available service selectors (if any) available for the specified service.

serviceAvailable

public void serviceAvailable(WebFlow.BeanContextServiceAvailableEvent bcssae)
                      throws java.lang.IllegalArgumentException
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.

serviceRevoked

public void serviceRevoked(WebFlow.BeanContextServiceRevokedEvent bcssre)
                    throws java.lang.IllegalArgumentException
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.

getChildBeanContextServicesListener

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

childJustRemovedHook

protected void childJustRemovedHook(java.lang.Object child,
                                    WebFlow.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.

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.

initializeBeanContextResources

protected void initializeBeanContextResources()
called from setBeanContext to notify a BeanContextChild to allocate resources obtained from the nesting BeanContext. subclasses may envelope this method to implement their own semantics.

fireServiceAdded

protected final void fireServiceAdded(java.lang.String serviceClass)
                               throws java.lang.IllegalArgumentException
Fire a BeanContextServiceEvent notifying of a new service

fireServiceAdded

protected final void fireServiceAdded(WebFlow.BeanContextServiceAvailableEvent bcssae)
                               throws java.lang.IllegalArgumentException

fireServiceRevoked

protected final void fireServiceRevoked(WebFlow.BeanContextServiceRevokedEvent bcsre)
                                 throws java.lang.IllegalArgumentException
Fire a BeanContextServiceEvent notifying of a service being revoked

fireServiceRevoked

protected final void fireServiceRevoked(java.lang.String serviceClass,
                                        boolean revokeNow)
                                 throws java.lang.IllegalArgumentException