IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.automaton.ext
Class DSEOperationProcessor

java.lang.Object
  extended by com.ibm.btt.base.DSENotifier
      extended by com.ibm.btt.automaton.DSEProcessor
          extended by com.ibm.btt.automaton.ext.DSEOperationProcessor
All Implemented Interfaces:
Executable, Processor, Cacheable, Notifier, Operation, java.io.Externalizable, java.io.Serializable

public class DSEOperationProcessor
extends DSEProcessor
implements Operation

This class provides the behaviour of the processor class plus the required Operation interface. It allows to model operations as state machines by handling the actual steps of the operation as actions inside the different states that an operation flow may have. See DSEStep to see how specific steps may be built using this approach for business operation flows.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.automaton.DSEProcessor
ABORTED, aProcessorStatusChangedListener, CHANGESTATE, CLEAN_EVENTS_QUEUE_ON_SWITCH, cleanQueueOnSwitch, COMPLETED, context, currentState, eventQueue, externalizer, INITIALIZED, NOT_INITIALIZED, processorId, processorName, RUNNING, stateTag, status, STATUSCHANGEEVENT, SUSPENDED, TERMINATEEVENT
 
Fields inherited from class com.ibm.btt.base.DSENotifier
handlersList, name
 
Fields inherited from interface com.ibm.btt.automaton.Processor
COMPID
 
Constructor Summary
DSEOperationProcessor()
          This constructor creates a DSEProcessorOperation object.
DSEOperationProcessor(boolean mustRegister)
          This constructor creates a DSEProcessorOperation object.
DSEOperationProcessor(java.lang.String aName)
          This constructor creates a DSEProcessorOperation object.
DSEOperationProcessor(java.lang.String aName, java.lang.String aTID)
          This constructor creates a DSEProcessorOperation object.
 
Method Summary
 DataElement addElement(DataElement aDataElement)
          Adds an element aDataElement to the KeyedCollection of the context.
 void addOperationRepliedListener(OperationRepliedListener newListener)
          Adds an operation replied listener.
 void chainTo(Context aContext)
          Sets the receiving context as a child of aContext and as the new current child.
 void close()
          This method must include whatever housekeeping process before ending the operation process.
 java.lang.String getApplicationId()
          Returns the value of the applicationId property.
 java.lang.String getContextName()
          Returns the context name.
 DataElement getElementAt(java.lang.String aCompositeKey)
          Returns the DataElement identified by the aCompositeKey parameter.
 java.lang.Object getFormat(java.lang.String aFormatName)
          Returns the formatElement named aFormatName from the formats Hashtable.
 Hashtable getFormats()
          Gets the formats property (com.ibm.btt.base.Hashtable) value.
 KeyedCollection getKeyedCollection()
          Returns the context keyedCollection.
 Context getParent()
          Returns the Context object defined as the parent context of the operation context.
 Service getService(java.lang.String aServiceName)
          Returns the service named aServiceName from the chain of contexts attached to the operation.
 java.lang.String getType()
          Returns the operation context type.
 java.lang.Object getValueAt(java.lang.String aCompositeKey)
          Returns value of the data element identified by aConpositeKey.
 java.lang.Object initializeFormatFrom(Tag aTag)
          This method finds, instantiates, and adds the format element referred to by aTag, into the operation's formats.
 java.lang.Object initializeFrom(Tag aTag)
          This method uses the processor's Tag attributes to initialize a Processor with an Id and a context.
 boolean isChained()
          Returns true if the operation context is chained to the hierarchy.
 void prune()
          Removes the operation context from the hierarchy.
 DataElement removeAt(java.lang.String aCompositeKey)
          Removes the data element identified by aCompositeKey from the context data collection.
 void removeOperationRepliedListener(OperationRepliedListener newListener)
          Removes the operation replied listener.
 void setApplicationId(java.lang.String appId)
          Sets the value of the applicationId property.
 void setContextName(java.lang.String aContextName)
          This method sets the context identifier to aContextName.
 void setFormats(Hashtable formats)
          Sets the formats property (com.ibm.btt.base.Hashtable) value.
 void setKeyedCollection(KeyedCollection aKeyedCollection)
          Sets the operation context keyed collection to aKeyedCollection.
 void setType(java.lang.String aType)
          Sets the context type to aContextType.
 void setValueAt(java.lang.String aCompositeKey, java.lang.Object aDataValue)
          Sets the value of the data identified by aCompositeKey to aDataValue.
 void unchain()
          Removes the operation context from the context hierarchy.
 java.lang.String[] xValidate()
          Returns a String that indicates if the validation has been achieved successfully or not.
 
