org.objectweb.mobilitools.smi
Class MAFAgentSystem_impl

org.objectweb.mobilitools.smi.MAFAgentSystem_impl
All Implemented Interfaces:
org.objectweb.mobilitools.smi.idl.MAFAgentSystemComplementOperations, org.omg.CfMAF.MAFAgentSystemOperations

public class MAFAgentSystem_impl
implements org.omg.CfMAF.MAFAgentSystemOperations, org.objectweb.mobilitools.smi.idl.MAFAgentSystemComplementOperations

MobiliTools $Name: $, $Id: MAFAgentSystem_impl.java,v 1.1.1.1 2003/03/28 14:48:05 dillense Exp $

Implementation of MAF's MAFAgentSystem interface (always bound to an Agency instance).

See Also:
Agency

Constructor Summary
MAFAgentSystem_impl(Agency agency)
          Creates a new implementation of the MAFAgentSystem MAF interface.
MAFAgentSystem_impl(Agency agency, boolean traceOn)
          Creates Creates a new implementation of the MAFAgentSystem MAF interface.
 
Method Summary
 org.omg.CfMAF.Name create_agent(org.omg.CfMAF.Name agent_name, org.omg.CfMAF.AgentProfile agent_profile, byte[] agent, java.lang.String place_name, byte[] arguments, org.omg.CfMAF.ClassName[] class_names, java.lang.String code_base, org.omg.CfMAF.MAFAgentSystem class_provider)
          Creates an agent.
 byte[][] fetch_class(org.omg.CfMAF.ClassName[] class_name_list, java.lang.String code_base, org.omg.CfMAF.AgentProfile agent_profile)
          Returns code for requested classes.
 java.lang.String find_nearby_agent_system_of_profile(org.omg.CfMAF.AgentProfile agent_profile)
          Not implemented.
 org.omg.CfMAF.AgentStatus get_agent_status(org.omg.CfMAF.Name agent_name)
           
 org.omg.CfMAF.AgentSystemInfo get_agent_system_info()
           
 org.omg.CfMAF.AuthInfo get_authinfo(org.omg.CfMAF.Name agent_name)
          Not implemented.
 org.omg.CfMAF.MAFFinder get_MAFFinder()
           
 org.omg.CfMAF.Name[] list_agents(org.omg.CfMAF.AgentProfile profile)
           
 org.omg.CfMAF.Name[] list_all_agents_of_authority(byte[] authority)
           
 org.omg.CfMAF.Name[] list_all_agents()
           
 java.lang.String[] list_all_places()
          Not implemented.
 void move_agent(org.omg.CfMAF.Name name, java.lang.String destination, java.lang.String place)
           
 void receive_agent(org.omg.CfMAF.Name agent_name, org.omg.CfMAF.AgentProfile agent_profile, byte[] agent, java.lang.String place_name, org.omg.CfMAF.ClassName[] class_names, java.lang.String code_base, org.omg.CfMAF.MAFAgentSystem sender)
          Receives a migrating agent.
 void resume_agent(org.omg.CfMAF.Name agent_name)
          Resumes the activity of an agent.
 void suspend_agent(org.omg.CfMAF.Name agent_name)
          Suspends the activity of an agent.
 void terminate_agent_system()
          Terminates the agency.
 void terminate_agent(org.omg.CfMAF.Name agent_name)
          Terminates an agent.
 

Constructor Detail

MAFAgentSystem_impl

public MAFAgentSystem_impl(Agency agency)
Creates a new implementation of the MAFAgentSystem MAF interface. Every invocation is (more or less directly) delegated to a SMI agency.
Parameters:
agency - the bound Agency instance.

MAFAgentSystem_impl

public MAFAgentSystem_impl(Agency agency,
                           boolean traceOn)
Creates Creates a new implementation of the MAFAgentSystem MAF interface. Every invocation is (more or less directly) delegated to a SMI agency.
Parameters:
agency - the bound Agency instance.
traceOn - must be true to switch call trace on
Method Detail

create_agent

public org.omg.CfMAF.Name create_agent(org.omg.CfMAF.Name agent_name,
                                       org.omg.CfMAF.AgentProfile agent_profile,
                                       byte[] agent,
                                       java.lang.String place_name,
                                       byte[] arguments,
                                       org.omg.CfMAF.ClassName[] class_names,
                                       java.lang.String code_base,
                                       org.omg.CfMAF.MAFAgentSystem class_provider)
                                throws org.omg.CfMAF.ClassUnknown,
                                       org.omg.CfMAF.ArgumentInvalid,
                                       org.omg.CfMAF.DeserializationFailed,
                                       org.omg.CfMAF.MAFExtendedException
Creates an agent.
Specified by:
create_agent in interface org.omg.CfMAF.MAFAgentSystemOperations

fetch_class

public byte[][] fetch_class(org.omg.CfMAF.ClassName[] class_name_list,
                            java.lang.String code_base,
                            org.omg.CfMAF.AgentProfile agent_profile)
                     throws org.omg.CfMAF.ClassUnknown,
                            org.omg.CfMAF.MAFExtendedException
Returns code for requested classes.
Specified by:
fetch_class in interface org.omg.CfMAF.MAFAgentSystemOperations

find_nearby_agent_system_of_profile

public java.lang.String find_nearby_agent_system_of_profile(org.omg.CfMAF.AgentProfile agent_profile)
                                                     throws org.omg.CfMAF.EntryNotFound,
                                                            org.omg.CORBA.NO_IMPLEMENT
