com.googlecode.mobilityrpc.protocol.pojo
Enum ExecutionMode
java.lang.Object
java.lang.Enum<ExecutionMode>
com.googlecode.mobilityrpc.protocol.pojo.ExecutionMode
- All Implemented Interfaces:
- Serializable, Comparable<ExecutionMode>
public enum ExecutionMode
- extends Enum<ExecutionMode>
- Author:
- Niall Gallagher
|
Enum Constant Summary |
FIRE_AND_FORGET
A mode of execution in which the local application will not wait for the remote machine to return a response,
and the remote machine will not send a response. |
RETURN_RESPONSE
A mode of execution in which the local application will wait for the remote machine to return a response. |
|
Method Summary |
static ExecutionMode |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static ExecutionMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
RETURN_RESPONSE
public static final ExecutionMode RETURN_RESPONSE
- A mode of execution in which the local application will wait for the remote machine to return a response.
- The
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 machine
- In the case of
Runnable objects, the run() method does not return anything, but the
method could still throw an exception on the remote machine. So in this mode the remote machine will
return a success message if no exception occurred, and will return the exception if an exception
occurred
- In the case of
Callable objects, the call() method returns an object, but the
method could alternatively throw an exception on the remote machine, and so similarly, the remote machine
will return the object returned by the call() method, or will return the exception if an
exception occurred
- If an exception occurs on the remote machine, it will be returned to the local machine and the
the
execute method on the local machine will re-throw it
FIRE_AND_FORGET
public static final ExecutionMode FIRE_AND_FORGET
- A mode of execution in which the local application will not wait for the remote machine to return a response,
and the remote machine will not send a response.
- The
execute method on the local machine will queue the object for sending to the remote
machine and will then return immediately
- In the case of
Runnable objects, a best-effort attempt will be made to transfer the object
and invoke run() on the remote machine, but if the operation fails at any point the local
application will never be informed
- In the case of
Callable objects, a best-effort attempt will similarly be made, and the
execute method on the local machine will return null to the local application regardless
of what the call() method actually returns on the remote machine
- The local machine will inform the remote machine that no response is required, and so the remote
machine will never send one, avoiding a network round-trip
- This can be useful in asynchronous applications or where the relevant operation is non-critical or
long-running
values
public static ExecutionMode[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (ExecutionMode c : ExecutionMode.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static ExecutionMode valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name - the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is null
Copyright © 2012. All Rights Reserved.