ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.examples.conversation
Class ChatterboxAgent2

java.lang.Object
  extended bycom.ibm.able.AbleObject
      extended bycom.ibm.able.AbleDefaultAgent
          extended bycom.ibm.able.AbleRemoteDefaultAgent
              extended bycom.ibm.able.platform.AblePlatformDefaultAgent
                  extended bycom.ibm.able.conversation.AblePlatformConversationAgent
                      extended bycom.ibm.able.examples.conversation.ChatterboxAgent2
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 ChatterboxAgent2
extends AblePlatformConversationAgent

The ChatterboxAgent2 class is an second example of an AblePlatformConversationAgent. It is capable of executing the "Chat3" conversation, like its close relative the ChatterboxAgent. Its only difference from that agent is that it installs a different decision logic module for that conversation.

See Also:
Serialized Form

Field Summary
static java.lang.String ABLE_AGENT_TYPE
           
 
Fields inherited from class com.ibm.able.conversation.AblePlatformConversationAgent
conversationManager, CP_REPOSITORY_PATH_PROPERTY, decisionLogicAdapter, messageSystemAdapter, PREFERRED_LOCATOR_TYPE, serialVersionUID
 
Fields inherited from class com.ibm.able.platform.AblePlatformDefaultAgent
agentLastUpdate, agentMovable, agentStatus, agentSummary, agentToAutoRegister, agentToBindToRmi, agentType, agentVendor, agentVersion, myAgentInboxes, myAgentLoggingService, myCapabilities, myCapabilityOrder, myCustomCapabilityAutonomyLevels, myHighCapabilityAutonomyLevels, myJasAbleLocator, myJasAgentAttributes, myJasAgentDescription, myJasAgentDirectoryService, myJasAgentName, myJasAgentNamingService, myJasDefaultLocator, myJasMessageTransportService, myJasServiceRoot, myJasTransportSystem, myJasVerifiableDirectoryService, myJasVerifiableNamingService, myKeyPair, myLowCapabilityAutonomyLevels, myMediumCapabilityAutonomyLevels, 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, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
ChatterboxAgent2(java.lang.String instanceName)
           
 
Method Summary
protected  boolean decideToSendTestMessage()
           
protected  boolean decideToStartConversation()
           
 int getTotalConversations()
          Returns the threshold on the number of conversation this agent may participate in.
 void init()
          Initializes this agent.
 boolean isConversationEnabled()
          Indicates whether this agent may initiate conversations.
 boolean isTestMessageEnabled()
          Indicates whether this agent may send a test message.
 java.lang.String listKnownCpNames()
           
 void process()
          Does one step of processing.
protected  javax.agent.service.directory.AgentDescription selectConversationPartner()
           
protected  void sendTestMessage(javax.agent.service.directory.AgentDescription partnerDesc)
           
 void setConversationEnabled(boolean b)
           
 void setTestMessageEnabled(boolean b)
           
 void setTotalConversations(int i)
           
 
Methods inherited from class com.ibm.able.conversation.AblePlatformConversationAgent
createMetaData, getConversationManager, getLocatorForInbox, getLocatorForType, getPartnerRole, installTargetForCp, logException, logMessage, onInboundDecision, onMessage, onTimeout, onUnexpectedMessage, startConversation, startConversation, startConversation, startConversation
 
