IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.server.bean
Class BaseSingleAction

java.lang.Object
  extended by com.ibm.btt.server.bean.BaseSingleAction
Direct Known Subclasses:
StatefulSingleAction, StatelessSingleAction

public abstract class BaseSingleAction
extends java.lang.Object

This class is the base class for StatefulSingleAction and StatelessSingleAction. It encapsulates some basic functions, such as context operations.


Field Summary
protected  Context actionContext
          The action context.
protected  BTTUserWorkArea bttUserWorkArea
          The BTT user work area.
static java.lang.String COMPID
          Component ID for Server Bean used in trace "#SBEAN"
protected  java.lang.String id
          The action id.
protected  boolean isDistributedContext
          Indicates if the action context is disrtibuted.
protected  java.lang.String originWorkstation
          The origin workstation.
protected  BTTSystemData systemData
          The system data for this action.
 
Constructor Summary
BaseSingleAction()
           
 
Method Summary
protected  DataElement addElement(DataElement aDataElement)
          Adds a data element to the context.
protected  void assignService(java.lang.String aServiceName, java.lang.Object aServiceRequester)
          Assigns the service.
protected  void chainTo(Context aContext)
          Chains the action context to aContext.
 void close()
           
protected  void doSessionPropagation()
          This method implements session propagation
protected  java.lang.String getApplicationId()
          Returns the application id.
protected  Context getContext()
          Returns the action context.
protected  Context getContextByType(java.lang.String aContextType)
          Returns the first context of type aContextType in the chain of contexts.
protected  java.lang.String getContextName()
          Returns the action context name.
protected  DataElement getElementAt(java.lang.String aCompositeKey)
          Returns the data element identified by aCompositeKey.
protected  FormatElement getFormat(java.lang.String aFormatName)
          Returns the format named aFormatName.
protected static javax.naming.InitialContext getInitialContext()
          Get the InitialContext from dse.ini
protected  java.lang.String getInstanceId()
          Returns the instance id.
protected  KeyedCollection getKeyedCollection()
          Returns the keyed collection of the action context.
protected abstract  java.lang.String getName()
          Returns the action name.
protected  java.lang.String getOriginWorkstation()
          Returns the origin workstation.
protected  Context getParent()
          Returns the parent context of the action context.
protected  java.lang.Object getService(java.lang.String aServiceName)
          Returns the service named aServiceName.
protected  java.lang.String getSessionId()
          Returns the session id.
protected  java.lang.String getType()
          Returns the type of the action context.
protected  java.lang.Object getValueAt(java.lang.String aCompositeKey)
          Returns the value of the data element identified by aCompositeKey.
protected static java.lang.String getWorkAreaJNDI()
           
 void initialize()
          This method performs EJB initialization operation: 1.
 void initialize(BTTSystemData sys)
          This method performs EJB initialization operation: 1.
protected  boolean isChained()
          Returns true if the action context has parent.
protected  boolean isDistributedContext()
          Returns true if the action context is distributed context.
protected  java.util.Hashtable mapResponseFromCHA(java.util.Vector fieldNames)
          Mapping response data from CHA.
protected  void prune()
          Prunes the action context from the hierarchy.
protected  void releaseService(java.lang.Object aServiceRequester)
          Deprecated. do thing in BTT5.2
protected  DataElement removeAt(java.lang.String aCompositeKey)
          Removes the data element identified by aCompositeKey.
protected  boolean runInSession(java.lang.String tid)
          Set the origin workstation identifier.
protected  void setApplicationId(java.lang.String appId)
          Sets the application id.
protected  void setContext(Context aContext)
          Sets the action context.
protected  void setContextName(java.lang.String aContextName)
          Sets the action context name to aContextName.
protected  void setInstanceId(java.lang.String insid)
          Sets the instance id.
protected  void setIsDistributedContext(boolean isDistributed)
          Sets true if the action context is distributed context.
protected  void setKeyedCollection(KeyedCollection aKeyedCollection)
          Sets the keyed collection of the action context to aKeyedCollection.
protected abstract  void setName(java.lang.String aName)
          Sets the action name.
protected  void setOriginWorkstation(java.lang.String aOriginWorkstation)
          Sets the origin workstation.
protected  void setSessionId(java.lang.String sid)
          Sets the session id.
protected  void setType(java.lang.String aContextType)
          Sets the type of the action context to aContextType.
 void setupSessionContext()
          Setup session context: 1.
 void setupSessionContext(java.lang.String sessionCtxName)
          Setup session context: 1.
protected  void setValueAt(java.lang.String aCompositeKey, java.lang.Object aDataValue)
          Sets the value of the data elmement identified by aCompositeKey.
protected  void unassignService(java.lang.String aServiceName)
          Unassigns the service,releases the service from action context.
protected  void unchain()
          Unchains the action context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id
The action id.


actionContext

