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

com.ibm.able.conversation
Class AbleJasConversationAgent

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.ibm.able.AbleDefaultAgent
              |
              +--com.ibm.able.AbleRemoteDefaultAgent
                    |
                    +--com.ibm.able.platform.AblePlatformDefaultAgent
                          |
                          +--com.ibm.able.conversation.AbleJasConversationAgent
All Implemented Interfaces:
AbleAgent, AbleBean, AbleBeanContainer, AbleBeanRemoteContainer, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventListenerRemoteManager, AbleEventQueueManager, AbleEventQueueProcessor, AbleEventQueueRemoteManager, AblePlatformAgent, AblePropertyChangeManager, AbleRemoteAgent, AbleRemoteBean, AbleRemoteEventListener, AbleSerializable, AbleUserDefinedFunctionManager, AbleUserDefinedFunctionRemoteManager, java.util.EventListener, javax.agent.service.transport.MessageListener, java.beans.PropertyChangeListener, java.rmi.Remote, java.io.Serializable

public class AbleJasConversationAgent
extends AblePlatformDefaultAgent
implements java.io.Serializable

The AbleJasConversationAgent class represents a simple conversational agent that can execute conversations as specified by Conversation Policies (CPs) encoded in the XML dialect cpXML.

OLD VERSION -- TO BE DELETED

Specifically, the agent handles setting up new conversations using the default conversation policy specified and other subsequent conversations using the cp-xml files located in the specified conversation policy repository

When a TransportMessage is received, the agent routes the message to the appropriate conversation using the conversation-id present in the envelope. Messages that arrive without conversation-ids are assumed to be requests for new conversations and are handled by the "default" conversation manager. Subsequently, a new default conversation manager is created to handle other incoming conversation requests.

The agent uses an instance of decision logic adapter for connecting conversation policy manager and handlers to decision logic code.

See Also:
Serialized Form

Field Summary
static java.lang.String CHILD_CP_LOADED_PROPERTY
          Property fired when a child CP is loaded
static java.lang.String CONVERSATION_COMPLETED_PROPERTY
          Property fired when a conversation is completed
protected  java.util.Hashtable conversationPolicies
          Hashtable of conversation policies(name,xml-file) that the agent can handle;
protected  java.util.Hashtable conversationPolicyLayouts
          Hashtable of conversation policy layouts(name,glf-file) for the conversations;
static java.lang.String CP_LAYOUT_LOADED_PROPERTY
          Property fired when a layout-file is specified for a conversation policy
protected  java.util.Hashtable decisionLogics
          Hashtable of DecisionLogic Adapter Connections - indexed by conversation-ids each entry is a stack of decision logic adapter entries to enable handling hierrarchical conversations
static java.lang.String NEW_CONVERSATION_PROPERTY
          Property fired when a new conversation is initiated
static java.lang.String NEW_POLICY_PROPERTY
          Property fired when a new conversation policy is specified
protected  java.beans.PropertyChangeSupport propertySupport
          Firing property change support
protected static long serialVersionUID
          Serialized version identifier in form YYYYMMDDVerRelModxx
 
Fields inherited from class com.ibm.able.platform.AblePlatformDefaultAgent
agentLastUpdate, agentMovable, agentStatus, agentSummary, agentToAutoRegister, agentToBindToRmi, agentType, agentVendor, agentVersion, myAgentInboxes, myJasAbleLocator, myJasAgentAttributes, myJasAgentDescription, myJasAgentDirectoryService, myJasAgentName, myJasAgentNamingService, myJasDefaultLocator, myJasMessageTransportService, myJasServiceRoot, myJasTransportSystem, myJasVerifiableDirectoryService, myJasVerifiableNamingService, myKeyPair, myPrincipal, myReceiveMessageMethod, myRequestKey, mySecSppt, myTrustLevel, myVerifiableAgentName
 
