|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
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 Summary | |
void |
activate()
Activates the aglet. |
java.lang.Object |
clone()
Clones the aglet and its proxy. |
void |
deactivate(long duration)
Deactivates the aglet. |
void |
delegateMessage(Message msg)
Delegates a message to the aglet. |
AgletProxy |
dispatch(Ticket ticket)
Dispatches the aglet to the location specified by the ticket as the argument. |
AgletProxy |
dispatch(java.net.URL address)
Dispatches the aglet to the location specified by the argument address. |
void |
dispose()
Disposes the aglet. |
java.lang.String |
getAddress()
Gets the current address of the target aglet. |
Aglet |
getAglet()
Gets the aglet that the proxy manages. |
java.lang.String |
getAgletClassName()
Gets the aglet's class name. |
AgletID |
getAgletID()
Gets the aglet's id. |
AgletInfo |
getAgletInfo()
Gets the AgletInfo object of the aglet. |
boolean |
isActive()
Checks if the aglet is active or deactivated. |
boolean |
isRemote()
Checks if the aglet proxy is referencing a remote aglet. |
boolean |
isState(int type)
Checks if the aglet is in the state give by type. |
boolean |
isValid()
Checks if the aglet proxy is invalid or not. |
FutureReply |
sendAsyncMessage(Message msg)
Sends a message in asynchronous way. |
FutureReply |
sendFutureMessage(Message msg)
Sends a future message to the aglet. |
java.lang.Object |
sendMessage(Message msg)
Sends a message in synchronous way. |
void |
sendOnewayMessage(Message msg)
Sends a oneway message to the aglet. |
void |
suspend(long duration)
This is an experimental feature. |
| Method Detail |
public void activate()
throws java.io.IOException,
AgletException
java.io.IOException - if the activation failed.
AgletException - if the aglet is not valid.
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException - if the cloning fails.
InvalidAgletException - if the aglet is invalid.
public void deactivate(long duration)
throws java.io.IOException,
InvalidAgletException
duration - duration of the aglet deactivating in milliseconds.
If this is 0, it will be activeted at the next startup time.
InvalidAgletException - if the aglet is not valid.
java.lang.IllegalArgumentException - if the minutes parameter is negative.
java.io.IOException
public void delegateMessage(Message msg)
throws InvalidAgletException
msg - a message to delegate
InvalidAgletException - if the aglet proxy is not valid.Aglet.handleMessage(com.ibm.aglet.Message)
public AgletProxy dispatch(Ticket ticket)
throws java.io.IOException,
AgletException
ServerNotFoundException - if the server
UnknownHostException - if the host given in the URL doesn't
exist.
MalformedURLException - if the given url dosn't specify the
host.
RequestRefusedException - if the remote server refused the
dispatch request.
InvalidAgletException - if the aglet is not valid.
java.io.IOException
AgletException
public AgletProxy dispatch(java.net.URL address)
throws java.io.IOException,
AgletException
address - the address of the destination context.
ServerNotFoundException - if the server
UnknownHostException - if the host given in the URL doesn't
exist.
MalformedURLException - if the given url dosn't specify the
host.
RequestRefusedException - if the remote server refused the
dispatch request.
InvalidAgletException - if the aglet is not valid.
java.io.IOException
AgletException
public void dispose()
throws InvalidAgletException
InvalidAgletException - if the aglet is invalid.
public java.lang.String getAddress()
throws InvalidAgletException
InvalidAgletException
public Aglet getAglet()
throws InvalidAgletException
InvalidAgletException - if the aglet is not valid.
java.lang.SecurityException - if you are not allowed to access the aglet.
public java.lang.String getAgletClassName()
throws InvalidAgletException
InvalidAgletException - if the aglet is not valid.
public AgletID getAgletID()
throws InvalidAgletException
InvalidAgletException - if the aglet is not valid.
public AgletInfo getAgletInfo()
throws InvalidAgletException
InvalidAgletException - if the aglet is not valid.AgletInfo
public boolean isActive()
throws InvalidAgletException
InvalidAgletException - if the aglet is not valid.public boolean isRemote()
public boolean isState(int type)
type - an integer value specifying the aglet's state
Aglet.ACTIVE,
Aglet.INACTIVEpublic boolean isValid()
public FutureReply sendAsyncMessage(Message msg)
throws InvalidAgletException
msg - a message to send.
InvalidAgletException - if the aglet is not valid any longer.
public FutureReply sendFutureMessage(Message msg)
throws InvalidAgletException
msg - a message to send.
InvalidAgletException - if the aglet is not valid any longer.
public java.lang.Object sendMessage(Message msg)
throws InvalidAgletException,
NotHandledException,
MessageException
msg - a message to send.
InvalidAgletException - if the aglet is not valid any longer.
NotHandledException - if the aglet didn't handle the
the message.
MessageException - a exception
which the handleMessage method raised.
public void sendOnewayMessage(Message msg)
throws InvalidAgletException
msg - a message to send.
InvalidAgletException - if the aglet is not valid any longer.
public void suspend(long duration)
throws InvalidAgletException
This is almost like deactivate(long duration), but there are some differences.
duration - duration of the aglet deactivating in milliseconds.
If this is 0, it will be activeted at the next startup time.
AgletException - if the aglet cannot be suspended.
java.lang.IllegalArgumentException - if the minutes parameter is negative.
InvalidAgletException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||