## org.opencyc.cycagent
Class Echo

    java.lang.Object
      |
      +--org.opencyc.cycagent.GenericAgent
            |
            +--org.opencyc.cycagent.Echo

All Implemented Interfaces:
  MessageReceiver

public class Echo
extends GenericAgent

Provides an example agent demonstrating the echo role.

Author:
  Stephen L. Reed

  Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.

  the license

  www.opencyc.org

  OpenCyc at SourceForge

  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
`java.lang.String` `echoMessageText`
`protected static long` `oneMinuteDuration`

Fields inherited from class org.opencyc.cycagent.GenericAgent
`agentCommunityAdapter, coAbsCommunityAdapter, DEFAULT_VERBOSITY, fipaOsCommunityAdapter, messageConsumed, myAgentName, myAgentType, remoteAgentCommunity, remoteAgentName, verbosity`

Constructor Summary
`Echo()` Constructs a new Echo agent object.

Method Summary
`void` `doEcho()` Initializes the agent community adapter, sends the echo message, and displays the echo response.
`static void` `main(java.lang.String[] args)` Provides the main method to run the Echo class as an application.
`void` `messageReceived(int remoteAgentCommunity, fipaos.ont.fipa.ACL acl)` Notifies my agent that an Agent Communication Language message has been received.

Methods inherited from class org.opencyc.cycagent.GenericAgent
`aclToCycList, agentCommunity, agentCommunityName, getAgentType, getAID, getCoAbsCommunityAdapter, getFipaOsCommunityAdapter, getMyAgentName, initializeAgentCommunity, makeAID, processEchoRequest, setVerbosity, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### oneMinuteDuration

    protected static final long oneMinuteDuration

### echoMessageText

    public java.lang.String echoMessageText

Constructor Detail

### Echo

    public Echo()

  Constructs a new Echo agent object.

Method Detail

### main

    public static void main(java.lang.String[] args)

  Provides the main method to run the Echo class as an application.
  Parameters:
    `args` - the command line arguments.

### doEcho

    public void doEcho()

  Initializes the agent community adapter, sends the echo message, and displays the echo response.

### messageReceived

    public void messageReceived(int remoteAgentCommunity,
                                fipaos.ont.fipa.ACL acl)

  Notifies my agent that an Agent Communication Language message has been received.
  Overrides:
    `messageReceived` in class `GenericAgent`
  Parameters:
    `remoteAgentCommunity` - indicates either CoAbs or FIPA-OS agent community
    `acl` - the Agent Communication Language message which has been received for my agent