Methods inherited from class com.ibm.able.platform.AblePlatformDefaultAgent
_init, _init, _quitAll, _reset, _resumeAll, _suspendAll, addAgentInbox, addJasAgentAttribute, authenticateAndAuthorizeCaller, authorizeCapabilityChangeRequest, broadcastTransportMessage, createAgentSituationReport, createLocatorAndBindToMethod, getAboutDataBean, getAgentAutonomyLevel, getAgentDescription, getAgentInboxes, getAgentLastUpdate, getAgentLoggingService, getAgentStatus, getAgentSummary, getAgentType, getAgentVendor, getAgentVersion, getAndSetAgentDescription, getAndSetAgentNames, getAndSetTransportServices, getAndValidateServiceRoot, getCapabilities, getCapability, getCapabilityAutonomyLevels, getCapabilityOrder, getCapabilityPresets, getCapabilitySummaryByAgentAutonomyLevel, getCapabilitySummaryByCapabilityAutonomyLevels, getCustomizerDataBean, getCustomizerInfo, getJasAgentAttributes, getJasAgentName, getNewAgentDescription, getPlatformAgentName, getPrincipal, getTransportMessageContent, getTransportMessageContent2, handleAnsweredRequest, init, initAgentCapabilities, initCommonCode, initializeAgent, initializeAgent, isAgentMovable, isAgentToAutoRegister, isAgentToBindToRmi, loadAgentDescriptionWithAbleAttributes, loadAgentDescriptionWithAbleLocator, loadAgentDescriptionWithAgentName, loadAgentDescriptionWithBaseLocators, loadAgentDescriptionWithPublicKey, loadAgentDescriptionWithUserAttributes, logAgentSituationReport, logHistory, lookUpAgent, lookUpAgent, main, makeCapabilityAutonomyLevelsSummary, maybeDeregisterWithAgentDirectoryService, maybeRebindToRmi, maybeRegisterWithAgentDirectoryService, maybeUnbindFromRmi, preInit, preInit, process, processAnsweredRequest, quitAgent, quitAll, receiveMessage, removeAgentInbox, removeAgentInboxes, removeAgentSituationReports, removeJasAgentAttribute, reset, resetAgent, resumeAgent, resumeAll, sendTransportMessage, sendTransportMessage, setAgentAutonomyLevel, setAgentMovable, setAgentNameUniqueID, setAgentSummary, setAgentToAutoRegister, setAgentToBindToRmi, setAgentType, setAgentVendor, setAgentVersion, setCapabilityAutonomyLevel, setCapabilityAutonomyLevels, setCustomizerDataBean, setPrincipal, setRequestKey, setRestartedFromPersistence, suspendAgent, suspendAll, toString, updateAgentSituationReport, updateDescriptionWithAgentDirectoryService, validateAnsweredRequest, verifyCapabilities, verifyKey
 
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, debugTrace, generateUniqueName, getBean, getBeans, getDataSource, getEventConnections, getNumEpochs, getProcessList, getUserDefinedFunction, getUserDefinedFunctions, handleAbleEvent, initAllBeans, invokeUserDefinedFunction, isActiveDataSource, propertyChange, quitEnabledEventProcessing, removeAllBeans, removeAllConnections, removeAllEventConnections, removeBean, removeBean, removeBeans, removeEventConnection, removeUserDefinedFunction, resetAllBeans, 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, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getProperties, getProperty, getPropertyChangeListeners, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, hasInputBuffer, hasOutputBuffer, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllPropertyConnections, removeDestBufferConnection, removeProperty, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setProperties, setProperty, 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.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.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, getProperties, getProperty, getState, getTraceLogger, isChanged, removeProperty, setChanged, setComment, setLogger, setName, setParent, setProperties, setProperty, setState, setTraceLogger
 
Methods inherited from interface com.ibm.able.AbleDataBufferManager
addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, 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, 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

ABLE_AGENT_TYPE

public static final java.lang.String ABLE_AGENT_TYPE
See Also:
Constant Field Values
Constructor Detail

ChatterboxAgent2

public ChatterboxAgent2(java.lang.String instanceName)
                 throws java.rmi.RemoteException,
                        AbleException
Throws:
java.rmi.RemoteException
AbleException
Method Detail

getTotalConversations

public int getTotalConversations()
Returns the threshold on the number of conversation this agent may participate in.

Returns:
The total number of conversations this agent may have.

setTotalConversations

public void setTotalConversations(int i)
Parameters:
i -

isConversationEnabled

public boolean isConversationEnabled()
Indicates whether this agent may initiate conversations.

Returns:
true if this agent may initiate converstions, false if not.

isTestMessageEnabled

public boolean isTestMessageEnabled()
Indicates whether this agent may send a test message.

Returns:
true if this agent may send a test message, false if not.

setConversationEnabled

public void setConversationEnabled(boolean b)
Parameters:
b -

setTestMessageEnabled

public void setTestMessageEnabled(boolean b)
Parameters:
b -

init

public void init()
          throws AbleException
Description copied from class: AblePlatformConversationAgent
Initializes this agent.

Sets up a default message inbox; calls super.init(); installs the MessageTransportService (created in super.init()) in its MessageSystemAdapter; initializes its ConversationManager.

Specified by:
init in interface AbleRemoteBean
Overrides:
init in class AblePlatformConversationAgent
Throws:
AbleException

process

public void process()
             throws AbleException
Description copied from class: AblePlatformConversationAgent
Does one step of processing. Calls super.process(), then calls process() on its ConversationManager.

Specified by:
process in interface AbleRemoteBean
Overrides:
process in class AblePlatformConversationAgent
Throws:
AbleException - If the superclass or the conversationManager throws one.

decideToSendTestMessage

protected boolean decideToSendTestMessage()

decideToStartConversation

protected boolean decideToStartConversation()

selectConversationPartner

protected javax.agent.service.directory.AgentDescription selectConversationPartner()

sendTestMessage

protected void sendTestMessage(javax.agent.service.directory.AgentDescription partnerDesc)

listKnownCpNames

public java.lang.String listKnownCpNames()

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005