org.iids.aos.systemservices
Interface HostManager

All Superinterfaces:
SystemService
All Known Implementing Classes:
LocalHostManager

public interface HostManager
extends SystemService

HostManager systemservice interface.

Interface published for all host manager services. Calls to a HostManager usually go through a dynamic proxy, AgentScape uses the communicator SystemServiceProxy, an instance of which is usually created by binding to it using AsCommunicator.bind(java.lang.Class, org.iids.aos.systemservices.communicator.structs.Address) or by obtaining the reference from the AgentScape lookup cache, using LookupCache.

The implementation of the host manager interface is done by various classes in the org.iids.aos.hostmanager package. Each class that implements a host manager method, publishes this method using the method Communicator.publish(org.iids.aos.systemservices.communicator.InterfaceMethod).

Note that the communicator does not suppor overloading, so each method in this interface should have a unique name (I guess).

Author:
mobach, rjtimmer

Nested Class Summary
static class HostManager.AgentStatus
           
 
Field Summary
static java.lang.String LOOKUP_REGISTRATION_NAME
           
 
Method Summary
 AgreementOffer acceptLease(java.lang.String leaseIdentifier)
           
 AgentHandle create_agent_handle(AgentID id)
          Create a new handle for an agent.
 void create_agent(AgentID agentID, java.lang.String leaseIdentifier)
          Create a new agent on this host.
 AgentCodeSegment create_code_segment(AgentID id, java.lang.String desc, Language lang)
          Deprecated. It is no longer needed to create a code segment before writing to it. Once a call to write_code(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentCodeSegment, byte[]) was successful, a segment with description and Language exist on this host for this agent.
 AgentDataSegment create_data_segment(AgentID id, java.lang.String desc, java.lang.String type)
          Deprecated. It is no longer needed to create a data segment before writing to it. Once a call to write_data(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentDataSegment, byte[]) was successful, a segment with description and subtype exist on this host for this agent.
 void delete_code(AgentID id, AgentCodeSegment code)
          Remove code segment from agent container.
 void delete_data(AgentID id, AgentDataSegment data)
          Remove data segment from agent container.
 int deregister_systemservice(AgentScapeID serviceId)
          Deregister a system service from the host manager.
 AgentArchive export_agent(AgentID id)
          Export agent container.
 java.util.List<AgentHandle> get_agent_handles(AgentID id)
          Obtain a list of all handles registered to an id.
 Address get_agent_server(AgentID id)
          Obtain AgentServer address belonging to agent

 AgentCodeSegment[] get_code_segments(AgentID id)
          Obtain a list of all code segments of this agent.
 AgentDataSegment[] get_data_segments(AgentID id)
          Obtain a list of all data segments of this agent.
 AgentCodeSegment get_default_code_segment(AgentID id)
          Obtain description of the default code segment for this agent.
 Envelope get_message(AgentID id, java.util.Collection<AgentHandle> handles, boolean block)
          Get a single pending message for an agent.
 java.util.List<Envelope> get_messages(AgentID id, java.util.Collection<AgentHandle> handles, boolean block)
          Gat all pending messages for an agent.
 java.util.Map<AgentScapeID,SystemServiceInfo> get_service_id_list()
           
 MigrationEndpoint handle_migration(AgentID agentId, java.lang.String leaseIdentifier, Address requestingAddress)
          Instruct this host manager to create an endpoint for an agent, and expect to receive an agent on this endpoint.
 boolean hosts_agent(AgentID agentId)
          Query host manager to see if a certain agent is located there.
 void kill_agent(AgentID agentId)
          Instructs host manager to kill an agent.
 java.util.List<AgentID> list_agents()
          List AgentIDs of all agents running on this particular host.
 void migration_request(AgentID agentId, java.lang.String leaseIdentifier, AgentScapeID destinationLocationId)
          Request and perform migration of an agent to a remote location.
 void migration_status(MigrationID mid, boolean status)
          Report back migration status to the source host manager of an agent.
 java.lang.String pingString()
           
 void pingVoid()
           
 void put_message(Envelope message, boolean canForward)
          Put a message in the message queue for an agent.
 void put_messages(java.util.List<Envelope> messages, boolean canForward)
           
 byte[] read_code(AgentID id, AgentCodeSegment code)
          Read bytes from code segment.
 byte[] read_data(AgentID id, AgentDataSegment data)
          Read bytes from data segment.
 int register_systemservice(AgentScapeID serviceId, java.lang.String serviceType, Address address, Specifications specs)
          Register a system service (eg an agent server) with this host manager.
 void rejectLease(java.lang.String leaseIdentifier)
           
 java.util.List<Envelope> remove_agent_handle(AgentID id, AgentHandle handle, boolean pickup)
          Remove handle from an agent.
 AgreementOffer requestLease(AgreementOffer leaseRequest)
           
 AgreementOffer requestLeaseStatus(java.lang.String leaseIdentifier)
           
 TemplateList requestTemplates()
           
 void set_default_code_segment(AgentID id, AgentCodeSegment code)
          Set description of the default code segment for an agent.
 void start_agent(AgentID agentId, boolean collect, java.lang.String[] args)
          Start running an agent on this host.
 int start_agentscape_api()
          Deprecated. I think this function is never used anymore! The only implementation of this function (in SystemServiceModule.startAgentScapeApi()) does not do anything! --rjtimmer
 int start_agentserver(AgentScapeID agentserverID, Specifications serverSpecifications)
          Start an agentserver of the type specified in the Specifications.
 void start_service(Specifications specifications)
          XXX NEW XXX Start a service in the host manager.
 void suspend_agent(AgentID agentId)
          Suspend agent state to agent container.
 AgentArchive wait_for_agent(AgentID id, boolean pickup)
          Method to collect agent contents after an agent is done on this host.
 void write_code(AgentID id, AgentCodeSegment code, byte[] bytes)
          Write code segment with descritption and type information code.
 void write_data(AgentID id, AgentDataSegment data, byte[] bytes)
          Write data segment with descritption and type information data.
 