protected Context actionContext
The action context.


isDistributedContext

protected boolean isDistributedContext
Indicates if the action context is disrtibuted.


originWorkstation

protected java.lang.String originWorkstation
The origin workstation.


systemData

protected BTTSystemData systemData
The system data for this action.


bttUserWorkArea

protected BTTUserWorkArea bttUserWorkArea
The BTT user work area.


COMPID

public static final java.lang.String COMPID
Component ID for Server Bean used in trace "#SBEAN"

See Also:
Constant Field Values
Constructor Detail

BaseSingleAction

public BaseSingleAction()
Method Detail

initialize

public void initialize()
                throws BTTSAEException
This method performs EJB initialization operation: 1. Initialize the action EJB attributes from its deployment descriptor. 2. Create the action context and chains it to the session context.

Throws:
BTTSAEException

initialize

public void initialize(BTTSystemData sys)
                throws BTTSAEException
This method performs EJB initialization operation: 1. Initialize the action EJB attributes from its deployment descriptor. 2. Create the action context and chains it to the session context.

Throws:
BTTSAEException

setupSessionContext

public void setupSessionContext()
                         throws DSEInvalidRequestException,
                                BTTSAEException
Setup session context: 1. Get the parent context. 2. Create the session context and chains it to the parent context. 3. Set session instance ID to BTTSystemData instanceId.

Throws:
BTTSAEException
DSEInvalidRequestException

setupSessionContext

public void setupSessionContext(java.lang.String sessionCtxName)
                         throws BTTSAEException
Setup session context: 1. Get the parent context. 2. Create the session context and chains it to the parent context. 3. Set session instance ID to BTTSystemData instanceId.

Throws:
BTTSAEException

close

public void close()
           throws BTTSAEException
Throws:
BTTSAEException

getName

protected abstract java.lang.String getName()
                                     throws BTTSAEException
Returns the action name.

Returns:
java.lang.String The action name.
Throws:
BTTSAEException

setName

protected abstract void setName(java.lang.String aName)
                         throws BTTSAEException
Sets the action name.

Parameters:
aName - The actoin name.
Throws:
BTTSAEException

getContext

protected Context getContext()
Returns the action context.

Returns:
com.ibm.btt.base.Context The action context.

setContext

protected void setContext(Context aContext)
Sets the action context.

Parameters:
aContext - The action context.

isDistributedContext

protected boolean isDistributedContext()
Returns true if the action context is distributed context.

Returns:
boolean If the action context is distributed context.

setIsDistributedContext

protected void setIsDistributedContext(boolean isDistributed)
Sets true if the action context is distributed context.

Parameters:
isDistributed - If the action context is distributed context.

getSessionId

protected java.lang.String getSessionId()
Returns the session id.

Returns:
java.lang.String The session id.

setSessionId

protected void setSessionId(java.lang.String sid)
Sets the session id.

Parameters:
sid - The session id.

getApplicationId

protected java.lang.String getApplicationId()
Returns the application id.

Returns:
java.lang.String The application id.

setApplicationId

protected void setApplicationId(java.lang.String appId)
Sets the application id.

Parameters:
appId - The application id.

getInstanceId

protected java.lang.String getInstanceId()
Returns the instance id.

Returns:
java.lang.String The instance id.

setInstanceId

protected void setInstanceId(java.lang.String insid)
Sets the instance id.

Parameters:
sid - The instance id.

getOriginWorkstation

protected java.lang.String getOriginWorkstation()
Returns the origin workstation.

Returns:
java.lang.String The origin workstation.

setOriginWorkstation

protected void setOriginWorkstation(java.lang.String aOriginWorkstation)
Sets the origin workstation.

Parameters:
aOriginWorkstation - The origin workstation.

addElement

protected DataElement addElement(DataElement aDataElement)
                          throws BTTSAEException
Adds a data element to the context.

Parameters:
aDataElement - The data element.
Returns:
com.ibm.btt.base.DataElement The data element added.
Throws:
BTTSAEException

getElementAt

protected DataElement getElementAt(java.lang.String aCompositeKey)
                            throws BTTSAEException
Returns the data element identified by aCompositeKey.

Parameters:
aCompositeKey - The composite key.
Returns:
com.ibm.btt.base.DataElement The data element.
Throws:
BTTSAEException

removeAt

protected DataElement removeAt(java.lang.String aCompositeKey)
                        throws BTTSAEException
Removes the data element identified by aCompositeKey.

Parameters:
aCompositeKey - The composite key.
Returns:
com.ibm.btt.base.DataElement The data element.
Throws:
BTTSAEException

getValueAt

protected java.lang.Object getValueAt(java.lang.String aCompositeKey)
                               throws BTTSAEException
Returns the value of the data element identified by aCompositeKey.

Parameters:
aCompositeKey - The composite key.
Returns:
java.lang.Object The value of the data element.
Throws:
BTTSAEException

