|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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.
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.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.AbleRemoteDefaultAgent |
---|
getAgentAddr, getAgentHost, getAgentName, rmiRebind, rmiUnbind |
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.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.AbleEventListenerManager |
---|
addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener |
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 |
protected static final long serialVersionUID
public static java.lang.String CHILD_CP_LOADED_PROPERTY
public static java.lang.String CONVERSATION_COMPLETED_PROPERTY
public static java.lang.String NEW_CONVERSATION_PROPERTY
public static java.lang.String CP_LAYOUT_LOADED_PROPERTY
public static java.lang.String NEW_POLICY_PROPERTY
protected java.util.Hashtable decisionLogics
protected transient java.util.Hashtable conversationPolicies
protected transient java.util.Hashtable conversationPolicyLayouts
protected transient java.beans.PropertyChangeSupport propertySupport
Constructor Detail |
public AbleJasConversationAgent() throws java.rmi.RemoteException, AbleException
Default Constructor initializes all internal variables
Method Detail |
public void init() throws AbleException
This must be explicitly called:
init
in class AblePlatformDefaultAgent
com.ibm.able.platform.AblePlatformDefaultAgent
AbleException
- On any error.public void receiveMessageMethod(javax.agent.TransportMessage theTransportMessage)
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
theTransportMessage
- the message receivedpublic void sendTo(javax.agent.Locator theDestinationLocator, javax.agent.AgentName theDestinationAgentName, javax.agent.TransportMessage theMessage) throws AbleException
theDestinationLocator
- The Locator of the destination agent.theDestinationAgentName
- The globally unique ID (Agent Name) of the destination agent.theMessageToSend
- The TrasnportMessage to be sent.public void getDecision(java.lang.String conversationId, java.lang.String name, java.lang.Object[] data, java.util.Hashtable messageForms)
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
conversationId
- Identifies the conversation for which the decision request
is being madename
- String name of the decision point(state) at
which the decision is requireddata
- Associated object array that specifies input data at
the decision pointmessageForms
- Hashtable of MessageForm objects for each
outgoing transition at the decision pointpublic void beginConversationCaller(java.lang.Object[] params)
params
- decision logic data if any so make a decision at the
beginning of a conversationprotected void debugTrace(java.lang.String theMessage)
debugTrace
in class AbleDefaultAgent
theMessage
- A String containing text to be traced.
public void initializeConversationContext(java.lang.String conversationId)
conversationId
- the identifier for the conversation in which the context
is to be initializedpublic SimpleConversationManager getConversationManager(java.lang.String conversationId)
conversationId
- the conversation identifier
public AbleUserDefinedFunction getDecisionFunction(java.lang.String functionName)
functionName
- String name of the function
public java.util.Hashtable getDecisionFunctions()
public void setDecisionFunctions(java.util.Hashtable functions)
functions
- a hashtable of Able user-defined functions indexed by the
function namepublic void addChildPolicyParam(java.lang.String conversationId, java.lang.Object paramKey, java.lang.Object paramValue)
conversationId
- the conversation identifier
paramKey
- the key
paramValue
- the valuepublic java.lang.Object getChildPolicyParam(java.lang.String conversationId, java.lang.Object paramKey)
conversationId
- the conversation identifier
paramKey
- the key
public void setConversationPolicyRepository(java.lang.String repositoryDirectory)
repositoryDirectory
- the path for the directorypublic java.lang.String getConversationPolicyRepository()
public void process() throws AbleException
AbleRemoteBean
A bean implementing AbleBeanRemoteContainer
may choose to call process
on each bean it contains and accumulate errors from each contained bean.
process
in class AbleDefaultAgent
AbleBean.process()
public void loadChildCPH(java.lang.String conversationID, java.lang.String policy, java.lang.String role)
conversationId
- Identifier for the conversation
policy
- Name of the policy for the new child CP
role
- Role played in the new child CP being loadedpublic void setTimer(java.lang.String conversationID, java.lang.Integer timeoutValue)
conversationId
- Identifier for the conversation
timeoutValue
- Value in milli-seconds for the timerpublic void cpDone(java.lang.String conversationID, java.lang.String returnCode)
conversationId
- Identifier for the conversation
policy
- value returned by the completing conversation
public java.util.Hashtable getKnownPolicies()
public ConversationParser getConversationParser(java.lang.String policyName)
policy
- Name of the policy
policy
- Role assumed in the policy
public boolean isConversationCompleted(java.lang.String conversationID)
conversationID
- Conversation Identifier
public void addConversationPolicy(java.lang.String cpXML, boolean setup)
policyName
- name of the policy
cpXML
- cp-xml file name for the conversationpublic void addConversationPolicyLayout(java.lang.String layoutFile)
policyName
- name of the policy
layoutFile
- glf (Graph Layout Format) file namepublic java.lang.String getConversationPolicyLayout(java.lang.String policyName)
policyName
- name of the policy
public java.lang.String getConversationSetupPolicy()
public java.lang.String getConversationSetupPolicyName()
public java.lang.String getConversationSetupPolicyLayout()
public java.util.Hashtable getAllConversationDetails()
public void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener newListener)
property
- Name of the property
newListener
- The property change listenerpublic javax.agent.AgentName getAgentName(java.lang.String agentName) throws AbleException
agentName
- Name of the agent
public javax.agent.Locator getAgentLocator(java.lang.String agentName) throws AbleException
agentName
- Name of the agent
protected void sendTransportMessage(javax.agent.Locator theDestinationLocator, javax.agent.AgentName theDestinationAgentName, java.lang.Object theMessageToSend) throws AbleException
sendTransportMessage
in class AblePlatformDefaultAgent
theDestinationLocator
- The Locator of the destination agent.
theDestinationAgentName
- The globally unique ID (Agent Name) of the destination agent.
theMessageToSend
- The TransportMessage to be sent
protected void sendTransportMessage(javax.agent.Locator theOriginationLocator, javax.agent.Locator theDestinationLocator, javax.agent.AgentName theDestinationAgentName, javax.agent.TransportMessage theMessageToSend) throws AbleException
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.
public static java.lang.String getSerializableFileName(java.lang.String path)
path
- the full-path to be serialized
public static java.lang.String getActualFileName(java.lang.String path)
path
- the path to be converted back from the serialized form
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |