ie.nuigalway.ecrg.jade.jmsagentgateway.examples
Class PingAgent

java.lang.Object
  |
  +--jade.core.Agent
        |
        +--ie.nuigalway.ecrg.jade.jmsagentgateway.examples.PingAgent
All Implemented Interfaces:
java.lang.Runnable, jade.util.leap.Serializable, java.io.Serializable, jade.core.TimerListener

public class PingAgent
extends jade.core.Agent

Example PingClient agent used to interact with the JmsProxyAgent

Version:
0.5 12 January 2004
Author:
Edward Curry
See Also:
Serialized Form

Nested Class Summary
(package private)  class PingAgent.JmsSubscriptionInitiator
          Implementation of the SubscriptionInitiator interface
 
Nested classes inherited from class jade.core.Agent
 
Field Summary
private  jade.content.lang.Codec codec
           
private  jade.core.AID jmsProxyAgent
           
private  jade.content.onto.Ontology ontology
           
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_COPY, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_TRANSIT, AP_WAITING, currentBehaviour, currentMessage, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN
 
Constructor Summary
PingAgent()
           
 
Method Summary
private  jade.lang.acl.ACLMessage getSubscriptionMsg()
          Create a subscription message
private  void lookupAgent()
          Lookup the JmsProxyAgent
private  void publishPong(java.lang.String payload)
          Utility messgea to publish a pong
private  void sendMessage(int performative, jade.content.AgentAction action)
          Utility method for sending a message
protected  void setup()
          Setup the agent
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, doActivate, doClone, doDelete, doMove, doStart, doSuspend, doTimeOut, doWait, doWait, doWake, extractPassword, extractUsername, getAgentState, getAID, getAMS, getArguments, getAuthority, getCertificateFolder, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getPrincipal, getProperty, getQueueSize, getState, here, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, read, read, receive, receive, removeBehaviour, restartLater, restore, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setOwnership, setPrincipal, setQueueSize, takeDown, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jmsProxyAgent

private jade.core.AID jmsProxyAgent

codec

private jade.content.lang.Codec codec

ontology

private jade.content.onto.Ontology ontology
Constructor Detail

PingAgent

public PingAgent()
Method Detail

setup

protected void setup()
Setup the agent

Overrides:
setup in class jade.core.Agent

publishPong

private void publishPong(java.lang.String payload)
Utility messgea to publish a pong

Parameters:
payload - Payload of the message to be published

sendMessage

private void sendMessage(int performative,
                         jade.content.AgentAction action)
Utility method for sending a message

Parameters:
performative - Performative for the message
action - The AgentAction of the message to be sent

getSubscriptionMsg

private jade.lang.acl.ACLMessage getSubscriptionMsg()
Create a subscription message

Returns:
The subscriptionMsg value

lookupAgent

private void lookupAgent()
Lookup the JmsProxyAgent