org.jage.examples.properties.xml
Class XMLContractHelloWorldSimpleAgent
java.lang.Object
org.jage.property.AbstractPropertyContainer
org.jage.property.ClassPropertyContainer
org.jage.agent.AbstractAgent
org.jage.agent.SimpleAgent
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
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.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 |
XMLContractHelloWorldSimpleAgent
@Inject
public XMLContractHelloWorldSimpleAgent()
- Constructs a new XMLContractHelloWorldSimpleAgent agent without an address.
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.