Methods inherited from interface org.iids.aos.systemservices.SystemService
pingService, shutdown, unbind
 

Field Detail

LOOKUP_REGISTRATION_NAME

static final java.lang.String LOOKUP_REGISTRATION_NAME
See Also:
Constant Field Values
Method Detail

create_agent

void create_agent(AgentID agentID,
                  java.lang.String leaseIdentifier)
                  throws AgentCreationException
Create a new agent on this host. The AgentServer is assumed to be already registered (the lease is already established).

This call creates a new agent container on this host, this container is associated with the AgentID used for this call, which is supposed to be assigned by the LocationManager.

Parameters:
agentID - AgentID of the newly created agent, this ID is created by the location manager before creating the agent container on the host manager.
leaseIdentifier - Lease identifier indicating which resources (agent server) is to be running the agent once it is started.
Throws:
AgentCreationException - If the agent cannot be created on this host.

start_agent

void start_agent(AgentID agentId,
                 boolean collect,
                 java.lang.String[] args)
                 throws AgentIDUnknownException,
                        AgentStartupException
Start running an agent on this host.

The agent should already be created on this host before calling this method. Once the agent is created, and the respective code segments are added to the agent container, the agent can be started with this method.

Parameters:
agentId - ID of the agent to start on this host.
collect - Indicate whether the result data (data and code segments) should be returned to the owner (true) or be discarded (false) once the agent finishes. If the data should be returend, this should be done using wait_for_agent(org.iids.aos.systemservices.communicator.structs.AgentID, boolean).
Throws:
AgentIDUnknownException - If agentID is unknown to this host.
AgentStartupException - If there is a problem executing the agent code.

suspend_agent

void suspend_agent(AgentID agentId)
                   throws AgentIDUnknownException,
                          AgentSuspendException
Suspend agent state to agent container.

This function suspends the agent, which means that the agent state is automatically stored in the agent container, if this is supported by the agent server that runs the agent. The state of java agents can be automatically suspended to the agent container (using Serialization). Other types of agents (non-Java) will have to save their state manually to the agent container using the write_data(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentDataSegment, byte[]) functions.

Once an agent is succssfully suspended, it can be migrated.

Parameters:
agentId - AgentID of the agent to be suspended.
Throws:
AgentIDUnknownException - If agentID is unknown to this host manager.
AgentSuspendException - If the agent cannot be suspended.

kill_agent

void kill_agent(AgentID agentId)
                throws AgentIDUnknownException
Instructs host manager to kill an agent.

