All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.ibm.aglet.AgletProxy

public interface AgletProxy
AgletProxy interface is a placeholder for aglets. The purpose of this interface is to provide a mechanism to control and limit direct access to aglets.


Method Index

 o activate()
Activates the aglet.
 o clone()
Clones the aglet and its proxy.
 o deactivate(long)
Deactivates the aglet.
 o delegateMessage(Message)
Delegates a message to the aglet.
 o dispatch(URL)
Dispatches the aglet to the location specified by the argument address.
 o dispose()
Disposes the aglet.
 o getAglet()
Gets the aglet that the proxy manages.
 o getAgletClassName()
Gets the aglet's class name.
 o getAgletID()
Gets the aglet's id.
 o getAgletInfo()
Gets the AgletInfo object of the aglet.
 o isActive()
Checks if the aglet is active or deactivated.
 o isRemote()
Checks if the aglet proxy is referencing a remote aglet.
 o isState(int)
Checks if the aglet is in the state give by type.
 o isValid()
Checks if the aglet proxy is invalid or not.
 o sendAsyncMessage(Message)
Sends a message in asynchronous way.
 o sendFutureMessage(Message)
Sends a future message to the aglet.
 o sendMessage(Message)
Sends a message in synchronous way.
 o sendOnewayMessage(Message)
Sends a oneway message to the aglet.

Methods

 o getAglet
 public abstract Aglet getAglet() throws InvalidAgletException
Gets the aglet that the proxy manages.

Returns:
the aglet
Throws: InvalidAgletException
if the aglet is not valid.
Throws: SecurityException
if you are not allowed to access the aglet.
 o getAgletID
 public abstract AgletID getAgletID() throws InvalidAgletException
Gets the aglet's id.

Returns:
the aglet's id
Throws: InvalidAgletException
if the aglet is not valid.
 o getAgletClassName
 public abstract String getAgletClassName() throws InvalidAgletException
Gets the aglet's class name.

Returns:
the class name.
Throws: InvalidAgletException
if the aglet is not valid.
 o getAgletInfo
 public abstract AgletInfo getAgletInfo() throws InvalidAgletException
Gets the AgletInfo object of the aglet.

Returns:
the AgletInfo object
Throws: InvalidAgletException
if the aglet is not valid.
See Also:
AgletInfo
 o clone
 public abstract Object clone() throws CloneNotSupportedException
Clones the aglet and its proxy. Note that the cloned aglet will get activated. If you like to get cloned aglet which is not activated, throw ThreadDeath exception in the onClone method.

Returns:
the new aglet proxy what holds cloned aglet.
Throws: CloneNotSupportedException
if the cloning fails.
Throws: InvalidAgletException
if the aglet is invalid.
Overrides:
clone in class Object
 o dispatch
 public abstract AgletProxy dispatch(URL address) throws IOException, AgletException
Dispatches the aglet to the location specified by the argument address.

Parameters:
address - the address of the destination context.
Returns:
the AgletProxy of the dispatched (remote) aglet.
Throws: ServerNotFoundException
if the server
Throws: UnknownHostException
if the host given in the URL doesn't exist.
Throws: MalformedURLException
if the given url dosn't specify the host.
Throws: RequestRefusedException
if the remote server refused the dispatch request.
Throws: InvalidAgletException
if the aglet is not valid.
 o dispose
 public abstract void dispose() throws InvalidAgletException
Disposes the aglet.

Throws: InvalidAgletException
if the aglet is invalid.
 o deactivate
 public abstract void deactivate(long duration) throws IOException, InvalidAgletException
Deactivates the aglet. The system may store the aglet in the spool (disk or memory depending on the server). The aglet will be re-activated later (at the given time or manually).

Parameters:
duration - duration of the aglet deactivating in milliseconds. If this is 0, it will be activeted at the next startup time.
Throws: InvalidAgletException
if the aglet is not valid.
Throws: IllegalArgumentException
if the minutes parameter is negative.
 o activate
 public abstract void activate() throws IOException, AgletException
Activates the aglet. This is a forced activation of a deactivated aglet.

Throws: IOException
if the activation failed.
Throws: InvalidAgletException
if the aglet is not valid.
 o sendMessage
 public abstract Object sendMessage(Message msg) throws InvalidAgletException, NotHandledException, MessageException
Sends a message in synchronous way. This waits for finishing the message handing.

Parameters:
msg - a message to send.
Returns:
the result object if any. null if not.
Throws: InvalidAgletException
if the aglet is not valid any longer.
Throws: NotHandledException
if the aglet didn't handle the the message.
Throws: MessageException
a exception which the handleMessage method raised.
 o sendAsyncMessage
 public abstract FutureReply sendAsyncMessage(Message msg) throws InvalidAgletException
Sends a message in asynchronous way.

Parameters:
msg - a message to send.
Returns:
a future object that will give you the reply of the message.
Throws: InvalidAgletException
if the aglet is not valid any longer.
 o sendFutureMessage
 public abstract FutureReply sendFutureMessage(Message msg) throws InvalidAgletException
Sends a future message to the aglet. The invocation will

Parameters:
msg - a message to send.
Returns:
a future object that will give you the reply of the message.
Throws: InvalidAgletException
if the aglet is not valid any longer.
 o sendOnewayMessage
 public abstract void sendOnewayMessage(Message msg) throws InvalidAgletException
Sends a oneway message to the aglet. No acknowledgement will be sent back to the sender.

Parameters:
msg - a message to send.
Throws: InvalidAgletException
if the aglet is not valid any longer.
 o delegateMessage
 public abstract void delegateMessage(Message msg) throws InvalidAgletException
Delegates a message to the aglet. The message needs to be a message passed as an argument to Aglet#handleMessage. The delegated message is sent to the receiver and will be handled in the Aglet#handleMessage(Message) method.

Parameters:
msg - a message to delegate
Throws: InvalidAgletException
if the aglet proxy is not valid.
See Also:
handleMessage
 o isActive
 public abstract boolean isActive() throws InvalidAgletException
Checks if the aglet is active or deactivated.

Returns:
true if the aglet is active.
Throws: InvalidAgletException
if the aglet is not valid.
 o isValid
 public abstract boolean isValid()
Checks if the aglet proxy is invalid or not. The aglet proxy become invalid in the following way.
  1. The aglet is disposed.
  2. The aglet is dispatched.
If the aglet is deactivated, it become INACTIVE.

Returns:
true if the aglet proxy is valid. false if not.
 o isRemote
 public abstract boolean isRemote()
Checks if the aglet proxy is referencing a remote aglet.

Returns:
true if the aglet resides at the remote site.
 o isState
 public abstract boolean isState(int type)
Checks if the aglet is in the state give by type.

Parameters:
type - an integer value specifying the aglet's state
Returns:
true if the aglet is in the same state as the type give as an argument.
See Also:
ACTIVE, INACTIVE

All Packages  Class Hierarchy  This Package  Previous  Next  Index