WebFlow
Class BeanContextSupport

WebFlow.BeanContextSupport

public class BeanContextSupport


Inner Class Summary
protected  class BeanContextSupport.BCSChild
           
protected static class BeanContextSupport.BCSIterator
          protected final subclass that encapsulates an iterator but implements a noop remove() method.
 
Field Summary
protected  java.util.ArrayList bcmListeners
          all accesses to the protected ArrayList bcmListeners field shall be synchronized on that object.
protected  myHashMap children
          all accesses to the protected HashMap children field shall be synchronized on that object.
protected  boolean designTime
           
protected  java.util.Locale locale
           
protected  boolean okToUseGui
           
 
Constructor Summary
BeanContextSupport(org.omg.CORBA.Object peer, org.omg.CORBA.ORB orb)
           Construct a BeanContextSupport instance
 
Method Summary
 boolean _equals(org.omg.CORBA.Object obj)
           
 int _hashCode()
           
 boolean add(org.omg.CORBA.Object targetChild)
           Adds/nests a child within this BeanContext Invoked as a side effect of java.beans.Beans.instantiate().
 boolean addAll(java.util.Collection c)
          add Collection to set of Children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
 void addBeanContextMembershipListener(WebFlow.BeanContextMembershipListener bcml)
          Adds a BeanContextMembershipListener
 boolean addNamedChild(org.omg.CORBA.Object targetChild, java.lang.String objectId)
           
 boolean addNamedChildSlaveServer(org.omg.CORBA.Object targetChild, java.lang.String objectId)
           
protected  java.util.Iterator bcsChildren()
           
protected  void childJustAddedHook(java.lang.Object child, BeanContextSupport.BCSChild bcsc)
          subclasses may override this method to simply extend add() semantics after the child has been added and before the event notification has occurred.
protected  void childJustRemovedHook(java.lang.Object child, BeanContextSupport.BCSChild bcsc)
          subclasses may override this method to simply extend remove() semantics after the child has been removed and before the event notification has occurred.
protected static boolean classEquals(java.lang.Class first, java.lang.Class second)
           
 void clear()
          clear the children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
 boolean contains(org.omg.CORBA.Object o)
           
 boolean contains(java.lang.String objectID)
           
 boolean containsAll(java.util.Collection c)
           
protected  BeanContextSupport.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  BeanContextSupport.BCSChild createBCSChild(org.omg.CORBA.Object targetChild, org.omg.CORBA.Object peer, java.lang.String childName)
           
protected  void fireChildrenAdded(BeanContextMembershipEventImpl bcme)
          Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
protected  void fireChildrenRemoved(BeanContextMembershipEventImpl bcme)
          Fire a BeanContextshipEvent on the BeanContextMembershipListener interface
 org.omg.CORBA.Object getBeanContextPeer()
           
protected  org.omg.CORBA.Object getChildBeanContextChild(org.omg.CORBA.Object child)
           
protected  org.omg.CORBA.Object getChildBeanContextChild(java.lang.String objectID)
           
protected static org.omg.CORBA.Object getChildBeanContextMembershipListener(java.lang.Object child)
           
protected static org.omg.CORBA.Object getChildPropertyChangeListener(java.lang.Object child)
           
protected static boolean getChildSerializable(java.lang.Object obj)
           
protected static org.omg.CORBA.Object getChildVetoableChangeListener(java.lang.Object child)
           
 void getResource(java.lang.String name, WebFlow.BeanContextChild bcc)
           
 void getResourceAsStream(java.lang.String name, WebFlow.BeanContextChild bcc)
           
protected  void initialize()
          protected method called from constructor and readObject to initialize transient state of BeanContextSupport instance.
 org.omg.CORBA.Object instantiateChild(java.lang.String beanName)
           The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext.
 boolean isEmpty()
           
 boolean isSerializing()
           
 java.util.Iterator iterator()
           
 boolean remove(org.omg.CORBA.Object targetChild)
           
protected  boolean remove(org.omg.CORBA.Object targetChild, boolean callChildSetBC)
           
 boolean remove(java.lang.String objectID)
           