Methods inherited from class com.ibm.btt.automaton.DSEProcessor
abort, addProcessorStatusChangedListener, changeState, changeState, cleanEventQueue, clearKeyedCollection, execute, externalizer, fireProcessorStatusChangedEvent, fireProcessorTerminatedEvent, getContext, getCurrentState, getCurrentStateType, getEventQueue, getExternalizer, getInitialStateTag, getProcessorId, getProcessorName, getRefServiceTags, getStateTag, getStateTagById, getStateTagList, getStatus, getTag, getTimeout, initialize, initializeKeyedCollectionValueFrom, isCacheable, isCleanQueueOnSwitch, readExternal, readExternal, readObject, reinitialize, removeExternal, resume, setCleanQueueOnSwitch, setContext, setCurrentState, setCurrentStateType, setEventQueue, setExternalizer, setProcessorId, setProcessorName, setStatus, setTag, suspend, terminate, toString, toStrings, toTags, writeExternal, writeExternal
 
Methods inherited from class com.ibm.btt.base.DSENotifier
addHandler, getHandlersList, getName, removeHandler, setName, signalEvent, signalEvent, signalEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.base.Operation
execute, getContext, getName, setContext, setName
 
Methods inherited from interface com.ibm.btt.base.Cacheable
isCacheable, reinitialize
 
Methods inherited from interface com.ibm.btt.automaton.Processor
addHandler, getHandlersList, signalEvent
 
Methods inherited from interface com.ibm.btt.base.Externalizable
getName, setName
 

Constructor Detail

DSEOperationProcessor

public DSEOperationProcessor()
This constructor creates a DSEProcessorOperation object.


DSEOperationProcessor

public DSEOperationProcessor(java.lang.String aName)
This constructor creates a DSEProcessorOperation object.

Parameters:
aName - java.lang.String

DSEOperationProcessor

public DSEOperationProcessor(java.lang.String aName,
                             java.lang.String aTID)
This constructor creates a DSEProcessorOperation object.

Parameters:
aName - java.lang.String
aTID - java.lang.String

DSEOperationProcessor

public DSEOperationProcessor(boolean mustRegister)
This constructor creates a DSEProcessorOperation object.

Parameters:
mustRegister - boolean
Method Detail

addElement

public DataElement addElement(DataElement aDataElement)
                       throws DSEInvalidRequestException
Adds an element aDataElement to the KeyedCollection of the context. Refer to the Context class addElement method for an example of implementing this method.

This method throws a DSEInvalidRequestException.

Specified by:
addElement in interface Operation
Parameters:
aDataElement - DataElement
Returns:
DataElement
Throws:
DSEInvalidRequestException

addOperationRepliedListener

public void addOperationRepliedListener(OperationRepliedListener newListener)
Adds an operation replied listener.

Specified by:
addOperationRepliedListener in interface Operation
Parameters:
newListener - com.ibm.btt.base.OperationRepliedListener

chainTo

public void chainTo(Context aContext)
             throws DSEInvalidRequestException
Sets the receiving context as a child of aContext and as the new current child. Refer to the Context class chainTo method for an example of implementing this method.

This method throws a DSEInvalidRequestException.

Specified by:
chainTo in interface Operation
Throws:
DSEInvalidRequestException

close

public void close()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
This method must include whatever housekeeping process before ending the operation process.

Specified by:
close in interface Processor
Specified by:
close in interface Operation
Overrides:
close in class DSEProcessor
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

getApplicationId

public java.lang.String getApplicationId()
Returns the value of the applicationId property.

Specified by:
getApplicationId in interface Operation
Returns:
String - The sessionId value.

getContextName

public java.lang.String getContextName()
Returns the context name.

Specified by:
getContextName in interface Operation
Returns:
String

getElementAt

public DataElement getElementAt(java.lang.String aCompositeKey)
                         throws DSEObjectNotFoundException
Returns the DataElement identified by the aCompositeKey parameter. Refer to the same method in KeyedCollection class for an example of implementing this method.

Specified by:
getElementAt in interface Operation
Throws:
DSEObjectNotFoundException

getFormat

public java.lang.Object getFormat(java.lang.String aFormatName)
                           throws DSEInvalidArgumentException
Returns the formatElement named aFormatName from the formats Hashtable.

Specified by:
getFormat in interface Operation
Throws:
DSEInvalidArgumentException

getFormats

public Hashtable getFormats()
Gets the formats property (com.ibm.btt.base.Hashtable) value.

Specified by:
getFormats in interface Operation
Returns:
com.ibm.btt.base.Hashtable
See Also:
setFormats(com.ibm.btt.base.Hashtable)

getKeyedCollection

public KeyedCollection getKeyedCollection()
                                   throws DSEInvalidRequestException
Returns the context keyedCollection. Refer to the Context class getKeyedCollection method for an example of implementing this method.

Specified by:
getKeyedCollection in interface Operation
Returns:
KeyedCollection
Throws:
DSEInvalidRequestException

getParent

public Context getParent()
                  throws DSEInvalidRequestException
Returns the Context object defined as the parent context of the operation context.

Specified by:
getParent in interface Operation
Returns:
Context
Throws:
DSEInvalidRequestException

getService

public Service getService(java.lang.String aServiceName)
                   throws DSEObjectNotFoundException
Returns the service named aServiceName from the chain of contexts attached to the operation. Refer to the Context class getService method for an example of implementing this method.

This method throws a DSEObjectNotFoundException if the service is not found.