Fields inherited from class com.ibm.able.AbleRemoteDefaultAgent
agentAddr, agentHost, agentName, defaultName, myRemoteStub
 
Fields inherited from class com.ibm.able.AbleDefaultAgent
activeDataSource, eventConnections, myBeans, numEpochs, processList, processListOK, userDefinedFunctions
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AbleJasConversationAgent()
          Constructe the AbleJasConversationAgent object.
 
Method Summary
 void addChildPolicyParam(java.lang.String conversationId, java.lang.Object paramKey, java.lang.Object paramValue)
          Adds a key-value pair to the hash for the conversation-id than can be subsequenty used by child conversations
 void addConversationPolicy(java.lang.String cpXML, boolean setup)
          Add a new conversation name and the corresponding CP-XML file to the list of known conversation policies
 void addConversationPolicyLayout(java.lang.String layoutFile)
          Add a new conversation name and the corresponding layout file for visualizing the conversation policy
 void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener newListener)
          Adds the property chage listener for the given property
 void beginConversationCaller(java.lang.Object[] params)
          Starts a new conversation by creating a new conversation manager that loads the default conversatopn policy for handling conversations
 void cpDone(java.lang.String conversationID, java.lang.String returnCode)
          User-Defined function end-point for indicating completion of a conversation.
protected  void debugTrace(java.lang.String theMessage)
          Log a trace message.
static java.lang.String getActualFileName(java.lang.String path)
          returns the actual file name for a path previously converted into a serializable form using @see AbleJasConversationAgent#getSerializableFileName()
 javax.agent.Locator getAgentLocator(java.lang.String agentName)
          Obtain the (JAS) locator for an agent from the platform given the agent name.
 javax.agent.AgentName getAgentName(java.lang.String agentName)
          Obtain the AgentName for an agent from the platform given the agent name.
 java.util.Hashtable getAllConversationDetails()
          Returns the details of the conversations that the agent is currently engaged in.
 java.lang.Object getChildPolicyParam(java.lang.String conversationId, java.lang.Object paramKey)
          Gets the value for the given key and conversation identifier
 SimpleConversationManager getConversationManager(java.lang.String conversationId)
          Returns the conversation manager for the specified conversation id
 ConversationParser getConversationParser(java.lang.String policyName)
          Creates(if required) and returns a ConversationParser object for the given policy name
 java.lang.String getConversationPolicyLayout(java.lang.String policyName)
          Returns the layout file name for a policy
 java.lang.String getConversationPolicyRepository()
          Returns the the directory for locating cp-XML files and their layouts for displaying them
 java.lang.String getConversationSetupPolicy()
          Returns the fully qualified cp-XML file name for the default conversation policy
 java.lang.String getConversationSetupPolicyLayout()
          Returns the fully qualified file name for the default conversation policy layout
 java.lang.String getConversationSetupPolicyName()
          Returns the name of the default conversation policy
 void getDecision(java.lang.String conversationId, java.lang.String name, java.lang.Object[] data, java.util.Hashtable messageForms)
          Sends a decision request to the decision logic.
 AbleUserDefinedFunction getDecisionFunction(java.lang.String functionName)
          Return the Able user-defined function for the specified string function name
 java.util.Hashtable getDecisionFunctions()
          returns the decision functions available inside the agent
 java.util.Hashtable getKnownPolicies()
          Returns a hashtable of policies that the conversation handlers inside the conversation agent can execute.
static java.lang.String getSerializableFileName(java.lang.String path)
          Returns a serializable version of the given path for storing file names
 void init()
          Initializes the object.
 void initializeConversationContext(java.lang.String conversationId)
          Initializes the conversation context for the conversation id specified.
 boolean isConversationCompleted(java.lang.String conversationID)
          Returns true if the conversation identified by the conversationID has completed otherwise returns false
 void loadChildCPH(java.lang.String conversationID, java.lang.String policy, java.lang.String role)
          User-Defined function end-point for loading child CP during on on-going conversation.
 void process()
          Perform the main, synchronous, standard processing function performed by this bean.
 void receiveMessageMethod(javax.agent.TransportMessage theTransportMessage)
          Receives messages from the JAS transport service.
 void sendTo(javax.agent.Locator theDestinationLocator, javax.agent.AgentName theDestinationAgentName, javax.agent.TransportMessage theMessage)
          Sends a message to the specified agent.
