com.agentfactory.cldc.migration
Interface MigrationPlatform


public interface MigrationPlatform

Platforms that support migration must implement the migration platform interface. It contains methods create agents on the local platform and moving agent's to a destination platform.

Author:
Conor Muldoon

Method Summary
 void createAgent(java.io.DataInputStream dis)
          Creates an agent from an input stream.
 void emigrate(AgentName name)
          Causes an agent to leave the local platform.
 void writeAgent(java.lang.Object key, java.io.DataOutputStream dos)
          Writes the state of the agent that is associated with the specified key in the scheduler to be written to a data output stream.
 void writeRes(java.lang.Object key, java.io.DataOutputStream dos)
          Writes the agent's resource constraint to a data output stream.
 

Method Detail

createAgent

void createAgent(java.io.DataInputStream dis)
                 throws java.io.IOException
Creates an agent from an input stream.

Parameters:
dis - the specified data input stream.
Throws:
java.io.IOException - if there is an I/O error.

emigrate

void emigrate(AgentName name)
Causes an agent to leave the local platform.

Parameters:
name - the name of the agent that is to migrate.

writeAgent

void writeAgent(java.lang.Object key,
                java.io.DataOutputStream dos)
                throws java.io.IOException
Writes the state of the agent that is associated with the specified key in the scheduler to be written to a data output stream.

Parameters:
key - the key that is associated with the agent in the scheduler.
dos - the data output stream to which the agent's state is to be written.
Throws:
java.io.IOException - if there is an I/O error.

writeRes

void writeRes(java.lang.Object key,
              java.io.DataOutputStream dos)
              throws java.io.IOException
Writes the agent's resource constraint to a data output stream.

Parameters:
key - the key that is associated with the agent in the scheduler.
dos - the data output stream to which the agent's resource constraint is to be written.
Throws:
java.io.IOException - if there is an I/O error.