setValueAt

protected void setValueAt(java.lang.String aCompositeKey,
                          java.lang.Object aDataValue)
                   throws BTTSAEException
Sets the value of the data elmement identified by aCompositeKey.

Parameters:
aCompositeKey - The composite key.
aDataValue - The value.
Throws:
BTTSAEException

getKeyedCollection

protected KeyedCollection getKeyedCollection()
                                      throws BTTSAEException
Returns the keyed collection of the action context.

Returns:
com.ibm.btt.base.KeyedCollection The keyed collection.
Throws:
BTTSAEException

setKeyedCollection

protected void setKeyedCollection(KeyedCollection aKeyedCollection)
                           throws BTTSAEException
Sets the keyed collection of the action context to aKeyedCollection.

Parameters:
aKeyedCollection - The keyed collection.
Throws:
BTTSAEException

getType

protected java.lang.String getType()
                            throws BTTSAEException
Returns the type of the action context.

Returns:
java.lang.String The type.
Throws:
BTTSAEException

setType

protected void setType(java.lang.String aContextType)
                throws BTTSAEException
Sets the type of the action context to aContextType.

Parameters:
aContextType - The type.
Throws:
BTTSAEException

chainTo

protected void chainTo(Context aContext)
                throws BTTSAEException
Chains the action context to aContext.

Parameters:
aContext - The context.
Throws:
BTTSAEException

isChained

protected boolean isChained()
                     throws BTTSAEException
Returns true if the action context has parent.

Returns:
boolean If the action context has parent.
Throws:
BTTSAEException

getContextByType

protected Context getContextByType(java.lang.String aContextType)
                            throws BTTSAEException
Returns the first context of type aContextType in the chain of contexts.

Parameters:
aContextType - The context type.
Returns:
com.ibm.btt.base.Context The context.
Throws:
BTTSAEException

getContextName

protected java.lang.String getContextName()
Returns the action context name.

Returns:
java.lang.String The action context name.

setContextName

protected void setContextName(java.lang.String aContextName)
Sets the action context name to aContextName.

Parameters:
aContextName - The action context name.

getParent

protected Context getParent()
                     throws BTTSAEException
Returns the parent context of the action context.

Returns:
com.ibm.btt.base.Context The parent context.
Throws:
BTTSAEException

unchain

protected void unchain()
                throws BTTSAEException
Unchains the action context.

Throws:
BTTSAEException

prune

protected void prune()
              throws BTTSAEException
Prunes the action context from the hierarchy.

Throws:
BTTSAEException

getFormat

protected FormatElement getFormat(java.lang.String aFormatName)
                           throws java.io.IOException
Returns the format named aFormatName.

Parameters:
aFormatName - The format name.
Returns:
com.ibm.btt.formatter.client.FormatElement The format.
Throws:
java.io.IOException

getService

protected java.lang.Object getService(java.lang.String aServiceName)
                               throws BTTSAEException
Returns the service named aServiceName.

Parameters:
aServiceName - The name of the service.
Returns:
Object The service Object
Throws:
BTTSAEException

releaseService

protected void releaseService(java.lang.Object aServiceRequester)
                       throws BTTSAEException
Deprecated. do thing in BTT5.2

Releases the service.

Parameters:
aServiceRequester - The service.
Throws:
BTTSAEException

assignService

protected void assignService(java.lang.String aServiceName,
                             java.lang.Object aServiceRequester)
                      throws BTTSAEException
Assigns the service.

Parameters:
aServiceName - The service name.
Object - The service.
Throws:
BTTSAEException

unassignService

protected void unassignService(java.lang.String aServiceName)
                        throws BTTSAEException
Unassigns the service,releases the service from action context.

Parameters:
aServiceName - The service name.
Throws:
BTTSAEException

mapResponseFromCHA

protected java.util.Hashtable mapResponseFromCHA(java.util.Vector fieldNames)
                                          throws BTTSAEException
Mapping response data from CHA.

Parameters:
fieldNames - The field names.
Returns:
java.util.Hashtable The response data.
Throws:
BTTSAEException

runInSession

protected boolean runInSession(java.lang.String tid)
Set the origin workstation identifier.

Parameters:
tid - The origin workstation.
Returns:
boolean True if the input param is not null.

doSessionPropagation

protected void doSessionPropagation()
                             throws BTTSAEException
This method implements session propagation

Throws:
BTTSAEException

getInitialContext

protected static javax.naming.InitialContext getInitialContext()
                                                        throws DSEInvalidRequestException,
                                                               BTTSAEException
Get the InitialContext from dse.ini

Returns:
InitialContext
Throws:
DSEInvalidRequestException
BTTSAEException

getWorkAreaJNDI

protected static java.lang.String getWorkAreaJNDI()
                                           throws BTTSAEException
Throws:
BTTSAEException

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008