All Packages Class Hierarchy This Package Previous Next Index
Class macondo.mak.Agent
macondo.mak.Agent
- public class Agent
A very simple prototype of agent.
-
INIT
- Indicates that the agent is executing for the first time.
-
RESTART
- Indicates that this agent is executing after a migration.
-
RESTORE
- Indicates that this agent is executing after being made
persistent.
-
Agent()
- Creates a new
Agent
.
-
Agent(Agent)
- Creates a new
Agent
from another one.
-
Agent(String)
- Creates a new
Agent
with given name.
-
Agent(String, PlaceName)
- Creates a new
Agent
with given name
and current place name.
-
flush()
-
-
flush(Object)
-
-
getCurrentPlace()
- Returns current place.
-
getName()
-
-
getProperty(Object)
-
-
getSource()
- Returns source place name.
-
go(PlaceName, String)
- Moves the agent to a new place.
-
go(String, int, String)
- Moves the agent to a new place.
-
init()
- Method called to initialize the agent.
-
putProperty(Object, Object)
-
-
removeProperty(Object)
-
-
save()
-
-
save(Object)
-
-
setName(String)
-
-
stop()
- Method called before agent migration, in order to store relevant
information in agent state or release resources.
INIT
public static final int INIT
- Indicates that the agent is executing for the first time.
RESTART
public static final int RESTART
- Indicates that this agent is executing after a migration.
RESTORE
public static final int RESTORE
- Indicates that this agent is executing after being made
persistent.
Agent
public Agent()
- Creates a new
Agent
.
Agent
public Agent(String name)
- Creates a new
Agent
with given name.
- Parameters:
- name - the name of the
Agent
Agent
public Agent(String name,
PlaceName source)
- Creates a new
Agent
with given name
and current place name.
- Parameters:
- name - the name of the
Agent
- source - the agent's source place name
Agent
public Agent(Agent anAgent)
- Creates a new
Agent
from another one.
- Parameters:
- anAgent - an
Agent
setName
public void setName(String name)
getName
public String getName()
getProperty
public Object getProperty(Object key)
putProperty
public void putProperty(Object key,
Object value)
removeProperty
public Object removeProperty(Object key)
flush
public void flush() throws IOException
flush
public void flush(Object key) throws IOException
save
public void save() throws IOException
save
public void save(Object key) throws IOException
init
public void init()
- Method called to initialize the agent.
This default implementation does nothing.
stop
public void stop()
- Method called before agent migration, in order to store relevant
information in agent state or release resources.
This default implementation does nothing.
go
protected final void go(String host,
int port,
String callback) throws TransportException
- Moves the agent to a new place.
- Parameters:
- host - destination host name
- port - destination port number
- callback - callback method to execute in new location
- Throws: TransportException
- never occurs. One of the
exception is thrown instead.
- Throws: UnknownDestinationException
- occurs if the destination
place is unknown.
- Throws: TransportFailedException
- occurs if migration
fails for any other reason.
go
protected final void go(PlaceName p_name,
String callback) throws Exception
- Moves the agent to a new place.
- Parameters:
- p_name - destination place name
- callback - callback method to execute in new location
getCurrentPlace
protected Place getCurrentPlace()
- Returns current place.
- See Also:
- Place
getSource
protected PlaceName getSource()
- Returns source place name.
- Returns:
- source place name.
- See Also:
- PlaceName, Place
All Packages Class Hierarchy This Package Previous Next Index