After this call, the AgentID for this agent is no longer valid. If the agent server that runs this agent supports this, the agent is also no longer running. Any handles and tokens beloning to this AgentID are no longer valid, and cannot be used anymore to access the API.

Parameters:
agentId - The AgentID of the agent to be killed.
Throws:
AgentIDUnknownException - If agentId was not running on this host.

list_agents

java.util.List<AgentID> list_agents()
List AgentIDs of all agents running on this particular host.

Returns:
A list of agent IDs of all agents residing on this host.

hosts_agent

boolean hosts_agent(AgentID agentId)
Query host manager to see if a certain agent is located there.

Parameters:
agentId - The AgentID of the agent to check.
Returns:
A boolean indicating whether the agent is located on this host (true) or not (false).

create_agent_handle

AgentHandle create_agent_handle(AgentID id)
                                throws AgentIDUnknownException
Create a new handle for an agent.

An AgentHandle is an alias for an agent. It can be used as a communication endpoint to and from that agent: other parties can send messages to a handle, and the agent itself can receive messages from the handle.

A handle cannot be resolved to an AgentID by any other party than the middleware, which allows for anonymous communication by agents. An agent can create an infinite amount of handles.

Parameters:
id - AgentID of the agent to create a new handle for.
Returns:
New AgentHandle to be used for communication.
Throws:
AgentIDUnknownException - If the agent is not known on this host.

remove_agent_handle

java.util.List<Envelope> remove_agent_handle(AgentID id,
                                             AgentHandle handle,
                                             boolean pickup)
                                             throws AgentIDUnknownException
Remove handle from an agent.

Parameters:
id - ID of the agent
handle - The AgentHandle to remove
pickup - If true then all pending undelivered messages are returned. Otherwise they are discarded.
Returns:
A list with all unclaimed messages (if desired).
Throws:
AgentIDUnknownException

get_agent_handles

java.util.List<AgentHandle> get_agent_handles(AgentID id)
                                              throws AgentIDUnknownException
Obtain a list of all handles registered to an id.

Administrative call, should not be possible to be called from parties other than the agent, its owner, or perhaps the the location administrator.

Parameters:
id - AgentID of the agent to list handles for.
Returns:
A list of all handles of the agent (including owner/primary handle).
Throws:
AgentIDUnknownException - If the agent is not known on this host.

register_systemservice

int register_systemservice(AgentScapeID serviceId,
                           java.lang.String serviceType,
                           Address address,
                           Specifications specs)
Register a system service (eg an agent server) with this host manager.

After a system service is registered with the host manager, the host manager can order it to start agents (if it is an agent server) or what not. XXX The system service must have the host manager token in order to call this method. TODO this function has no exceptions, must be added.

Parameters:
serviceId - AgentScape system service ID of the service to register.
serviceType - Name/type of the service (e.g. "agentserver"). XXX same as specification value specs.SYSTEMSERVICE_TYPE methinks FIXME this parameter can be removed? -- rjtimmer
address - Communication endpoint to contact the system service.
specs - System service specifications.

deregister_systemservice

int deregister_systemservice(AgentScapeID serviceId)
Deregister a system service from the host manager.

TODO: make sure that the system service is not currently active (e.g. running any active agents) otherwise we will run into trouble!

TODO This method has no exceptions TODO add!

Parameters:
serviceId - AgentScapeID of the service to remove.

start_agentserver

int start_agentserver(AgentScapeID agentserverID,
                      Specifications serverSpecifications)
Start an agentserver of the type specified in the Specifications.

Called by LocationConfigurationModule.configureHost(org.iids.aos.systemservices.communicator.structs.AgentScapeID).

Parameters:
agentserverID - New ID of the agent server to start, this ID is assigned by the LocationConfigurationModule (in the location manager).
serverSpecifications - Specifications of the agent server to start.

start_service

void start_service(Specifications specifications)
                   throws StartupException
XXX NEW XXX Start a service in the host manager. XXX Experimental XXX

Throws:
StartupException

start_agentscape_api

@Deprecated
int start_agentscape_api()
Deprecated. I think this function is never used anymore! The only implementation of this function (in SystemServiceModule.startAgentScapeApi()) does not do anything! --rjtimmer

Start running an API on this host manager.


migration_request