Not implemented.
Specified by:
find_nearby_agent_system_of_profile in interface org.omg.CfMAF.MAFAgentSystemOperations

get_agent_status

public org.omg.CfMAF.AgentStatus get_agent_status(org.omg.CfMAF.Name agent_name)
                                           throws org.omg.CfMAF.AgentNotFound
Specified by:
get_agent_status in interface org.omg.CfMAF.MAFAgentSystemOperations
Returns:
the activity status of an agent, i.e. running or suspended. Note that the CfMAFTerminated status is never returned (the exception AgentNotFound would be thrown is case of a terminated agent).
Throws:
org.omg.CfMAF.AgentNotFound - if the agent name does not exist.

get_agent_system_info

public org.omg.CfMAF.AgentSystemInfo get_agent_system_info()
Specified by:
get_agent_system_info in interface org.omg.CfMAF.MAFAgentSystemOperations
Returns:
a information record about the agency.

get_authinfo

public org.omg.CfMAF.AuthInfo get_authinfo(org.omg.CfMAF.Name agent_name)
                                    throws org.omg.CfMAF.AgentNotFound,
                                           org.omg.CORBA.NO_IMPLEMENT
Not implemented.
Specified by:
get_authinfo in interface org.omg.CfMAF.MAFAgentSystemOperations

get_MAFFinder

public org.omg.CfMAF.MAFFinder get_MAFFinder()
                                      throws org.omg.CfMAF.FinderNotFound
Specified by:
get_MAFFinder in interface org.omg.CfMAF.MAFAgentSystemOperations
Returns:
the CORBA object reference to the MAFFinder.
Throws:
org.omg.CfMAF.FinderNotFound - current agency is running without MAFFinder support.

list_all_agents

public org.omg.CfMAF.Name[] list_all_agents()
Specified by:
list_all_agents in interface org.omg.CfMAF.MAFAgentSystemOperations
Returns:
the list of all agents residing in the associated agency.

list_all_agents_of_authority

public org.omg.CfMAF.Name[] list_all_agents_of_authority(byte[] authority)
Specified by:
list_all_agents_of_authority in interface org.omg.CfMAF.MAFAgentSystemOperations
Returns:
an array of agent names with given authority.

list_all_places

public java.lang.String[] list_all_places()
                                   throws org.omg.CORBA.NO_IMPLEMENT
Not implemented.
Specified by:
list_all_places in interface org.omg.CfMAF.MAFAgentSystemOperations

receive_agent

public void receive_agent(org.omg.CfMAF.Name agent_name,
                          org.omg.CfMAF.AgentProfile agent_profile,
                          byte[] agent,
                          java.lang.String place_name,
                          org.omg.CfMAF.ClassName[] class_names,
                          java.lang.String code_base,
                          org.omg.CfMAF.MAFAgentSystem sender)
                   throws org.omg.CfMAF.ClassUnknown,
                          org.omg.CfMAF.DeserializationFailed,
                          org.omg.CfMAF.MAFExtendedException
Receives a migrating agent.
Specified by:
receive_agent in interface org.omg.CfMAF.MAFAgentSystemOperations

resume_agent

public void resume_agent(org.omg.CfMAF.Name agent_name)
                  throws org.omg.CfMAF.AgentNotFound,
                         org.omg.CfMAF.ResumeFailed,
                         org.omg.CfMAF.AgentIsRunning
Resumes the activity of an agent.
Specified by:
resume_agent in interface org.omg.CfMAF.MAFAgentSystemOperations

suspend_agent

public void suspend_agent(org.omg.CfMAF.Name agent_name)
                   throws org.omg.CfMAF.AgentNotFound,
                          org.omg.CfMAF.SuspendFailed,
                          org.omg.CfMAF.AgentIsSuspended
Suspends the activity of an agent.
Specified by:
suspend_agent in interface org.omg.CfMAF.MAFAgentSystemOperations

terminate_agent

public void terminate_agent(org.omg.CfMAF.Name agent_name)
                     throws org.omg.CfMAF.AgentNotFound,
                            org.omg.CfMAF.TerminateFailed
Terminates an agent.
Specified by:
terminate_agent in interface org.omg.CfMAF.MAFAgentSystemOperations

terminate_agent_system

public void terminate_agent_system()
                            throws org.omg.CfMAF.TerminateFailed
Terminates the agency.
Specified by:
terminate_agent_system in interface org.omg.CfMAF.MAFAgentSystemOperations

list_agents

public org.omg.CfMAF.Name[] list_agents(org.omg.CfMAF.AgentProfile profile)
Specified by:
list_agents in interface org.objectweb.mobilitools.smi.idl.MAFAgentSystemComplementOperations

move_agent

public void move_agent(org.omg.CfMAF.Name name,
                       java.lang.String destination,
                       java.lang.String place)
                throws org.omg.CfMAF.AgentNotFound,
                       org.omg.CfMAF.ClassUnknown,
                       org.omg.CfMAF.DeserializationFailed,
                       org.objectweb.mobilitools.smi.idl.AgentSystemNotFound,
                       org.omg.CfMAF.ArgumentInvalid,
                       org.objectweb.mobilitools.smi.idl.AgentRefusedToMove,
                       org.omg.CfMAF.MAFExtendedException
Specified by:
move_agent in interface org.objectweb.mobilitools.smi.idl.MAFAgentSystemComplementOperations