|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectcom.ibm.able.AbleObject
com.ibm.able.conversation.AbleConversationManager
The AbleConversationManager class is an AbleBean implementing of the ConversationManager interface.
Each conversational agent must contain one AbleConversationManager, and must make sure
that the AbleConversationManager's process() method is invoked regularly.
| Field Summary | |
|---|---|
static java.lang.String |
CONVERSATION_COMPLETED_PROPERTY
Property name of the PropertyChangeEvent fired when a conversation is completed. |
static java.lang.String |
CP_LAYOUT_LOADED_PROPERTY
Property name of the PropertyChangeEvent fired when a conversation policy's graph-layout file is loaded. |
static java.lang.String |
NEW_CONVERSATION_PROPERTY
Property name of the PropertyChangeEvent fired when a new conversation is created. |
| Fields inherited from class com.ibm.able.AbleObject |
|---|
changed, chgSupport, comment, dataFlowEnabled, defaultName, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace |
| Constructor Summary | |
|---|---|
AbleConversationManager()
Constructs an AbleConversationManager object. |
|
AbleConversationManager(java.lang.String theName)
Constructs an AbleConversationManager object with the given name. |
|
AbleConversationManager(java.lang.String theName,
java.lang.String theComment)
Constructs an AbleConversationManager object with the given name and comment string. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.lang.String propName,
java.beans.PropertyChangeListener listener)
Adds the given PropertyChangeListener under the given property name, to the superclass's PropertyChangeSupport object. |
void |
closeConversation(java.lang.String convId)
Ends the conversation with the given ID. |
protected java.lang.String |
createConversationId()
Creates a new conversation ID unique to this ConversationManager. |
ConversationContext |
getContext(java.lang.String convId)
Returns the ConversationContext for a given conversation. |
Conversation |
getConversation(java.lang.String convId)
Returns the Conversation with the given conversation ID. |
java.util.Set |
getConversationIds()
Returns the set of all active conversation IDs. |
ConversationPolicyHandlerFactory |
getConversationPolicyHandlerFactory()
Returns this ConversationManager's ConversationPolicyHandlerFactory. |
java.lang.String |
getConversationPolicyRepositoryPath()
Returns the repository path used by this AbleConversationManager's AbleConversationPolicyHandlerFactory. |
java.lang.String |
getInitialPolicyName()
Returns the name of the policy assigned to newly created conversations. |
java.lang.String |
getInitiatorRole()
Returns the role this agent should use in a new conversation, when this agent initiates it. |
MessageTransformFactory |
getMessageTransformFactory()
Returns this ConversationManager's MessageTransformFactory. |
ConversationMetaData |
getMetaData(java.lang.String convId)
Returns the conversation meta-data associated with a given conversation. |
int |
getNumConversations()
Returns the number of conversations currently going on. |
java.lang.String |
getPolicyLayoutFile(java.lang.String policyName)
Returns the graph-layout file for the given conversation policy, stored in this AbleConversationManager's AbleConversationPolicyHandlerFactory. |
protected java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Returns the PropertyChangeSupport object stored in the superclass. |
java.lang.String |
getResponderRole()
Returns the role this agent should use in a new conversation, when another agent has initiated it. |
boolean |
isConversationCompleted(java.lang.String convId)
Indicates whether a Conversation with the given ID has already been executed to completion. |
Conversation |
newConversation(ConversationMetaData metaData,
boolean isInitiator)
Creates and initializes a new Conversation. |
void |
process()
Do one step of processing. |
void |
removePropertyChangeListener(java.lang.String propName,
java.beans.PropertyChangeListener listener)
Removes the given PropertyChangeListener from the given property name in the superclass's PropertyChangeSupport object. |
void |
setConversationPolicyRepositoryPath(java.lang.String newPath)
Sets the repository path used by this AbleConversationManager's AbleConversationPolicyHandlerFactory. |
void |
setDecisionLogicAdapter(DecisionLogicAdapter dla)
Sets the DecisionLogicAdapter used by this ConversationManager. |
void |
setInitialPolicy(java.lang.String name,
java.lang.String initiator,
java.lang.String responder)
Sets the conversation policy to assign to a newly created Conversation, and the roles to use if this agent, or another agent, is the initiator of it. |
void |
setMessageSystemAdapter(MessageSystemAdapter msa)
Sets the MessageSystemAdapter used by this ConversationManager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String NEW_CONVERSATION_PROPERTY
public static final java.lang.String CONVERSATION_COMPLETED_PROPERTY
public static final java.lang.String CP_LAYOUT_LOADED_PROPERTY
Note: This may be removed in the future. Avoid using it if possible.
| Constructor Detail |
public AbleConversationManager()
throws AbleException
AbleException - If thrown by the superclass constructor.
public AbleConversationManager(java.lang.String theName)
throws AbleException
theName - The name of the AbleBean.
AbleException - If thrown by the superclass constructor.
public AbleConversationManager(java.lang.String theName,
java.lang.String theComment)
throws AbleException
theName - The name of the AbleBean.theComment - The comment string for the AbleBean.
AbleException - If thrown by the superclass constructor.| Method Detail |
public int getNumConversations()
ConversationManager
getNumConversations in interface ConversationManagerpublic java.util.Set getConversationIds()
ConversationManagerThe conversation IDs returned are the IDs assigned by this ConversationManager to the conversations currently in progress.
getConversationIds in interface ConversationManagerpublic ConversationMetaData getMetaData(java.lang.String convId)
ConversationManagerThe conversation is specified by the conversation ID assigned by this ConversationManager to the conversation.
getMetaData in interface ConversationManagerconvId - The conversation ID in question.
null if not found.public ConversationContext getContext(java.lang.String convId)
ConversationManager
getContext in interface ConversationManagerconvId - The conversation ID of the conversation in question.
null
if not found.public java.lang.String getInitialPolicyName()
ConversationManager
getInitialPolicyName in interface ConversationManagerpublic java.lang.String getInitiatorRole()
ConversationManager
getInitiatorRole in interface ConversationManagerpublic java.lang.String getResponderRole()
ConversationManager
getResponderRole in interface ConversationManager
public void setInitialPolicy(java.lang.String name,
java.lang.String initiator,
java.lang.String responder)
ConversationManagerThe policy should be a conversation-setup policy. The roles should be the roles defined in that policy.
setInitialPolicy in interface ConversationManagername - the name of the policyinitiator - the role to use if this agent is the initiator.responder - the role to use if another agent is the initiator.public Conversation getConversation(java.lang.String convId)
ConversationManager
getConversation in interface ConversationManagerconvId - The conversation ID of the conversation in question.
public boolean isConversationCompleted(java.lang.String convId)
When each conversation is closed, its conversation ID is added to a list of completed conversations.
convId - The conversation ID.
public MessageTransformFactory getMessageTransformFactory()
ConversationManagerThis MessageTransformFactory is assigned to all new Conversations when they are created.
getMessageTransformFactory in interface ConversationManagerpublic ConversationPolicyHandlerFactory getConversationPolicyHandlerFactory()
ConversationManagerThis ConversationPolicyHandlerFactory is assigned to all new Conversations when they are created.
getConversationPolicyHandlerFactory in interface ConversationManagerpublic void setMessageSystemAdapter(MessageSystemAdapter msa)
ConversationManagerThe MessageSystemAdapter is assigned to newly created Conversations, during the initial stage of conversation setup. It must be able to deliver the initial conversation-setup message in the case where this agent initiates the conversation.
setMessageSystemAdapter in interface ConversationManagermsa - The new MessageSystemAdapter.public void setDecisionLogicAdapter(DecisionLogicAdapter dla)
ConversationManagerThe DecisionLogicAdapter is assigned to each newly created Conversation, regarless of whether this agent or another agent initiated it. Accordingly it must be able to support both the initiator and responder roles of this ConversationManager's initial policy.
setDecisionLogicAdapter in interface ConversationManagerdla - The new DecisionLogicAdapter.public java.lang.String getConversationPolicyRepositoryPath()
AbleConversationPolicyHandlerFactory.getRepositoryPathName()public void setConversationPolicyRepositoryPath(java.lang.String newPath)
newPath - The new repository path.AbleConversationPolicyHandlerFactory.setRepositoryPathName(String)public java.lang.String getPolicyLayoutFile(java.lang.String policyName)
The graph-layout file gives the locations to assign to the graph's nodes when displaying the graoph.
policyName - The conversation policy name.
AbleConversationPolicyHandlerFactory.getLayoutFile(String)protected java.lang.String createConversationId()
public Conversation newConversation(ConversationMetaData metaData,
boolean isInitiator)
ConversationManager
This creates a new Conversation object and gives it a unique conversation ID;
assigns it the given ConversationMetaData (and copies the conversation ID into
the meta-data); assigns its MessageSystemAdapter, DecisionLogicAdapter,
MessageTransformFactory, and ConversationPolicyHandlerFactory; and sets the
initial policy and role.
If isInitiator is true, the role assigned to the new conversation
is the one returned by
getInitiatorRole(). Otherwise, the role is the one returned by
getResponderRole().
This does not call Conversation.start() on the new Conversation,
so the user must
do so. This is to allow replacement of the defaults (the MessageSystemAdapter,
the DecisionLogicAdapter, and the initial policy and role)
before anything happens.
newConversation in interface ConversationManagermetaData - The meta-data object to assign to the new Conversation.isInitiator - Flag specifying whether this agent is initiating the conversation.
public void closeConversation(java.lang.String convId)
ConversationManagerDiscards the Conversation with the given ID, which has presumably just ended. Called after the last message has been sent or received.
closeConversation in interface ConversationManagerconvId - The conversation ID of the Conversation to close.
public void process()
throws AbleException
process in interface AbleBeanprocess in class AbleObjectAbleException - If the superclass method throws one.AbleObject.inputBuffer,
AbleObject.outputBuffer,
AbleBean.process()protected java.beans.PropertyChangeSupport getPropertyChangeSupport()
public void addPropertyChangeListener(java.lang.String propName,
java.beans.PropertyChangeListener listener)
propName - The propertyName.listener - The PropertyChangeListener to add.
public void removePropertyChangeListener(java.lang.String propName,
java.beans.PropertyChangeListener listener)
propName - The propertyName.listener - The PropertyChangeListener to remove.
|
ABLE 2.3.0 07/13/2005 14:21:00 | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||