|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.opencyc.cycagent.coabs.CoAbsCommunityAdapter
Provides the interface for interacting with the CoABS agent community.
The package org.opencyc.cycagent.coabs is an optional package for OpenCyc. If the developer does not have access to the CoABS grid classes from Global Infotek, then the org.opencyc.cycagent.coabs package can be ommitted from the build. The FIPA-OS agent community is freely available as open source and OpenCyc can be configured to work with it alone, or in combination with CoABS when available.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| Field Summary | |
protected static java.util.Hashtable |
agentRepCache
Cached AgentRep objects which reduce lookup overhead. |
protected java.lang.String |
conversationState
The conversation state. |
int |
msgSerialNumber
outbound message serial number. |
protected java.lang.String |
myAgentName
reference to the name of my agent |
protected com.globalinfotek.coabsgrid.AgentRegistrationHelper |
regHelper
the CoABS AgentRestrationHelper object. |
protected java.util.Hashtable |
replyMessages
Implements an association: message id --> reply message acl. |
protected int |
verbosity
Sets verbosity of this object's output. |
protected java.util.Hashtable |
waitingReplyThreads
Implements an association: message id --> waiting thread for the reply. |
| Fields inherited from interface org.opencyc.cycagent.AgentCommunityAdapter |
COABS_AGENT_COMMUNITY, CYC_API_ONTOLOGY, CYC_ECHO_ONTOLOGY, DEFAULT_VERBOSITY, FIPA_OS_AGENT_COMMUNITY, FIPA_OS_AND_COABS_AGENT_COMMUNITIES, LOW_VERBOSITY, MAX_VERBOSITY, MEDIUM_VERBOSITY, QUIET_VERBOSITY |
| Constructor Summary | |
CoAbsCommunityAdapter()
Constructs a new CoAbsCommunityAdapter. |
|
| Method Summary | |
void |
cleanup()
Deregisters this agent when the application is terminated. |
fipaos.ont.fipa.ACL |
converseMessage(fipaos.ont.fipa.ACL acl,
Timer timer)
Sends an Agent Communication Language message and returns the reply. |
void |
deregister()
Deregisters this agent. |
protected static java.lang.String |
fixSenderReceiver(java.lang.String aclText)
Fixes the :sender and :receiver parameter in the CoABS message to make them FIPA ACL compatible. |
fipaos.ont.fipa.fipaman.AgentID |
getAID()
Gets the AgentID of this Agent. |
void |
initialize(MessageReceiver messageReceiver,
int verbosity)
Initializes the new CoAbsCommunityAdapter instance. |
protected com.globalinfotek.coabsgrid.AgentRep |
lookupAgentRep(java.lang.String agentName)
Returns the AgentRep object for the given agent name. |
void |
messageAdded(com.globalinfotek.coabsgrid.Message message)
Receives messages from the CoABS grid. |
java.lang.String |
nextMessageId()
Returns the next message serial number identifier. |
protected void |
register()
Registers the CoABS agent on the grid. |
void |
sendMessage(fipaos.ont.fipa.ACL acl)
Sends an Agent Communication Language message. |
void |
setVerbosity(int verbosity)
Sets verbosity of this object's output. |
void |
terminate()
Terminate this agent. |
void |
xforward(com.globalinfotek.coabsgrid.Message message,
java.lang.String messageId)
Forwards the message to the CoABS grid. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int msgSerialNumber
protected int verbosity
protected java.lang.String myAgentName
protected com.globalinfotek.coabsgrid.AgentRegistrationHelper regHelper
protected java.util.Hashtable waitingReplyThreads
protected java.util.Hashtable replyMessages
protected java.lang.String conversationState
protected static java.util.Hashtable agentRepCache
| Constructor Detail |
public CoAbsCommunityAdapter()
throws java.io.IOException
| Method Detail |
public void initialize(MessageReceiver messageReceiver,
int verbosity)
throws java.io.IOException
initialize in interface AgentCommunityAdaptermessageReceiver - the parent application which can receive agent messages via a callbackverbosity - the verbosity of this agent adapter's output. 0 --> quiet ... 9 -> maximum
diagnostic input
protected void register()
throws java.io.IOException
protected static java.lang.String fixSenderReceiver(java.lang.String aclText)
throws fipaos.parser.ParserException
aclText - the ACL expression in string form with :sender public java.lang.String nextMessageId()
nextMessageId in interface AgentCommunityAdapter
public void sendMessage(fipaos.ont.fipa.ACL acl)
throws java.io.IOException
sendMessage in interface AgentCommunityAdapteracl - the Agent Communication Language message to be sent
public fipaos.ont.fipa.ACL converseMessage(fipaos.ont.fipa.ACL acl,
Timer timer)
throws javax.naming.TimeLimitExceededException,
java.io.IOException
converseMessage in interface AgentCommunityAdapteracl - the Agent Communication Language message to be senttimer - the Timer object controlling the maximum wait time for a reply message,
after which an excecption is thrown.public void messageAdded(com.globalinfotek.coabsgrid.Message message)
messageAdded in interface com.globalinfotek.coabsgrid.MessageListenermessage - the message received from the CoABS grid
protected com.globalinfotek.coabsgrid.AgentRep lookupAgentRep(java.lang.String agentName)
throws java.io.IOException
agentName - the agent name
public void xforward(com.globalinfotek.coabsgrid.Message message,
java.lang.String messageId)
message - the CoABS messagepublic void cleanup()
cleanup in interface com.globalinfotek.coabsgrid.ShutdownHookpublic void deregister()
deregister in interface AgentCommunityAdapterpublic void terminate()
terminate in interface AgentCommunityAdapterpublic fipaos.ont.fipa.fipaman.AgentID getAID()
getAID in interface AgentCommunityAdapterpublic void setVerbosity(int verbosity)
setVerbosity in interface AgentCommunityAdapterverbosity - 0 --> quiet ... 9 -> maximum diagnostic input
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||