ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.conversation
Class SimpleConversationManager

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.ibm.able.conversation.SimpleConversationManager
All Implemented Interfaces:
AbleBean, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, java.io.Serializable

public class SimpleConversationManager
extends AbleObject
implements java.io.Serializable

This is a conversation manager implemented as an AbleBean. It manages a single conversation.

It processes inbound messages and decisions, which are both handed to it by its parent agent. It uses its parent agent's table of user-defined functions for sending decision-requests and outbound messages.

OLD VERSION -- TO BE DELETED Replaced by com.ibm.able.conversation.AbleConversation.

See Also:
Serialized Form

Field Summary
protected static long serialVersionUID
          Serialized version identifier in form YYYYMMDDVerRelModxx
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, defaultName, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
SimpleConversationManager()
           
SimpleConversationManager(java.lang.String arg0)
           
SimpleConversationManager(java.lang.String arg0, java.lang.String arg1)
           
 
Method Summary
 java.util.LinkedList getAllCphs()
          Funtion useful for introspection.
 ConversationContext getContext()
           
 java.util.Hashtable getMessageForms(java.lang.String decisionPoint)
           
 ConversationPolicyHandler getPolicyHandler()
           
 java.lang.String getRole()
          Returns the current role of the conversation manager
 void handleAbleEvent(AbleEvent theAbleEvent)
          From AbleBean -- overriden here for testing.
 void init()
          From AbleBean -- overriden here for testing.
 void process()
          From AbleBean
 void processAbleEvent(AbleEvent theAbleEvent)
          From AbleBean -- overriden here for testing.
 void processDecision(java.lang.String decisionName, java.lang.Object[] decisionData)
          Process a decision newly arrived from the decision-making system.
 void processInboundMessage(javax.agent.TransportMessage message)
          Process a message newly arrived from the messaging system.
 void reset()
          From AbleBean
 void setContext(ConversationContext context)
          Sets the ConversationContext variable inside the manager
 void setCPDoneFunction(AbleUserDefinedFunction func)
           
 void setDecisionRequestFunction(AbleUserDefinedFunction func)
           
 void setLoadCPHFunction(AbleUserDefinedFunction func)
           
 void setPolicyHandler(ConversationPolicyHandler newHandler)
           
 void setRole(java.lang.String s)
          Sets the current role for the conversation manager
 void setSendMessageFunction(AbleUserDefinedFunction func)
           
 void setTimerFunction(AbleUserDefinedFunction func)
           
 void start(java.lang.Object[] data)
          Starts the execution of the conversation manager.
 void timerExpired()
          Called by external program(agent) to indicate the expiry of a set timer.
 
Methods inherited from class com.ibm.able.AbleObject
addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, Copyright, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getDestBufferConnections, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, quitAll, quitEnabledEventProcessing, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeAll, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setDataFlowEnabled, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendAll, suspendEnabledEventProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
Serialized version identifier in form YYYYMMDDVerRelModxx
Constructor Detail

SimpleConversationManager

public SimpleConversationManager()
                          throws AbleException

SimpleConversationManager

public SimpleConversationManager(java.lang.String arg0)
                          throws AbleException

SimpleConversationManager

public SimpleConversationManager(java.lang.String arg0,
                                 java.lang.String arg1)
                          throws AbleException
Method Detail

getPolicyHandler

public ConversationPolicyHandler getPolicyHandler()

setPolicyHandler

public void setPolicyHandler(ConversationPolicyHandler newHandler)

setSendMessageFunction

public void setSendMessageFunction(AbleUserDefinedFunction func)

setDecisionRequestFunction

public void setDecisionRequestFunction(AbleUserDefinedFunction func)

setLoadCPHFunction

public void setLoadCPHFunction(AbleUserDefinedFunction func)

setCPDoneFunction

public void setCPDoneFunction(AbleUserDefinedFunction func)

setTimerFunction

public void setTimerFunction(AbleUserDefinedFunction func)

getContext

public ConversationContext getContext()

reset

public void reset()
           throws AbleException
From AbleBean
Overrides:
reset in class AbleObject
Following copied from class: com.ibm.able.AbleObject
Throws:
AbleException - If an error occurs.
See Also:
AbleBean.reset()

init

public void init()
          throws AbleException
From AbleBean -- overriden here for testing.
Overrides:
init in class AbleObject
Following copied from class: com.ibm.able.AbleObject
Throws:
AbleException - If an error occurs.
See Also:
AbleObject.startEnabledEventProcessing()

process

public void process()
             throws AbleException
From AbleBean
Overrides:
process in class AbleObject
Following copied from class: com.ibm.able.AbleObject
See Also:
AbleObject.inputBuffer, AbleObject.outputBuffer, AbleBean.process()

handleAbleEvent

public void handleAbleEvent(AbleEvent theAbleEvent)
                     throws AbleException
From AbleBean -- overriden here for testing.
Overrides:
handleAbleEvent in class AbleObject
Following copied from interface: com.ibm.able.AbleEventListener
Parameters:
theAbleEvent - The event to handle.
Throws:
AbleException - If an error occurs.

processAbleEvent

public void processAbleEvent(AbleEvent theAbleEvent)
                      throws AbleException
From AbleBean -- overriden here for testing.
Overrides:
processAbleEvent in class AbleObject
Following copied from class: com.ibm.able.AbleObject
Parameters:
theAbleEvent - The event to process.
Throws:
AbleException - If an error occurs.
See Also:
AbleObject.setAbleEventProcessingEnabled(int), AbleObject.startEnabledEventProcessing(), AbleObject.handleAbleEvent(AbleEvent)

processInboundMessage

public void processInboundMessage(javax.agent.TransportMessage message)
Process a message newly arrived from the messaging system.

processDecision

public void processDecision(java.lang.String decisionName,
                            java.lang.Object[] decisionData)
Process a decision newly arrived from the decision-making system. called (e.g.) by handleAbleEvent.... Currently, the arg is cast to a ConversationEvent. TO DO: something more sensible than that.

getMessageForms

public java.util.Hashtable getMessageForms(java.lang.String decisionPoint)

setRole

public void setRole(java.lang.String s)
Sets the current role for the conversation manager

Parameters:
role - Role to be set for the conversation manager

getRole

public java.lang.String getRole()
Returns the current role of the conversation manager

Returns:
the curent role of the conversation manager

setContext

public void setContext(ConversationContext context)
Sets the ConversationContext variable inside the manager

Parameters:
context - the ConversationContext variable to be set

start

public void start(java.lang.Object[] data)
Starts the execution of the conversation manager. Checks if the internal CPH is active in the current state, if so, makes a decision request to the agent for the current state, thereby initiating the CPH execution

Parameters:
data - Data(Object) Array to be used for starting execution

timerExpired

public void timerExpired()
Called by external program(agent) to indicate the expiry of a set timer. Causes the creation of Timer(Expiry) Event to be added to the input event sequence

getAllCphs

public java.util.LinkedList getAllCphs()
Funtion useful for introspection. Converts the the cph stack into a linked-list of cphs with the linked-list containing the the root cp as the first element and the most recently loaded cp as the last element needs to be thread-safe because, it manipulates the stack of decision logics that is also used during decision-making inside the cph

Returns:
a linked-list of cphs contained inside this Conversation Manager

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003