|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MobilitySession
A gateway through which the application can send objects to remote machines.
Sessions can be created or accessed viaMobilityController.getSession(java.util.UUID).
Sessions provide the following methods for sending objects to remote machines:
void execute(String, Runnable) or void execute(ConnectionId, Runnable) or void execute(ConnectionId, ExecutionMode, Runnable)
Runnable object, and any objects it references, to the given
remote machine, and executes it (calls the Runnable.run() method) on the remote machinerun() method can call methods on on any referenced objects sent with it,
or any methods in the remote applicationvoid return types
or where the local application is not interested in returning any data from the remote machineT execute(String, Callable<T>) orT execute(ConnectionId, Callable<T>) orT execute(ConnectionId, ExecutionMode, Callable<T>)
Callable object, and any objects it references, to the given
remote machine, and executes it (calls the Callable.call() method) on the remote machinecall() method can in turn call methods on on any referenced objects sent with it,
or any methods in the remote applicationcall() method returns an object, and the local application can implement call to
fetch an object from the remote machine. Alternatively, it could implement this to return the same
Callable (the Boomerang pattern), or a referenced object which was sent alongside the Callable back
again to local applicationConnectionId
ExecutionMode
RETURN_RESPONSE and FIRE_AND_FORGET, respectively
ExecutionMode.RETURN_RESPONSE is specified
execute method on the local machine will block (wait) until the entire
operation has been performed on the remote machine (run() or
call() invoked), and the remote machine has returned a confirmation of the
outcome of the operation to the local machineExecutionMode.FIRE_AND_FORGET is specified
execute method on the local machine will queue the object for sending
to the remote machine and will then return immediately
| Method Summary | ||
|---|---|---|
|
execute(ConnectionId connectionId,
Callable<T> callable)
Transfers the given Callable object, and any objects it references, to the given remote machine,
and executes it (calls the Callable.call() method) on the remote machine. |
|
|
execute(ConnectionId connectionId,
ExecutionMode executionMode,
Callable<T> callable)
Transfers the given Callable object, and any objects it references, to the given remote machine,
and executes it (calls the Callable.call() method) on the remote machine. |
|
void |
execute(ConnectionId connectionId,
ExecutionMode executionMode,
Runnable runnable)
Transfers the given Runnable object, and any objects it references, to the given remote machine,
and executes it (calls the Runnable.run() method) on the remote machine. |
|
void |
execute(ConnectionId connectionId,
Runnable runnable)
Transfers the given Runnable object, and any objects it references, to the given remote machine,
and executes it (calls the Runnable.run() method) on the remote machine. |
|
|
execute(String address,
Callable<T> callable)
Transfers the given Callable object, and any objects it references, to the given remote machine,
and executes it (calls the Callable.call() method) on the remote machine. |
|
void |
execute(String address,
Runnable runnable)
Transfers the given Runnable object, and any objects it references, to the given remote machine,
and executes it (calls the Runnable.run() method) on the remote machine. |
|
MobilityController |
getMobilityController()
Returns the mobility controller which manages this session. |
|
SessionClassLoader |
getSessionClassLoader()
Returns the class loader associated with this session. |
|
UUID |
getSessionId()
Returns the UUID of this session. |
|
void |
release()
Removes this session from the mobility controller. |
|
| Method Detail |
|---|
UUID getSessionId()
void execute(String address,
Runnable runnable)
Runnable object, and any objects it references, to the given remote machine,
and executes it (calls the Runnable.run() method) on the remote machine.
This is a convenience method for calling execute(ConnectionId, ExecutionMode, Runnable)
with ExecutionMode.RETURN_RESPONSE and default port 5739 in the connection id.
address - The address (ip or name) of the remote machinerunnable - The object to send and execute on the remote machine
void execute(ConnectionId connectionId,
Runnable runnable)
Runnable object, and any objects it references, to the given remote machine,
and executes it (calls the Runnable.run() method) on the remote machine.
This is a convenience method for calling execute(ConnectionId, ExecutionMode, Runnable)
with ExecutionMode.RETURN_RESPONSE.
connectionId - The address/port of the remote machinerunnable - The object to send and execute on the remote machine
void execute(ConnectionId connectionId,
ExecutionMode executionMode,
Runnable runnable)
Runnable object, and any objects it references, to the given remote machine,
and executes it (calls the Runnable.run() method) on the remote machine.
connectionId - The address/port of the remote machineexecutionMode - Either of the following, see: ExecutionMode.RETURN_RESPONSE or
ExecutionMode.FIRE_AND_FORGETrunnable - The object to send to the remote machine
<T> T execute(String address,
Callable<T> callable)
Callable object, and any objects it references, to the given remote machine,
and executes it (calls the Callable.call() method) on the remote machine. Transfers the object returned
by the call method on the remote machine, and any objects it references, back to the local
application.
This is a convenience method for calling execute(ConnectionId, ExecutionMode, Runnable)
with ExecutionMode.RETURN_RESPONSE and default port 5739 in the connection id.
address - The address (ip or name) of the remote machinecallable - The object to send to the remote machine
Callable.call() method on the remote machine (transferred back to
this machine)
<T> T execute(ConnectionId connectionId,
Callable<T> callable)
Callable object, and any objects it references, to the given remote machine,
and executes it (calls the Callable.call() method) on the remote machine. Transfers the object returned
by the call method on the remote machine, and any objects it references, back to the local
application.
This is a convenience method for calling execute(ConnectionId, ExecutionMode, Runnable)
with ExecutionMode.RETURN_RESPONSE.
connectionId - The address/port of the remote machinecallable - The object to send to the remote machine
Callable.call() method on the remote machine (transferred back to
this machine)
<T> T execute(ConnectionId connectionId,
ExecutionMode executionMode,
Callable<T> callable)
Callable object, and any objects it references, to the given remote machine,
and executes it (calls the Callable.call() method) on the remote machine. Transfers the object returned
by the call method on the remote machine, and any objects it references, back to the local
application.
connectionId - The address/port of the remote machineexecutionMode - Either of the following, see: ExecutionMode.RETURN_RESPONSE or
ExecutionMode.FIRE_AND_FORGETcallable - The object to send to the remote machine
Callable.call() method on the remote machine (transferred back to
this machine)SessionClassLoader getSessionClassLoader()
MobilityController getMobilityController()
void release()
MobilityController.releaseSession(java.util.UUID),
which bypasses this safeguard, and allows sessions to be released immediately.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||