protected  boolean remove(java.lang.String objectID, boolean callChildSetBC)
           
 boolean removeAll(java.util.Collection c)
          remove all specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
 void removeBeanContextMembershipListener(WebFlow.BeanContextMembershipListener bcml)
          Removes a BeanContextMembershipListener
 boolean retainAll(java.util.Collection c)
          retain only specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field
 int size()
           
 org.omg.CORBA.Object[] toArray()
           
 org.omg.CORBA.Object[] toArrayInList(org.omg.CORBA.Object[] arry)
           
protected  boolean validatePendingAdd(java.lang.Object targetChild)
           Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being added to the BeanContext.
protected  boolean validatePendingRemove(java.lang.Object targetChild)
           Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being removed from the BeanContext.
 

Field Detail

children

protected transient myHashMap children
all accesses to the protected HashMap children field shall be synchronized on that object.

bcmListeners

protected transient java.util.ArrayList bcmListeners
all accesses to the protected ArrayList bcmListeners field shall be synchronized on that object.

locale

protected java.util.Locale locale

okToUseGui

protected boolean okToUseGui

designTime

protected boolean designTime
Constructor Detail

BeanContextSupport

public BeanContextSupport(org.omg.CORBA.Object peer,
                          org.omg.CORBA.ORB orb)
                   throws java.lang.NullPointerException

Construct a BeanContextSupport 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.
Method Detail

getBeanContextPeer

public org.omg.CORBA.Object getBeanContextPeer()
Returns:
the instance of BeanContext this object is providing the implementation for.

instantiateChild

public org.omg.CORBA.Object instantiateChild(java.lang.String beanName)

The instantiateChild method is a convenience hook in BeanContext to simplify the task of instantiating a Bean, nested, into a BeanContext.

The semantics of the beanName parameter are defined by java.beans.Beans.instantate.

Parameters:
beanName - the name of the Bean to instantiate within this BeanContext

_hashCode

public int _hashCode()

_equals

public boolean _equals(org.omg.CORBA.Object obj)

size

public int size()
Returns:
number of children

isEmpty

public boolean isEmpty()
Returns:
if there are not children

contains

public boolean contains(org.omg.CORBA.Object o)
Returns:
if this object is a child

contains

public boolean contains(java.lang.String objectID)
Returns:
if this object is a child

iterator

public java.util.Iterator iterator()
Returns:
the iterator

toArray

public org.omg.CORBA.Object[] toArray()
Returns:
an array of children

toArrayInList

public org.omg.CORBA.Object[] toArrayInList(org.omg.CORBA.Object[] arry)
Returns:
an array of children

createBCSChild

protected BeanContextSupport.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 tragetChild and the peer are related by an implementation of BeanContextProxy

createBCSChild

protected BeanContextSupport.BCSChild createBCSChild(org.omg.CORBA.Object targetChild,
                                                     org.omg.CORBA.Object peer,
                                                     java.lang.String childName)

add

public boolean add(org.omg.CORBA.Object targetChild)
            throws java.lang.IllegalArgumentException,
                   java.lang.IllegalStateException,
                   java.lang.NullPointerException

Adds/nests a child within this BeanContext

Invoked as a side effect of java.beans.Beans.instantiate().

Parameters:
targetChildren - The child objects to nest within this BeanContext

addNamedChild

public boolean addNamedChild(org.omg.CORBA.Object targetChild,
                             java.lang.String objectId)
                      throws java.lang.IllegalArgumentException,
                             java.lang.IllegalStateException,
                             java.lang.NullPointerException

addNamedChildSlaveServer

public boolean addNamedChildSlaveServer(org.omg.CORBA.Object targetChild,
                                        java.lang.String objectId)
                                 throws java.lang.IllegalArgumentException,
                                        java.lang.IllegalStateException,
                                        java.lang.NullPointerException

remove

public boolean remove(org.omg.CORBA.Object targetChild)
Parameters:
targetChildren - The child objects to remove

remove

public boolean remove(java.lang.String objectID)

remove

protected boolean remove(org.omg.CORBA.Object targetChild,
                         boolean callChildSetBC)
                  throws java.lang.IllegalArgumentException,
                         java.lang.IllegalStateException

remove

protected boolean remove(java.lang.String objectID,
                         boolean callChildSetBC)
                  throws java.lang.IllegalArgumentException,
                         java.lang.IllegalStateException

containsAll

public boolean containsAll(java.util.Collection c)
Returns:
if all object objects in specified Collection are children.

addAll

