All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.beans.samples.dips.context.VersionContextDip

java.lang.Object
   |
   +----com.ibm.beans.dip.SimpleDip
           |
           +----com.ibm.beans.samples.dips.context.VersionContextDip

public final class VersionContextDip
extends SimpleDip
implements ContextElement, Serializable, DipPropertyChangeListener
Version Context allows end user or assembly expert to keep track of the version of an instance of a bean. The update policy determines when the version changes. The update policy is set at dip time.


Constructor Index

 o VersionContextDip()
Constructs a VersionContext.

Method Index

 o changeVersion(long)
Change the version based on the version identifier.
 o createImplementation(Object)
Returns a pointer to this dip.
 o createPropertyChangeListener(Object, String[])
Returns an array of PropertyChangeListeners describing the method to call after the dipped bean's property change method is called.
 o getContextElement()
Gets version data for an instance.
 o getContextElementName()
Gets the context element name, version in this case.
 o getCurrentVersionID()
Gets the current version identifier.
 o getUpdatePolicy()
Gets the update policy for this context element.
 o getVersions()
Gets the version context element.
 o propertyChange(PropertyChangeEvent)
Checks to see if the property changed is in the context update policy.
 o retrieveDip()
Satisfies the DipPropertyChangeListener interface.
 o setContextElement(Object)
Sets the version data for an instance.
 o setUpdatePolicy(ContextUpdatePolicy)
Sets the update policy for this context element.
 o typeName()
Returns the dip type name as a String.

Constructors

 o VersionContextDip
 public VersionContextDip()
Constructs a VersionContext.

Methods

 o getVersions
 public Vector getVersions()
Gets the version context element.

Returns:
A Vector containing the version information.
 o getCurrentVersionID
 public long getCurrentVersionID()
Gets the current version identifier.

Returns:
A long, the current version identifier.
 o getContextElement
 public Object getContextElement()
Gets version data for an instance.

Returns:
A Vector of version data, as an Object.
 o setContextElement
 public void setContextElement(Object o)
Sets the version data for an instance.

Parameters:
o - A VersionData object
 o getContextElementName
 public String getContextElementName()
Gets the context element name, version in this case.

Returns:
The string version, representing the context element name.
 o getUpdatePolicy
 public ContextUpdatePolicy getUpdatePolicy()
Gets the update policy for this context element.

Returns:
A context policy update object
 o setUpdatePolicy
 public void setUpdatePolicy(ContextUpdatePolicy up)
Sets the update policy for this context element.

Parameters:
up - The context policy update object for this element.
 o typeName
 public final String typeName()
Returns the dip type name as a String.

Returns:
The type name of the dip.
Overrides:
typeName in class SimpleDip
 o createImplementation
 public Object createImplementation(Object obj) throws DipRejectAdditionException
Returns a pointer to this dip.

Parameters:
obj - The bean being dipped.
Throws: DipRejectAdditionException
This exception is thrown if the dip rejects being added to the bean.
Overrides:
createImplementation in class SimpleDip
 o createPropertyChangeListener
 public DipPropertyChangeListener[] createPropertyChangeListener(Object imp,
                                                                 String methods[]) throws DipRejectAdditionException
Returns an array of PropertyChangeListeners describing the method to call after the dipped bean's property change method is called. The version context dip listens for property change events itself.

Parameters:
imp - This is the implementation returned from createImplementation
methods[] - This is the array of event methods in the dippable bean.
Returns:
The array of PropertyChangeListeners, each one is this instance of the version context dip.
Throws: DipRejectAdditionException
This exception is thrown if the dip rejects being added to the bean.
Overrides:
createPropertyChangeListener in class SimpleDip
 o retrieveDip
 public Dip retrieveDip()
Satisfies the DipPropertyChangeListener interface.

Returns:
a reference to this instance.
Overrides:
retrieveDip in class SimpleDip
 o propertyChange
 public synchronized void propertyChange(PropertyChangeEvent evt)
Checks to see if the property changed is in the context update policy. If it is, it updates the version data.

Parameters:
evt - the PropertyChangeEvent that the dip heard. This is checked against the properties registered in the context update policy.
 o changeVersion
 public synchronized void changeVersion(long versionID)
Change the version based on the version identifier.

Parameters:
versionID - a long identifying the version the user wants to change to.

All Packages  Class Hierarchy  This Package  Previous  Next  Index