protected  void sendTransportMessage(javax.agent.Locator theDestinationLocator, javax.agent.AgentName theDestinationAgentName, java.lang.Object theMessageToSend)
          Send a message to the specified agent.
protected  void sendTransportMessage(javax.agent.Locator theOriginationLocator, javax.agent.Locator theDestinationLocator, javax.agent.AgentName theDestinationAgentName, javax.agent.TransportMessage theMessageToSend)
          Send a message to the specified agent.
 void setConversationPolicyRepository(java.lang.String repositoryDirectory)
          Sets the directory for locating cp-XML files and their layouts for displaying them
 void setDecisionFunctions(java.util.Hashtable functions)
          set the decision functions inside the conversation agent
 void setTimer(java.lang.String conversationID, java.lang.Integer timeoutValue)
          User-Defined function end-point for setting timers for time-out transitions.
 
Methods inherited from class com.ibm.able.platform.AblePlatformDefaultAgent
_init, _init, _quitAll, _reset, _resumeAll, _suspendAll, addAgentInbox, addJasAgentAttribute, broadcastTransportMessage, Copyright, createLocatorAndBindToMethod, getAgentAutonomyLevel, getAgentInboxes, getAgentLastUpdate, getAgentStatus, getAgentSummary, getAgentType, getAgentVendor, getAgentVersion, getAndSetAgentDescription, getAndSetAgentNames, getAndSetTransportServices, getAndValidateServiceRoot, getJasAgentAttributes, getJasAgentName, getNewAgentDescription, getPrincipal, getTransportMessageContent, getTransportMessageContent2, init, initializeAgent, initializeAgent, isAgentMovable, isAgentToAutoRegister, isAgentToBindToRmi, loadAgentDescriptionWithAbleAttributes, loadAgentDescriptionWithAbleLocator, loadAgentDescriptionWithAgentName, loadAgentDescriptionWithBaseLocators, loadAgentDescriptionWithPublicKey, loadAgentDescriptionWithUserAttributes, logException, lookUpAgent, lookUpAgent, main, maybeDeregisterWithAgentDirectoryService, maybeRebindToRmi, maybeRegisterWithAgentDirectoryService, maybeUnbindFromRmi, preInit, process, quitAgent, quitAll, receiveMessage, removeAgentInbox, removeAgentInboxes, removeJasAgentAttribute, reset, resetAgent, resumeAgent, resumeAll, sendTransportMessage, setAgentAutonomyLevel, setAgentAutonomyLevel, setAgentMovable, setAgentSummary, setAgentToAutoRegister, setAgentToBindToRmi, setAgentType, setAgentVendor, setAgentVersion, setPrincipal, setRequestKey, suspendAgent, suspendAll, toString, updateDescriptionWithAgentDirectoryService
 
Methods inherited from class com.ibm.able.AbleRemoteDefaultAgent
getAgentAddr, getAgentHost, getAgentName, rmiRebind, rmiUnbind
 
Methods inherited from class com.ibm.able.AbleDefaultAgent
addBean, addBeans, addEventConnection, addUserDefinedFunction, buildProcessList, clsNm, containsBean, containsBean, containsUserDefinedFunction, generateUniqueName, getBean, getBeans, getDataSource, getNumEpochs, getProcessList, getUserDefinedFunction, getUserDefinedFunctions, handleAbleEvent, invokeUserDefinedFunction, isActiveDataSource, propertyChange, quitEnabledEventProcessing, removeAllBeans, removeAllConnections, removeAllEventConnections, removeBean, removeBean, removeBeans, removeEventConnection, removeUserDefinedFunction, setActiveDataSource, setDataFlowEnabled, setProcessList, setUserDefinedFunctions
 
