examples.guestbook
Class AgentBehaviour

java.lang.Object
  extended byde.fhg.igd.jhsm.AbstractComponent
      extended byde.fhg.igd.jhsm.HSMState
          extended byde.fhg.igd.jhsm.HSM
              extended byexamples.guestbook.AgentBehaviour
All Implemented Interfaces:
Component, CompositeState, Serializable, State

public class AgentBehaviour
extends HSM

The agents task is to visit all known agent servers, access their guestbook service and add a nice entry. Finally the agent returns to the sender and reports the names of all guestbook owners. The dotted transitions denote migration transitions, which allows the agent to changes its location.

 HSM:
 ----
 initial --> --> homeaddr --> destaddr --> decision --> nextdest ....> guestbook --> remember site --+
                                             |   ^                              				       |
                                 	           |   |                              	 				   |
 finish <--- report <............ gohome <---+   +---------------------------------------------------+
 

Version:
$Id: AgentBehaviour.java 1913 2007-08-08 02:41:53Z jpeters $
Author:
U. Pinsdorf
See Also:
Serialized Form

Nested Class Summary
private  class AgentBehaviour.GuestbookAction
          This action adds a predefined entry to the guestbook of the local host.
private  class AgentBehaviour.ReportAction
          This action gives the user an report of the agent's actions.
 
Field Summary
private static String CTX_DESTINATIONS
           
private static String CTX_HOME
          Keys for the context of the state machine.
private static String CTX_SITES
           
private static String GUESTBOOK_ENTRY
           
private  int hop_
          The number of migration hops already performed.
private static Logger LOG
          The logger instance.
private static String PROTOCOL
          Preferred migration protocol.
 
Fields inherited from class de.fhg.igd.jhsm.HSM
 
Fields inherited from class de.fhg.igd.jhsm.HSMState
 
Fields inherited from class de.fhg.igd.jhsm.AbstractComponent
 
Constructor Summary
AgentBehaviour()
          Constructs the state machine for this agent behaviour.
 
Methods inherited from class de.fhg.igd.jhsm.HSM
action, addState, contains, entry, exit, getInitialState, getStates, removeState, setInitialState
 
Methods inherited from class de.fhg.igd.jhsm.HSMState
action, addDeferred, addTransition, defers, getDeferred, getTransitions, removeDeferred, removeTransition, setEntry, setExit
 
Methods inherited from class de.fhg.igd.jhsm.AbstractComponent
getAction, getName, getParent, setAction, setName, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.fhg.igd.jhsm.State
addDeferred, addTransition, defers, getDeferred, getTransitions, removeDeferred, removeTransition, setEntry, setExit
 
Methods inherited from interface de.fhg.igd.jhsm.Component
action, getAction, getName, getParent, setAction, setName, setParent
 

Field Detail

LOG

private static final Logger LOG
The logger instance.


CTX_HOME

private static final String CTX_HOME
Keys for the context of the state machine. This context is a global data repository for information sharing between states.

See Also:
Constant Field Values

CTX_DESTINATIONS

private static final String CTX_DESTINATIONS
See Also:
Constant Field Values

CTX_SITES

private static final String CTX_SITES
See Also:
Constant Field Values

PROTOCOL

private static final String PROTOCOL
Preferred migration protocol.

See Also:
Constant Field Values

GUESTBOOK_ENTRY

private static final String GUESTBOOK_ENTRY
See Also:
Constant Field Values

hop_

private int hop_
The number of migration hops already performed. This variable will be serialized along with the agent.

Constructor Detail

AgentBehaviour

public AgentBehaviour()
Constructs the state machine for this agent behaviour.



Copyright © Fraunhofer Gesellschaft. All Rights Reserved.