void migration_request(AgentID agentId,
                       java.lang.String leaseIdentifier,
                       AgentScapeID destinationLocationId)
                       throws MigrationFailedException
Request and perform migration of an agent to a remote location.

The complete migration process, requests the local host manager to contact its location manager to perform the migration. The remote location manager then selects a target host manager, which creates an endpoint for the agent to arrive. The agent is then sent to this remote endpoint.

Parameters:
agentId - The AgentID of the agent to migrate.
leaseIdentifier - Pre-established lease, containing host and agentserver information of target.
destinationLocationId - The AgentScapeID of the target location.
Throws:
MigrationFailedException - If for some reason (local or remote) the migration request could not be completed, contains all different kinds of exceptions like target unknown, unable to start on remote site, etc.

handle_migration

MigrationEndpoint handle_migration(AgentID agentId,
                                   java.lang.String leaseIdentifier,
                                   Address requestingAddress)
                                   throws MigrationFailedException
Instruct this host manager to create an endpoint for an agent, and expect to receive an agent on this endpoint.

This is called by the target location manager of the migration process, to instruct one of its host managers that it can expect to receive an agent.

Parameters:
agentId - The AgentID of the agent to be expected.
leaseIdentifier - Lease identifier indicating placement of agent on an agentserver on this host.
requestingAddress - Address of the host manager that will send the agent, this address is used to notify the sending host manager of completion of the transfer (either successful or not) once the agent container is transported.
Returns:
A MigrationEndpoint containing address information where the source host manager can migrate the agent to.
Throws:
MigrationFailedException - If for some reason the host manager cannot grant the request.

migration_status

void migration_status(MigrationID mid,
                      boolean status)
                      throws MigrationFailedException
Report back migration status to the source host manager of an agent.

This method is called by the receiving host manager on the sending host manager, to notify it that the migration procedure is finished. It can either notify the sending host of success or failure.

Parameters:
mid - The unique MigrationID associated with this migration.
status - Indicates either a failure of the migration (false) or success (true)
Throws:
MigrationFailedException - If MigrationID or agent is unknown on this host manager.

get_agent_server

Address get_agent_server(AgentID id)
                         throws AgentIDUnknownException
Obtain AgentServer address belonging to agent

Parameters:
id - The AgentID of the agent to look up.
Returns:
The Address of the server hosting the agent.
Throws:
AgentIDUnknownException - If the AgentID is not hosted here.

requestTemplates

TemplateList requestTemplates()

requestLease

AgreementOffer requestLease(AgreementOffer leaseRequest)

acceptLease

AgreementOffer acceptLease(java.lang.String leaseIdentifier)

rejectLease

void rejectLease(java.lang.String leaseIdentifier)

requestLeaseStatus

AgreementOffer requestLeaseStatus(java.lang.String leaseIdentifier)

pingString

java.lang.String pingString()

pingVoid

void pingVoid()

create_code_segment

@Deprecated
AgentCodeSegment create_code_segment(AgentID id,
                                                java.lang.String desc,
                                                Language lang)
                                     throws AgentIDUnknownException
Deprecated. It is no longer needed to create a code segment before writing to it. Once a call to write_code(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentCodeSegment, byte[]) was successful, a segment with description and Language exist on this host for this agent.

Create a code segment for an agent present on this host.

Throws:
AgentIDUnknownException

create_data_segment

@Deprecated
AgentDataSegment create_data_segment(AgentID id,
                                                java.lang.String desc,
                                                java.lang.String type)
                                     throws AgentIDUnknownException
Deprecated. It is no longer needed to create a data segment before writing to it. Once a call to write_data(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentDataSegment, byte[]) was successful, a segment with description and subtype exist on this host for this agent.

Create a code segment for an agent present on this host.

Throws:
AgentIDUnknownException

write_code

void write_code(AgentID id,
                AgentCodeSegment code,
                byte[] bytes)
                throws AgentContainerException,
                       AgentIDUnknownException
Write code segment with descritption and type information code.

Each code segment has a unique AgentCodeSegment description. After a call to write_code(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentCodeSegment, byte[]) the code segment with description code now contains the data in bytes

A code segment that does not exist will not have to be created before calling this write_code(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentCodeSegment, byte[]) function: it will be created if it does not exist.