Methods inherited from class com.ibm.able.AbleObject
addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, 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, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendEnabledEventProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.able.AbleRemoteAgent
addEventConnection, getAgentAddr, getAgentHost, getAgentName, getDataSource, isActiveDataSource, removeEventConnection, setActiveDataSource
 
Methods inherited from interface com.ibm.able.AbleRemoteBean
getName, getState
 
Methods inherited from interface com.ibm.able.AbleRemoteEventListener
handleAbleEvent
 
Methods inherited from interface com.ibm.able.AbleEventListenerRemoteManager
addAbleEventListener, notifyAbleEventListeners, removeAbleEventListener
 
Methods inherited from interface com.ibm.able.AbleEventQueueRemoteManager
flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isTimerEventProcessingEnabled, quitEnabledEventProcessing, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing
 
Methods inherited from interface com.ibm.able.AbleBeanRemoteContainer
addBean, containsBean, containsBean, getBean, getBeans, removeAllBeans, removeBean, removeBean
 
Methods inherited from interface com.ibm.able.AbleUserDefinedFunctionRemoteManager
addUserDefinedFunction, containsUserDefinedFunction, getUserDefinedFunction, getUserDefinedFunctions, invokeUserDefinedFunction, removeUserDefinedFunction, setUserDefinedFunctions
 
Methods inherited from interface javax.agent.service.transport.MessageListener
equals, hashCode
 
Methods inherited from interface com.ibm.able.AbleBean
getComment, getLogger, getName, getParent, getState, getTraceLogger, isChanged, setChanged, setComment, setLogger, setName, setParent, setState, setTraceLogger
 
Methods inherited from interface com.ibm.able.AbleDataBufferManager
addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getSourceBufferConnections, hasInputBuffer, hasOutputBuffer, isConnectable, isDataFlowEnabled, processBufferConnections, removeAllBufferConnections, removeDestBufferConnection, removeSourceBufferConnection, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer
 
Methods inherited from interface com.ibm.able.AbleEventListenerManager
addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener
 
Methods inherited from interface com.ibm.able.AbleEventQueueManager
flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isTimerEventProcessingEnabled, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing
 
Methods inherited from interface com.ibm.able.AbleEventQueueProcessor
processAbleEvent, processNoEventProcessingEnabledSituation, processTimerEvent
 
Methods inherited from interface com.ibm.able.AblePropertyChangeManager
addPropertyChangeListener, addPropertyConnection, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection
 
Methods inherited from interface com.ibm.able.AbleSerializable
getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName
 
Methods inherited from interface com.ibm.able.AbleBeanContainer
getName
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
Serialized version identifier in form YYYYMMDDVerRelModxx

CHILD_CP_LOADED_PROPERTY

public static java.lang.String CHILD_CP_LOADED_PROPERTY
Property fired when a child CP is loaded

CONVERSATION_COMPLETED_PROPERTY

public static java.lang.String CONVERSATION_COMPLETED_PROPERTY
Property fired when a conversation is completed

NEW_CONVERSATION_PROPERTY

public static java.lang.String NEW_CONVERSATION_PROPERTY
Property fired when a new conversation is initiated

CP_LAYOUT_LOADED_PROPERTY

public static java.lang.String CP_LAYOUT_LOADED_PROPERTY
Property fired when a layout-file is specified for a conversation policy

NEW_POLICY_PROPERTY

public static java.lang.String NEW_POLICY_PROPERTY
Property fired when a new conversation policy is specified

decisionLogics

protected java.util.Hashtable decisionLogics
Hashtable of DecisionLogic Adapter Connections - indexed by conversation-ids each entry is a stack of decision logic adapter entries to enable handling hierrarchical conversations

