org.jage.examples.properties.xml
Class XMLContractHelloWorldSimpleAgent

java.lang.Object
  extended by org.jage.property.AbstractPropertyContainer
      extended by org.jage.property.ClassPropertyContainer
          extended by org.jage.agent.AbstractAgent
              extended by org.jage.agent.SimpleAgent
                  extended by org.jage.examples.properties.xml.XMLContractHelloWorldSimpleAgent
All Implemented Interfaces:
Serializable, IAgent, ISimpleAgent, IChangesNotifier, IStatefulComponent, IComponentInstanceProviderAware, IPropertyContainer

public class XMLContractHelloWorldSimpleAgent
extends SimpleAgent

This agent presents a usage of components described with XML.

Author:
AGH AgE Team
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jage.agent.AbstractAgent
address, instanceProvider, nameInitializer
 
Fields inherited from class org.jage.property.AbstractPropertyContainer
argumentsResolver, changesNotifierMonitors, pathParser, properties
 
Constructor Summary
XMLContractHelloWorldSimpleAgent()
          Constructs a new XMLContractHelloWorldSimpleAgent agent without an address.
 
Method Summary
 boolean finish()
          Called just before the component instance is unregistered; this is usually performed when the platform is going to shutdown.
 void init()
          Called just after the component instance is created and before the instance is returned to the client (note: this method is called only once while creating a component instance).
 void step()
          The main method of the agent.
 
Methods inherited from class org.jage.agent.SimpleAgent
createAddNewAgentAction, doAction, doDie, doMove, getAgentEnvironment, sendMessage, setAgentEnvironment
 
Methods inherited from class org.jage.agent.AbstractAgent
deliverMessage, equals, getAddress, getParentAddress, getProperty, hasAgentEnvironment, hashCode, queryEnvironment, queryParentEnvironment, receiveMessage, receiveMessage, setAddress, setInstanceProvider, toString
 
Methods inherited from class org.jage.property.ClassPropertyContainer
addFunction, addPropertyMonitor, addPropertyMonitor, attachMonitorsToProperties, getMetaProperties, getProperties, getPropertiesFactory, notifyMonitorsAboutDeletion, notifyMonitorsForChangedProperties, notifyMonitorsForChangedProperty, objectDeleted, removeFunction, removePropertyMonitor
 
Methods inherited from class org.jage.property.AbstractPropertyContainer
addMonitor, getFunctionArgumentsResolver, notifyChangeNotiferMonitors, removeMonitor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jage.agent.IAgent
deliverMessage, getAddress
 
Methods inherited from interface org.jage.property.IPropertyContainer
addFunction, addPropertyMonitor, addPropertyMonitor, getMetaProperties, getProperties, getProperty, objectDeleted, removeFunction, removePropertyMonitor
 
Methods inherited from interface org.jage.monitor.IChangesNotifier
addMonitor, removeMonitor
 

Constructor Detail

XMLContractHelloWorldSimpleAgent

@Inject
public XMLContractHelloWorldSimpleAgent()
Constructs a new XMLContractHelloWorldSimpleAgent agent without an address.

Method Detail

step

public void step()
Description copied from interface: ISimpleAgent
The main method of the agent. Here the agent does all his work.

Specified by:
step in interface ISimpleAgent
Specified by:
step in class SimpleAgent

finish

public boolean finish()
Description copied from interface: IStatefulComponent
Called just before the component instance is unregistered; this is usually performed when the platform is going to shutdown. The method should be used to perform a cleanup, for instance closing network connections, removing temporary files.

Specified by:
finish in interface IStatefulComponent
Overrides:
finish in class AbstractAgent
Returns:
true when the component is finished, false when component is still finishing (it is long running operation)

init

public void init()
          throws ComponentException
Description copied from class: AbstractAgent
Called just after the component instance is created and before the instance is returned to the client (note: this method is called only once while creating a component instance).

This implementation obtains a IAgentAddressProvider from the container and tries to initialise its own address.

Specified by:
init in interface IStatefulComponent
Overrides:
init in class AbstractAgent
Throws:
ComponentException - when any error during initialization occurs


Copyright © 2006-2011 AGH University of Science and Technology. All Rights Reserved.