Parameters:
id - The AgentID of the agent to write code for.
code - AgentCodeSegment containing description of the code segment to write.
bytes - Data to store in the code segment.
Throws:
AgentContainerException - Problem writing code to the agent container.
AgentIDUnknownException - If the AgentID id is not located on this host.

write_data

void write_data(AgentID id,
                AgentDataSegment data,
                byte[] bytes)
                throws AgentIDUnknownException,
                       AgentContainerException
Write data segment with descritption and type information data.

Each data segment has a unique AgentDataSegment description. After a call to write_data(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentDataSegment, byte[]) the data segment with description data now contains the data in bytes

A data segment that does not exist will not have to be created before calling this write_data(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentDataSegment, byte[]) function: it will be created if it does not exist.

Parameters:
id - The AgentID of the agent to write data for.
data - AgentDataSegment containing description of the data segment to write.
bytes - Data to store in the data segment.
Throws:
AgentContainerException - Problem writing data to the agent container.
AgentIDUnknownException - If the AgentID id is not located on this host.

read_code

byte[] read_code(AgentID id,
                 AgentCodeSegment code)
                 throws AgentIDUnknownException,
                        AgentContainerException
Read bytes from code segment.

Parameters:
id - The AgentID to read the segment from.
code - Description of the code segment to read.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentContainerException - If the segment cannot be read from the agent container.

read_data

byte[] read_data(AgentID id,
                 AgentDataSegment data)
                 throws AgentIDUnknownException,
                        AgentContainerException
Read bytes from data segment.

Parameters:
id - The AgentID to read the segment from.
data - Description of the data segment to read.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentContainerException - If the segment cannot be read from the agent container.

delete_code

void delete_code(AgentID id,
                 AgentCodeSegment code)
                 throws AgentIDUnknownException,
                        AgentContainerException
Remove code segment from agent container.

After this call, the code segment will not be available in the agent container for this agent.

Parameters:
id - The AgentID of the agent to delete the segment from.
code - Description of the code segment to delete.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentContainerException - If the segment cannot be removed from the agent container.

delete_data

void delete_data(AgentID id,
                 AgentDataSegment data)
                 throws AgentIDUnknownException,
                        AgentContainerException
Remove data segment from agent container.

After this call, the data segment will not be available in the agent container for this agent.

Parameters:
id - The AgentID of the agent to delete the segment from.
data - Description of the data segment to delete.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentContainerException - If the segment cannot be removed from the agent container.

get_code_segments

AgentCodeSegment[] get_code_segments(AgentID id)
                                     throws AgentIDUnknownException
Obtain a list of all code segments of this agent.

Parameters:
id - The AgentID of the agent to obtain the code segment list.
Returns:
An array of all AgentCodeSegment objects that can be used for reading code segments of this agent. If the agent has no data segments, then this list will have 0 elements.
Throws:
AgentIDUnknownException - If the agent is not known on this host.

get_data_segments

AgentDataSegment[] get_data_segments(AgentID id)
                                     throws AgentIDUnknownException
Obtain a list of all data segments of this agent.

Parameters:
id - The AgentID of the agent to obtain the dat segment list.
Returns:
An array of all AgentDataSegment objects that can be used for reading data segments of this agent. If the agent has no data segments, then this list will have 0 elements.
Throws:
AgentIDUnknownException - If the agent is not known on this host.

get_default_code_segment

AgentCodeSegment get_default_code_segment(AgentID id)
                                          throws AgentIDUnknownException,
                                                 AgentContainerException
Obtain description of the default code segment for this agent.

Each agent has at most one default code segment, which is the code segment that will be executed once an agent is (re)started on a host. An agent can have possibly more than one code segment, though there can be at most one that is the default code segment.

Parameters:
id - The AgentID of the agent to obtain the default code segment from.
Returns:
The description of the code segment, which can be used to read the code segment if desired, using read_code(org.iids.aos.systemservices.communicator.structs.AgentID, org.iids.aos.agent.AgentCodeSegment).
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentContainerException - If the description of the default code segment cannot be obtained, or if there is no default code segment for this agent.

set_default_code_segment

void set_default_code_segment(AgentID id,
                              AgentCodeSegment code)
                              throws AgentIDUnknownException,
                                     AgentContainerException
Set description of the default code segment for an agent.