conversationPolicies

protected transient java.util.Hashtable conversationPolicies
Hashtable of conversation policies(name,xml-file) that the agent can handle;

conversationPolicyLayouts

protected transient java.util.Hashtable conversationPolicyLayouts
Hashtable of conversation policy layouts(name,glf-file) for the conversations;

propertySupport

protected transient java.beans.PropertyChangeSupport propertySupport
Firing property change support
Constructor Detail

AbleJasConversationAgent

public AbleJasConversationAgent()
                         throws java.rmi.RemoteException,
                                AbleException
Constructe the AbleJasConversationAgent object.

Default Constructor initializes all internal variables

Method Detail

init

public void init()
          throws AbleException
Initializes the object.

This must be explicitly called:

  1. To enable registering with the JAS Platform Service
  2. To parse and load all the conversation policies specified in the constructor.
Overrides:
init in class AblePlatformDefaultAgent
Following copied from class: com.ibm.able.platform.AblePlatformDefaultAgent
Throws:
AbleException - On any error.

receiveMessageMethod

public void receiveMessageMethod(javax.agent.TransportMessage theTransportMessage)
Receives messages from the JAS transport service.

This is the endpoint for all messages coming in through the JAS transport service. Routing of the messages to the appropriate conversation is done based on the conversation-id in the message envelope. Absence of a conversation-id causes a new conversation manager to be created

Parameters:
theTransportMessage - the message received

sendTo

public void sendTo(javax.agent.Locator theDestinationLocator,
                   javax.agent.AgentName theDestinationAgentName,
                   javax.agent.TransportMessage theMessage)
            throws AbleException
Sends a message to the specified agent.
Parameters:
theDestinationLocator - The Locator of the destination agent.
theDestinationAgentName - The globally unique ID (Agent Name) of the destination agent.
theMessageToSend - The TrasnportMessage to be sent.

getDecision

public void getDecision(java.lang.String conversationId,
                        java.lang.String name,
                        java.lang.Object[] data,
                        java.util.Hashtable messageForms)
Sends a decision request to the decision logic.

Gets the destination for the decision request from the conversation manager. The appropriate decision logic object is invoked based on the conversation-id supplied. A DecisionLogicHandler thread is setup to handle relaying the decision information back to the conversation manager

Parameters:
conversationId - Identifies the conversation for which the decision request is being made
name - String name of the decision point(state) at which the decision is required
data - Associated object array that specifies input data at the decision point
messageForms - Hashtable of MessageForm objects for each outgoing transition at the decision point

beginConversationCaller

public void beginConversationCaller(java.lang.Object[] params)
Starts a new conversation by creating a new conversation manager that loads the default conversatopn policy for handling conversations

Parameters:
params - decision logic data if any so make a decision at the beginning of a conversation

debugTrace

protected void debugTrace(java.lang.String theMessage)
Log a trace message.
Overrides:
debugTrace in class AbleDefaultAgent
Parameters:
theMessage - A String containing text to be traced.


initializeConversationContext

public void initializeConversationContext(java.lang.String conversationId)
Initializes the conversation context for the conversation id specified. Initialization involves setting the jas agent name and tranport locators inside the conversation context

Parameters:
conversationId - the identifier for the conversation in which the context is to be initialized

getConversationManager

public SimpleConversationManager getConversationManager(java.lang.String conversationId)
Returns the conversation manager for the specified conversation id

Parameters:
conversationId - the conversation identifier

Returns:
the conversation manager variable or null if the conversation id is invalid

getDecisionFunction

public AbleUserDefinedFunction getDecisionFunction(java.lang.String functionName)
Return the Able user-defined function for the specified string function name

Parameters:
functionName - String name of the function

Returns:
the AbleUserDefinedFunction variable if the functionName is valid, null otherwise

getDecisionFunctions

public java.util.Hashtable getDecisionFunctions()
returns the decision functions available inside the agent