public boolean addAll(java.util.Collection c)
add Collection to set of Children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field

removeAll

public boolean removeAll(java.util.Collection c)
remove all specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field

retainAll

public boolean retainAll(java.util.Collection c)
retain only specified children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field

clear

public void clear()
clear the children (Unsupported) implementations must synchronized on the hierarchy lock and "children" protected field

addBeanContextMembershipListener

public void addBeanContextMembershipListener(WebFlow.BeanContextMembershipListener bcml)
                                      throws java.lang.NullPointerException
Adds a BeanContextMembershipListener
Parameters:
bcml - the BeanContextMembershipListener to add

removeBeanContextMembershipListener

public void removeBeanContextMembershipListener(WebFlow.BeanContextMembershipListener bcml)
                                         throws java.lang.NullPointerException
Removes a BeanContextMembershipListener
Parameters:
bcml - the BeanContextMembershipListener to remove

getResourceAsStream

public void getResourceAsStream(java.lang.String name,
                                WebFlow.BeanContextChild bcc)
Parameters:
name - the name of the resource requested.
child - the child object making the request.
Returns:
the requested resource as an InputStream

getResource

public void getResource(java.lang.String name,
                        WebFlow.BeanContextChild bcc)
Parameters:
name - the name of the resource requested.
child - the child object making the request.
Returns:
the requested resource as an InputStream

isSerializing

public boolean isSerializing()
Returns:
if this BeanContext is currently being serialized

bcsChildren

protected java.util.Iterator bcsChildren()
Returns:
an iterator for all the current BCSChild values

validatePendingAdd

protected boolean validatePendingAdd(java.lang.Object targetChild)

Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being added to the BeanContext.


validatePendingRemove

protected boolean validatePendingRemove(java.lang.Object targetChild)

Subclasses of this class may override, or envelope, this method to add validation behavior for the BeanContext to examine child objects immediately prior to their being removed from the BeanContext.


childJustAddedHook

protected void childJustAddedHook(java.lang.Object child,
                                  BeanContextSupport.BCSChild bcsc)
subclasses may override this method to simply extend add() semantics after the child has been added and before the event notification has occurred. The method is called with the child synchronized.

childJustRemovedHook

protected void childJustRemovedHook(java.lang.Object child,
                                    BeanContextSupport.BCSChild bcsc)
subclasses may override this method to simply extend remove() semantics after the child has been removed and before the event notification has occurred. The method is called with the child synchronized.

getChildSerializable

protected static final boolean getChildSerializable(java.lang.Object obj)

getChildPropertyChangeListener

protected static final org.omg.CORBA.Object getChildPropertyChangeListener(java.lang.Object child)
Returns:
the PropertyChangeListener (if any) of the specified child

getChildVetoableChangeListener

protected static final org.omg.CORBA.Object getChildVetoableChangeListener(java.lang.Object child)
Returns:
the VetoableChangeListener (if any) of the specified child

getChildBeanContextMembershipListener

protected static final org.omg.CORBA.Object getChildBeanContextMembershipListener(java.lang.Object child)
Returns:
the BeanContextMembershipListener (if any) of the specified child

getChildBeanContextChild

protected final org.omg.CORBA.Object getChildBeanContextChild(org.omg.CORBA.Object child)
                                                       throws java.lang.IllegalArgumentException
Returns:
the BeanContextChild (if any) of the specified child

getChildBeanContextChild

protected final org.omg.CORBA.Object getChildBeanContextChild(java.lang.String objectID)
                                                       throws java.lang.IllegalArgumentException

fireChildrenAdded

protected final void fireChildrenAdded(BeanContextMembershipEventImpl bcme)
Fire a BeanContextshipEvent on the BeanContextMembershipListener interface

fireChildrenRemoved

protected final void fireChildrenRemoved(BeanContextMembershipEventImpl bcme)
Fire a BeanContextshipEvent on the BeanContextMembershipListener interface

initialize

protected void initialize()
protected method called from constructor and readObject to initialize transient state of BeanContextSupport instance. This class uses this method to instantiate inner class listeners used to monitor PropertyChange and VetoableChange events on children. subclasses may envelope this method to add their own initialization behavior

classEquals

protected static final boolean classEquals(java.lang.Class first,
                                           java.lang.Class second)
Returns:
if two class objects, or their names are equal.