Specified by:
getService in interface Operation
Overrides:
getService in class DSEProcessor
Throws:
DSEObjectNotFoundException

getType

public java.lang.String getType()
                         throws DSEInvalidRequestException
Returns the operation context type.

Specified by:
getType in interface Operation
Returns:
Type
Throws:
DSEInvalidRequestException

getValueAt

public java.lang.Object getValueAt(java.lang.String aCompositeKey)
                            throws DSEObjectNotFoundException
Returns value of the data element identified by aConpositeKey. Refer to the same method of the KeyedCollection class for an example of implementing this method.

This method throws a DSEObjectNotFoundException if the data element is not found.

Specified by:
getValueAt in interface Operation
Throws:
DSEObjectNotFoundException

initializeFormatFrom

public java.lang.Object initializeFormatFrom(Tag aTag)
                                      throws java.io.IOException
This method finds, instantiates, and adds the format element referred to by aTag, into the operation's formats.

Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException,
                                       DSEProcessorException
This method uses the processor's Tag attributes to initialize a Processor with an Id and a context. After completing this, the Tag is stored in an instance variable so that when a State is ready to be instantiated, the State subTags can be extracted from this tag. This method is an Externalizable interface method.

Overrides:
initializeFrom in class DSEProcessor
Parameters:
aTag - com.ibm.btt.base.Tag Contains the name and attributes of the object to be created.
Returns:
Object - An instance of DSEOperationProcessor.
Throws:
java.io.IOException - The object can not be created.
DSEException
DSEProcessorException

isChained

public boolean isChained()
                  throws DSEInvalidRequestException
Returns true if the operation context is chained to the hierarchy.

Specified by:
isChained in interface Operation
Returns:
boolean
Throws:
DSEInvalidRequestException

prune

public void prune()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
Removes the operation context from the hierarchy. All of its descendants become orphans. Refer to the Context class prune method for an example of implementing this method.

This method throws a DSEInvalidRequestException and throws a DSEObjectNotFoundException.

Specified by:
prune in interface Operation
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

removeAt

public DataElement removeAt(java.lang.String aCompositeKey)
                     throws DSEInvalidRequestException,
                            DSEObjectNotFoundException
Removes the data element identified by aCompositeKey from the context data collection. Refer to the Context class removeAt method for an example of implementing this method.

This method throws a DSEInvalidRequestException and throws a DSEObjectNotFoundException.

Specified by:
removeAt in interface Operation
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

removeOperationRepliedListener

public void removeOperationRepliedListener(OperationRepliedListener newListener)
Removes the operation replied listener.

Specified by:
removeOperationRepliedListener in interface Operation
Parameters:
newListener - com.ibm.btt.base.OperationRepliedListener

setApplicationId

public void setApplicationId(java.lang.String appId)
Sets the value of the applicationId property.

Specified by:
setApplicationId in interface Operation
Parameters:
appId - String The new value of the applicationId.

setContextName

public void setContextName(java.lang.String aContextName)
This method sets the context identifier to aContextName.

Specified by:
setContextName in interface Operation
Parameters:
aContextName - String

setFormats

public void setFormats(Hashtable formats)
Sets the formats property (com.ibm.btt.base.Hashtable) value.

Parameters:
formats - The new value for the property.
See Also:
getFormats()

setKeyedCollection

public void setKeyedCollection(KeyedCollection aKeyedCollection)
                        throws DSEInvalidRequestException
Sets the operation context keyed collection to aKeyedCollection.

Specified by:
setKeyedCollection in interface Operation
Parameters:
aKeyedCollection - KeyedCollection
Throws:
DSEInvalidRequestException

setType

public void setType(java.lang.String aType)
             throws DSEInvalidRequestException
Sets the context type to aContextType.

Specified by:
setType in interface Operation
Parameters:
aType - String
Throws:
DSEInvalidRequestException

setValueAt

public void setValueAt(java.lang.String aCompositeKey,
                       java.lang.Object aDataValue)
                throws DSEObjectNotFoundException,
                       DSEInvalidArgumentException
Sets the value of the data identified by aCompositeKey to aDataValue.

This method throws a DSEInvalidRequestException if the data type doesn't allow a setValue() and throws a DSEObjectNotFoundException if the data element is not found.

Specified by:
setValueAt in interface Operation
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException
DSEInvalidArgumentException

unchain

public void unchain()
             throws DSEInvalidRequestException,
                    DSEObjectNotFoundException
Removes the operation context from the context hierarchy. The parent attribute is set to null and the operation context is removed from the children list in the parent context. The receiving context cannot have children. Refer to the Context class unchain method for an example of implementing this method.

This method throws a DSEInvalidRequestException and throws a DSEObjectNotFoundException.

Specified by:
unchain in interface Operation
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

xValidate

public java.lang.String[] xValidate()
Returns a String that indicates if the validation has been achieved successfully or not. If null the validation has been achieved successfully if is a String[] then the validation has not been achieved succefully and returns its error messages.

Specified by:
xValidate in interface Operation
Returns:
String[] - the result of the validation (null or error messages).

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011