Voyager ORB

com.objectspace.voyager.agent
Interface IAgent


public abstract interface IAgent
extends IMobility

IAgent is an object's agent facet that can be obtained via Agent.of().


Method Summary
 java.lang.String getHome()
          Return the home of this agent, which is defined to be the URL of the agent when its agent facet was first accessed.
 IResourceLoader getResourceLoader()
          Returns the registered IResourceLoader implementation.
 boolean isAutonomous()
          Return true if this agent is autonomous.
 void moveTo(java.lang.Object destination, java.lang.String callback)
          Move to the program containing the specified object and then restart by executing a oneway callback with a proxy to the object as the first argument.
 void moveTo(java.lang.Object destination, java.lang.String callback, java.lang.Object[] args)
          Move to the program containing the specified object and then restart by executing a oneway callback with a proxy to the object as the first argument and the args as the remaining arguments.
 void moveTo(java.lang.String destination, java.lang.String callback)
          Move to the program with the specified URL and then restart by executing a oneway callback.
 void moveTo(java.lang.String destination, java.lang.String callback, java.lang.Object[] args)
          Move to the program with the specified URL and then restart by executing a oneway callback with the args as parameters.
 void setAutonomous(boolean flag)
          If the flag is true, become autonomous.
 void setResourceLoader(IResourceLoader resourceLoader)
          Sets the IResourceLoader implementation this agent should register with remote hosts it may visit.
 
Methods inherited from interface com.objectspace.voyager.mobility.IMobility
moveTo, moveTo
 

Method Detail

moveTo

public void moveTo(java.lang.String destination,
                   java.lang.String callback)
            throws MobilityException
Move to the program with the specified URL and then restart by executing a oneway callback. A MobilityException is thrown if the callback method is not found or is not public.
Parameters:
destination - The address of the VM to which I am moving.
callback - The name of the method to be invoked upon arrival.
Throws:
MobilityException - A Voyager-related exception occurred during the move.

moveTo

public void moveTo(java.lang.String destination,
                   java.lang.String callback,
                   java.lang.Object[] args)
            throws MobilityException
Move to the program with the specified URL and then restart by executing a oneway callback with the args as parameters. A MobilityException is thrown if the callback method is not found or is not public.
Parameters:
destination - The address of the VM to which I am moving.
callback - The name of the method to be invoked upon arrival.
args - An array of additional arguments to be used in the callback.
Throws:
MobilityException - A Voyager-related exception occurred during the move.

moveTo

public void moveTo(java.lang.Object destination,
                   java.lang.String callback)
            throws MobilityException
Move to the program containing the specified object and then restart by executing a oneway callback with a proxy to the object as the first argument. A MobilityException is thrown if the callback method is not found or is not public.
Parameters:
destination - The object to which I am moving.
callback - The name of the method to be invoked upon arrival.
Throws:
MobilityException - A Voyager-related exception occurred during the move.

moveTo

public void moveTo(java.lang.Object destination,
                   java.lang.String callback,
                   java.lang.Object[] args)
            throws MobilityException
Move to the program containing the specified object and then restart by executing a oneway callback with a proxy to the object as the first argument and the args as the remaining arguments. A MobilityException is thrown if the callback method is not found or is not public.
Parameters:
destination - The object to which I am moving.
callback - The name of the method to be invoked upon arrival.
args - An array of additional arguments to be used in the callback.
Throws:
MobilityException - A Voyager-related exception occurred during the move.

setAutonomous

public void setAutonomous(boolean flag)
If the flag is true, become autonomous. An autonomous agent is not reclaimed by the garbage collector even if there are no more local or remote references to it. An agent is initially autonomous by default, and typically executes setAutonomous( false ) when it has achieved its goal and wishes to be garbage collected.

isAutonomous

public boolean isAutonomous()
Return true if this agent is autonomous.

getHome

public java.lang.String getHome()
Return the home of this agent, which is defined to be the URL of the agent when its agent facet was first accessed.

setResourceLoader

public void setResourceLoader(IResourceLoader resourceLoader)
Sets the IResourceLoader implementation this agent should register with remote hosts it may visit.
Parameters:
resourceLoader - The IResourceLoader implementation to use.
See Also:
VoyagerClassLoader

getResourceLoader

public IResourceLoader getResourceLoader()
Returns the registered IResourceLoader implementation.
Returns:
The IResourceLoader implementation used.
See Also:
VoyagerClassLoader

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240