During its lifetime, an agent can change its default code segment. This code segment will be used once the agent is started (start_agent(org.iids.aos.systemservices.communicator.structs.AgentID, boolean, java.lang.String[])) or after migration (migration_request(org.iids.aos.systemservices.communicator.structs.AgentID, java.lang.String, org.iids.aos.systemservices.communicator.structs.AgentScapeID)). Even though the default code segment can be changed many times over the course of the agent process/thread lifetime, its default code segment is only read when creating this process.

Parameters:
id - The AgentID of the agent to set the default code segment.
code - The description of the default code segment to set.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentContainerException - If the default code segment cannot be set (e.g. when such a segment does not yet exist in the agent container for this agent).

wait_for_agent

AgentArchive wait_for_agent(AgentID id,
                            boolean pickup)
                            throws AgentIDUnknownException,
                                   AgentContainerException
Method to collect agent contents after an agent is done on this host.

The contents of the agent can be returned by this method once an agent stopped running on this host. This is only possible if the host where the agent was residing on did not migrate the agent to another host. Otherwise, this method will have to be called on the host manager where the agent migrated to.

Parameters:
id - The AgentID of the agent to collect.
pickup - If true then returns the exported Agent once it is done, otherwise it will just return null once the agent finished.
Returns:
An AgentArchive containing segments that were in the agent container of the agent at the moment it was killed.
Throws:
AgentIDUnknownException - The agent is not known on this host. This can also mean that the agent migrated to another host. In this case, a lookup of the host address of the new agent location will have to be done, and this method will have to be called again on this new host.
AgentContainerException - Problem reading data from the agent container.

export_agent

AgentArchive export_agent(AgentID id)
                          throws AgentIDUnknownException,
                                 AgentContainerException
Export agent container.

Throws:
AgentIDUnknownException
AgentContainerException
See Also:
AgentScapeApi.exportAgent(org.iids.aos.systemservices.communicator.structs.AgentHandle)

put_message

void put_message(Envelope message,
                 boolean canForward)
                 throws MessageException
Put a message in the message queue for an agent.

If the destination agent is present on the host manager where this method is called on, it is appended to the message queue of this agent. Otherwise the message is sent to the appropriate message queue of the receiver.

Parameters:
message - The contents and address info (from/to handles) of the message.
canForward - If the agent is not running on the host manager this method is called on, then the host manager will try to forward the message to a remote host. In order to prevent endless loops whenever an agent cannot be found (even though it is listed in the lookup service) the host only attempts to forward the message if the value of this parameter is true.
Throws:
MessageException - If sending an array of messages fails. The MessageException contains the index of the message that fails and the real exception as the cause. All messages after the exception has occurred will not have been sent; the ones before have been sent.

put_messages

void put_messages(java.util.List<Envelope> messages,
                  boolean canForward)
                  throws MessageException
Throws:
MessageException

get_message

Envelope get_message(AgentID id,
                     java.util.Collection<AgentHandle> handles,
                     boolean block)
                     throws AgentUnknownException,
                            AgentIDUnknownException
Get a single pending message for an agent.

Pickup any message sent to this agent.

TODO: possibly add a select on agent handle, so that a receive on a single handle will not receive messages that are sent to another handle (even though that handle belongs to the same agent)

Parameters:
id - The agent to pickup messages for.
block - If there are no messages, wait until one arrives if the value of this parameter is true.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentUnknownException - If any of the handles is unknown

get_messages

java.util.List<Envelope> get_messages(AgentID id,
                                      java.util.Collection<AgentHandle> handles,
                                      boolean block)
                                      throws AgentUnknownException,
                                             AgentIDUnknownException
Gat all pending messages for an agent.

Same as get_message(org.iids.aos.systemservices.communicator.structs.AgentID, java.util.Collection, boolean), except that if there are multiple messages available, they are all returned.

TODO: possibly add a select on agent handle, so that a receive on a single handle will not receive messages that are sent to another handle (even though that handle belongs to the same agent)

Parameters:
id - The agent to pickup messages for.
block - If there are no messages, wait until one arrives if the value of this parameter is true.
Throws:
AgentIDUnknownException - If the agent is not known on this host.
AgentUnknownException - If any of the handles is unknown.

get_service_id_list

java.util.Map<AgentScapeID,SystemServiceInfo> get_service_id_list()


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.