|
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.AbleDefaultAgent
com.ibm.able.AbleRemoteDefaultAgent
com.ibm.able.platform.AblePlatformDefaultAgent
com.ibm.able.conversation.AblePlatformConversationAgent
The AblePlatformConversationAgent class represents an agent that supports conversations atop the Able Distributed Agent Platform.
| Field Summary | |
|---|---|
protected AbleConversationManager |
conversationManager
The manager for this agent's conversations. |
static java.lang.String |
CP_REPOSITORY_PATH_PROPERTY
Key to use when looking up or storing CP repository path in the System properties table. |
protected AbleRemoteUdfDecisionLogicAdapter |
decisionLogicAdapter
The decision logic adapter for all of this agent's conversations. |
protected AblePlatformMessageSystemAdapter |
messageSystemAdapter
The message-system adapter used in all this agent's outbound JAS messages. |
static java.lang.String |
PREFERRED_LOCATOR_TYPE
The type of Locator we look for in an agent's description, when we want to send a message to that agent. |
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, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace |
| Constructor Summary | |
|---|---|
AblePlatformConversationAgent()
Constructs an AblePlatformConversationAgent object. |
|
AblePlatformConversationAgent(java.lang.String instanceName)
Constructs an AblePlatformConversationAgent object. |
|
| Method Summary | |
|---|---|
protected com.ibm.conversation.jas.JasConversationMetaData |
createMetaData()
Creates and returns a ConversationMetaData object compatible with this agent's messaging system, for use in creating a new Conversation. |
ConversationManager |
getConversationManager()
Returns this agent's conversation manager. |
static javax.agent.Locator |
getLocatorForInbox(javax.agent.service.directory.AgentDescription agentDesc,
java.lang.String inboxName)
Searches the given AgentDescription for a Locator with the given inbox name, and returns the first one found. |
static javax.agent.Locator |
getLocatorForType(javax.agent.service.directory.AgentDescription agentDesc,
java.lang.String desiredType)
Extracts and returns a Locator of the given type from the given AgentDescription. |
java.lang.String |
getPartnerRole(java.lang.String policyName,
java.lang.String selfRole)
Returns the role taken by an agent's partner in the given CP, if the agent is taking the given role. |
void |
init()
Initializes this agent. |
void |
installTargetForCp(java.lang.String cpName,
java.lang.String role,
java.lang.Object target)
This configures this agent so that the given target will be used for all inbound decision callbacks associated with the given policy & role. |
protected void |
logException(java.lang.String theMethodName,
java.lang.Exception theException)
Logs an exception with the agent's name in the message text. |
protected void |
logMessage(long msgType,
java.lang.String theMethodName,
java.lang.String theMessage)
Logs a message that includes the agent name in the message text. |
void |
onInboundDecision(Conversation conv,
DecisionDataHandle ddh)
Writes a log entry stating that an inbound message was successfully converted to inbound decision-data. |
void |
onMessage(javax.agent.TransportMessage msg)
Receives a message. |
void |
onTimeout(Conversation conv,
java.lang.String newState)
Writes a log entry stating that a timeout occurred during a conversation. |
void |
onUnexpectedMessage(Conversation conv,
MessageHandle mh)
Writes a log entry stating that an unexpected message was received during a conversation. |
void |
process()
Does one step of processing. |
void |
startConversation(javax.agent.service.directory.AgentDescription partnerDesc,
java.lang.String rootPolicyName,
java.lang.String selfRole)
Initiates a conversation with the agent with the given AgentDescription. |
void |
startConversation(javax.agent.AgentName partnerAgentName,
javax.agent.Locator partnerLocator,
java.lang.String rootPolicyName,
java.lang.String selfRole)
Initiates a conversation with an agent. |
void |
startConversation(javax.agent.AgentName partnerAgentName,
java.lang.String rootPolicyName,
java.lang.String selfRole)
Attempts to initiate a conversation with the agent with the given AgentName. |
void |
startConversation(java.lang.String partnerDisplayName,
java.lang.String rootPolicyName,
java.lang.String selfRole)
Attempts to initiate a conversation with the agent with the given display name. |
| 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.platform.AblePlatformAgent |
|---|
getComment |
| 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, getProperties, getProperty, getState, removeProperty, setProperties, setProperty |
| 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, getProperties, getProperty, getState, getTraceLogger, isChanged, removeProperty, setChanged, setComment, setLogger, setName, setParent, setProperties, setProperty, 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, getPropertyChangeListeners, 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 final java.lang.String PREFERRED_LOCATOR_TYPE
public static final java.lang.String CP_REPOSITORY_PATH_PROPERTY
protected AblePlatformMessageSystemAdapter messageSystemAdapter
protected AbleConversationManager conversationManager
protected AbleRemoteUdfDecisionLogicAdapter decisionLogicAdapter
| Constructor Detail |
public AblePlatformConversationAgent()
throws java.rmi.RemoteException,
AbleException
public AblePlatformConversationAgent(java.lang.String instanceName)
throws java.rmi.RemoteException,
AbleException
| Method Detail |
public ConversationManager getConversationManager()
public java.lang.String getPartnerRole(java.lang.String policyName,
java.lang.String selfRole)
policyName - The name of the CP in questionselfRole - The role to find the counterpart of.
null
if the policy is unknown or the role is undefined.public void onMessage(javax.agent.TransportMessage msg)
This is the endpoint for all messages coming in through the platform transport service. Routing of the messages to the appropriate Conversation is done based on the conversation ID in the message envelope. If there is no conversation ID, a new Conversation is created, to which it is sent. Thus every message is either part of an already-established conversation, or else the first message of a new conversation to be created.
msg - the message receivedprotected com.ibm.conversation.jas.JasConversationMetaData createMetaData()
Initializes the self-related parts of it, except for the conversation ID (which is set by the ConversationManager when the conversation is created).
public void onUnexpectedMessage(Conversation conv,
MessageHandle mh)
This is the default callback for unexpected messages. Users should replace it with something that does more than just writes a log entry.
conv - The Conversation in which the unexpected message occurred.mh - The MessageHandle containing the unexpected message.
public void onTimeout(Conversation conv,
java.lang.String newState)
This is the default callback for timeouts. Users should replace it with something that does more than just writes a log entry.
conv - The Conversation in which the unexpected message occurred.newState - The conversation state reached as a result of taking
the timeout transition.
public void onInboundDecision(Conversation conv,
DecisionDataHandle ddh)
This is the default callback for inbound decision data. Users should replace it with something that does more than just writes a log entry.
conv - The Conversation in which the unexpected message occurred.ddh - The DecisionDataHandle containing the decision data.
public static javax.agent.Locator getLocatorForType(javax.agent.service.directory.AgentDescription agentDesc,
java.lang.String desiredType)
agentDesc - The AgentDescription in which to look for the LocatordesiredType - The type to look for.
null if none is found.
public static javax.agent.Locator getLocatorForInbox(javax.agent.service.directory.AgentDescription agentDesc,
java.lang.String inboxName)
com.ibm.able.platform.AblePlatform.AbleLocatorProtocol. Assumes the
values associated with that key are of class type String.
agentDesc - The AgentDescription to search.inboxName - The name of the inbox to search for.
public void startConversation(java.lang.String partnerDisplayName,
java.lang.String rootPolicyName,
java.lang.String selfRole)
This method must be called in order to start a conversation, but thereafter, all processing is handled via calls to the decision logic invocation targets. In particular, the decision logic will immediately be required to fill in the parameters of the conversation-opener message defined by this agent's initial conversation policy.
partnerDisplayName - The display name for the agent to start the conversation with.rootPolicyName - The name of the conversation policy to use.selfRole - The role this agent is to play in the root conversation policy.
public void startConversation(javax.agent.AgentName partnerAgentName,
java.lang.String rootPolicyName,
java.lang.String selfRole)
This method must be called in order to start a conversation, but thereafter, all processing is handled via calls to the decision logic invocation targets. In particular, the decision logic will immediately be required to fill in the parameters of the conversation-opener message defined by this agent's initial conversation policy.
partnerAgentName - The AgentName for the agent to start the conversation with.rootPolicyName - The name of the conversation policy to use.selfRole - The role this agent is to play in the root conversation policy.
public void startConversation(javax.agent.service.directory.AgentDescription partnerDesc,
java.lang.String rootPolicyName,
java.lang.String selfRole)
This method must be called in order to start a conversation, but thereafter, all processing is handled via calls to the decision logic invocation targets. In particular, the decision logic will immediately be required to fill in the parameters of the conversation-opener message defined by this agent's initial conversation policy.
partnerDesc - The AgentDescription for the agent to start the conversation with.rootPolicyName - The name of the conversation policy to use.selfRole - The role this agent is to play in the root conversation policy.
public void startConversation(javax.agent.AgentName partnerAgentName,
javax.agent.Locator partnerLocator,
java.lang.String rootPolicyName,
java.lang.String selfRole)
This method must be called in order to start a conversation, but thereafter, all processing is handled via calls to the decision logic invocation targets. In particular, the decision logic will immediately be required to fill in the parameters of the conversation-opener message defined by this agent's initial conversation policy.
partnerAgentName - The AgentName for the agent to start the conversation with.partnerLocator - The Locator to use in contacting the agent.rootPolicyName - The name of the conversation policy to use.selfRole - The role this agent is to play in the root conversation policy.
public void installTargetForCp(java.lang.String cpName,
java.lang.String role,
java.lang.Object target)
The target object musthave methods for each of the callback names defined by the
policy & role, each of which must take parameters
(Converstion, DecisionDataHandle).
cpName - The conversation policyrole - The role (defines which decision-points to usetarget - The target object.
public void init()
throws AbleException
Sets up a default message inbox;
calls super.init();
installs the MessageTransportService (created in super.init()) in its
MessageSystemAdapter;
initializes its ConversationManager.
init in interface AbleRemoteBeaninit in class AblePlatformDefaultAgentAbleException - On any error.
public void process()
throws AbleException
super.process(), then calls process() on its
ConversationManager.
process in interface AbleRemoteBeanprocess in class AbleDefaultAgentAbleException - If the superclass or the conversationManager throws one.
protected void logMessage(long msgType,
java.lang.String theMethodName,
java.lang.String theMessage)
msgType - The message type--e.g., Able.INFO.theMethodName - The name of the method in which the exception occurred.theMessage - The message to log.
protected void logException(java.lang.String theMethodName,
java.lang.Exception theException)
logException in class AblePlatformDefaultAgenttheMethodName - The name of the method in which the exception occurred.theException - The exception to log.
|
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 | |||||||||||