Returns:
a hashtable of Able user-defined functions indexed by the function name

setDecisionFunctions

public void setDecisionFunctions(java.util.Hashtable functions)
set the decision functions inside the conversation agent

Parameters:
functions - a hashtable of Able user-defined functions indexed by the function name

addChildPolicyParam

public void addChildPolicyParam(java.lang.String conversationId,
                                java.lang.Object paramKey,
                                java.lang.Object paramValue)
Adds a key-value pair to the hash for the conversation-id than can be subsequenty used by child conversations

Parameters:
conversationId - the conversation identifier

paramKey - the key

paramValue - the value

getChildPolicyParam

public java.lang.Object getChildPolicyParam(java.lang.String conversationId,
                                            java.lang.Object paramKey)
Gets the value for the given key and conversation identifier

Parameters:
conversationId - the conversation identifier

paramKey - the key

Returns:
the value orresponding to the key, if present or null otherwise

setConversationPolicyRepository

public void setConversationPolicyRepository(java.lang.String repositoryDirectory)
Sets the directory for locating cp-XML files and their layouts for displaying them

Parameters:
repositoryDirectory - the path for the directory

getConversationPolicyRepository

public java.lang.String getConversationPolicyRepository()
Returns the the directory for locating cp-XML files and their layouts for displaying them

Returns:
the repository directory path

process

public void process()
             throws AbleException
Description copied from interface: AbleRemoteBean
Perform the main, synchronous, standard processing function performed by this bean. Typically, this function involves taking data from the input buffer, processing the data, creating an output buffer, and placing the processed data into it.

A bean implementing AbleBeanRemoteContainer may choose to call process on each bean it contains and accumulate errors from each contained bean.

Overrides:
process in class AbleDefaultAgent
See Also:
AbleBean.process()

loadChildCPH

public void loadChildCPH(java.lang.String conversationID,
                         java.lang.String policy,
                         java.lang.String role)
User-Defined function end-point for loading child CP during on on-going conversation.
Parameters:
conversationId - Identifier for the conversation

policy - Name of the policy for the new child CP

role - Role played in the new child CP being loaded

setTimer

public void setTimer(java.lang.String conversationID,
                     java.lang.Integer timeoutValue)
User-Defined function end-point for setting timers for time-out transitions.
Parameters:
conversationId - Identifier for the conversation

timeoutValue - Value in milli-seconds for the timer

cpDone

public void cpDone(java.lang.String conversationID,
                   java.lang.String returnCode)
User-Defined function end-point for indicating completion of a conversation.
Parameters:
conversationId - Identifier for the conversation

policy - value returned by the completing conversation


getKnownPolicies

public java.util.Hashtable getKnownPolicies()
Returns a hashtable of policies that the conversation handlers inside the conversation agent can execute. The Hashtable is indexed by the name of the conversation policy. The value for each key is a two-element vector containing the valid role names for the policy

Returns:
hashtable of known conversation policy names and roles

getConversationParser

public ConversationParser getConversationParser(java.lang.String policyName)
Creates(if required) and returns a ConversationParser object for the given policy name

Parameters:
policy - Name of the policy

policy - Role assumed in the policy

Returns:
The corresponding ConversationParser object

isConversationCompleted

public boolean isConversationCompleted(java.lang.String conversationID)
Returns true if the conversation identified by the conversationID has completed otherwise returns false

Parameters:
conversationID - Conversation Identifier

Returns:
true if conversation complete, false otherwise

addConversationPolicy

public void addConversationPolicy(java.lang.String cpXML,
                                  boolean setup)
Add a new conversation name and the corresponding CP-XML file to the list of known conversation policies

Parameters:
policyName - name of the policy

cpXML - cp-xml file name for the conversation

addConversationPolicyLayout

public void addConversationPolicyLayout(java.lang.String layoutFile)
Add a new conversation name and the corresponding layout file for visualizing the conversation policy

Parameters:
policyName - name of the policy

