Interface aglet.AgletProxy
All Packages Class Hierarchy This Package Previous Next Index
Interface aglet.AgletProxy
- public interface AgletProxy
- extends Object
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.
-
activate()
- Activates the aglet.
-
clone()
- Clones the aglet and its proxy.
-
deactivate(long)
- Deactivates the aglet.
-
delegateMessage(Message)
- Delegates a message to the aglet
-
dispatch(URL)
-
-
dispose()
- Disposes the aglet.
-
getAglet()
- Gets the aglet that the proxy manages.
-
getAgletClassName()
- Gets the aglet's class name.
-
getAgletID()
- Gets the aglet's id
-
getAgletInfo()
-
-
getCodeBase()
- Gets the codebase of the aglet in URL
-
getIdentifier()
- Gets the aglet's identifier.
-
isActive()
- Checks if the aglet is active or deactivated.
-
isRemote()
- Checks if the aglet proxy is referencing a remote aglet.
-
isState(int)
- Checks if the aglet
-
isValid()
- Checks if the aglet proxy is invalidated or not.
-
sendAsyncMessage(Message)
- Sends a message in asynchronous way.
-
sendMessage(Message)
- Sends a message in synchronous way.
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.
getIdentifier
public abstract AgletIdentifier getIdentifier() throws InvalidAgletException
- Gets the aglet's identifier.
- Returns:
- the aglet's identifier.
- Throws: InvalidAgletException
- if the aglet is not valid.
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.
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.
getAgletInfo
public abstract AgletInfo getAgletInfo() throws InvalidAgletException
getCodeBase
public abstract URL getCodeBase() throws InvalidAgletException
- Gets the codebase of the aglet in URL
- Returns:
- the class URL.
- Throws: InvalidAgletException
- if the aglet is not valid.
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
dispatch
public abstract AgletProxy dispatch(URL url) throws IOException, AgletException
dispose
public abstract void dispose() throws InvalidAgletException
- Disposes the aglet.
- Throws: InvalidAgletException
- if the aglet is invalid.
deactivate
public abstract void deactivate(long millisecounds) 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:
- millisecounds - duration of the aglet deactivating.
- Throws: InvalidAgletException
- if the aglet is not valid.
- Throws: IllegalArgumentException
- if the minutes parameter is negative.
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.
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.
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.
delegateMessage
public abstract void delegateMessage(Message msg) throws InvalidAgletException
- Delegates a message to the aglet
- Parameters:
- msg - a message to delegate
- Throws: InvalidAgletException
- if the aglet proxy is not valid.
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.
isValid
public abstract boolean isValid()
- Checks if the aglet proxy is invalidated or not.
- Returns:
- true if the aglet proxy is valid. false if not.
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
isState
public abstract boolean isState(int type)
- Checks if the aglet
- See Also:
- ACTIVE, INACTIVE
All Packages Class Hierarchy This Package Previous Next Index