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.
-
VersionContextDip()
- Constructs a VersionContext.
-
changeVersion(long)
- Change the version based on the version identifier.
-
createImplementation(Object)
- Returns a pointer to this dip.
-
createPropertyChangeListener(Object, String[])
- Returns an array of PropertyChangeListeners describing the method to
call after the dipped bean's property change method is called.
-
getContextElement()
- Gets version data for an instance.
-
getContextElementName()
- Gets the context element name, version in this case.
-
getCurrentVersionID()
- Gets the current version identifier.
-
getUpdatePolicy()
- Gets the update policy for this context element.
-
getVersions()
- Gets the version context element.
-
propertyChange(PropertyChangeEvent)
- Checks to see if the property changed is in the
context update policy.
-
retrieveDip()
- Satisfies the DipPropertyChangeListener interface.
-
setContextElement(Object)
- Sets the version data for an instance.
-
setUpdatePolicy(ContextUpdatePolicy)
- Sets the update policy for this context element.
-
typeName()
- Returns the dip type name as a String.
VersionContextDip
public VersionContextDip()
- Constructs a VersionContext.
getVersions
public Vector getVersions()
- Gets the version context element.
- Returns:
- A Vector containing the version information.
getCurrentVersionID
public long getCurrentVersionID()
- Gets the current version identifier.
- Returns:
- A long, the current version identifier.
getContextElement
public Object getContextElement()
- Gets version data for an instance.
- Returns:
- A Vector of version data, as an Object.
setContextElement
public void setContextElement(Object o)
- Sets the version data for an instance.
- Parameters:
- o - A VersionData object
getContextElementName
public String getContextElementName()
- Gets the context element name, version in this case.
- Returns:
- The string version, representing the context element name.
getUpdatePolicy
public ContextUpdatePolicy getUpdatePolicy()
- Gets the update policy for this context element.
- Returns:
- A context policy update object
setUpdatePolicy
public void setUpdatePolicy(ContextUpdatePolicy up)
- Sets the update policy for this context element.
- Parameters:
- up - The context policy update object for this element.
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
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
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
retrieveDip
public Dip retrieveDip()
- Satisfies the DipPropertyChangeListener interface.
- Returns:
- a reference to this instance.
- Overrides:
- retrieveDip in class SimpleDip
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.
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