layoutFile - glf (Graph Layout Format) file name

getConversationPolicyLayout

public java.lang.String getConversationPolicyLayout(java.lang.String policyName)
Returns the layout file name for a policy

Parameters:
policyName - name of the policy

Returns:
the file-name for the layout file for the policy if known, null otherwise

getConversationSetupPolicy

public java.lang.String getConversationSetupPolicy()
Returns the fully qualified cp-XML file name for the default conversation policy

Returns:
the file name for the default conversation policy

getConversationSetupPolicyName

public java.lang.String getConversationSetupPolicyName()
Returns the name of the default conversation policy

Returns:
the name of the default conversation policy

getConversationSetupPolicyLayout

public java.lang.String getConversationSetupPolicyLayout()
Returns the fully qualified file name for the default conversation policy layout

Returns:
the file name for the default conversation policy layout

getAllConversationDetails

public java.util.Hashtable getAllConversationDetails()
Returns the details of the conversations that the agent is currently engaged in. Useful for introspection. Returns a hashtable, indexed by the conversation id and each element containing a linked-list of cphs belonging to the conversation

Returns:
Hashtable indexed by conversation-id and each element containing a linked-list of cphs for the corresponding conversation id(manager)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String property,
                                      java.beans.PropertyChangeListener newListener)
Adds the property chage listener for the given property

Parameters:
property - Name of the property

newListener - The property change listener

getAgentName

public javax.agent.AgentName getAgentName(java.lang.String agentName)
                                   throws AbleException
Obtain the AgentName for an agent from the platform given the agent name. If a null is passed as a paramter, the function returns the current agent's AgentName
Parameters:
agentName - Name of the agent

Returns:
The globally unique ID (AgentName) of the agent.


getAgentLocator

public javax.agent.Locator getAgentLocator(java.lang.String agentName)
                                    throws AbleException
Obtain the (JAS) locator for an agent from the platform given the agent name. If a null is passed as a paramter, the function returns the current agent's RMI locator
Parameters:
agentName - Name of the agent

Returns:
The RMI Locator for the agent


sendTransportMessage

protected void sendTransportMessage(javax.agent.Locator theDestinationLocator,
                                    javax.agent.AgentName theDestinationAgentName,
                                    java.lang.Object theMessageToSend)
                             throws AbleException
Send a message to the specified agent. This agent's default Locator is used as the origination Locator.
Overrides:
sendTransportMessage in class AblePlatformDefaultAgent
Parameters:
theDestinationLocator - The Locator of the destination agent.

theDestinationAgentName - The globally unique ID (Agent Name) of the destination agent.

theMessageToSend - The TransportMessage to be sent


sendTransportMessage

protected void sendTransportMessage(javax.agent.Locator theOriginationLocator,
                                    javax.agent.Locator theDestinationLocator,
                                    javax.agent.AgentName theDestinationAgentName,
                                    javax.agent.TransportMessage theMessageToSend)
                             throws AbleException
Send a message to the specified agent. Any one of this agent's Locators can be used as the origination Locator, and it is up to the caller to decide which.
Parameters:
theOriginationLocator - One of my own Locators, selected by the caller.

theDestinationLocator - The Locator of the destination agent.

theDestinationAgentName - The globally unique ID (Agent Name) of the destination agent.

theMessageToSend - The TrasnportMessage to be sent.


getSerializableFileName

public static java.lang.String getSerializableFileName(java.lang.String path)
Returns a serializable version of the given path for storing file names

Parameters:
path - the full-path to be serialized

Returns:
the serializable version of the path

getActualFileName

public static java.lang.String getActualFileName(java.lang.String path)
returns the actual file name for a path previously converted into a serializable form using @see AbleJasConversationAgent#getSerializableFileName()

Parameters:
path - the path to be converted back from the serialized form

Returns:
the actual path corresponding to the serialized path

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

(C) Copyright IBM Corporation 1999, 2003