Enum Class Dispatch.Type
- All Implemented Interfaces:
Serializable
,Comparable<Dispatch.Type>
,Constable
- Enclosing class:
Dispatch
The dispatch type.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe method is dispatched, returning immediately and deferring the driving of results to a background process Which will call the associatedErrorHandler
andResultHandler
parameters.Deprecated.This behaves similar toSYNCHRONOUS
, except the calling method must return some type ofFuture<?>
.This is a type of method that doesn't exactly fit in the other categories.The method is dispatched, blocking until the method returns or an exception is thrown. -
Method Summary
Modifier and TypeMethodDescriptionstatic Dispatch.Type
Inspects the suppliedMethod
and determines the type of dispatch used.static Dispatch.Type
Returns the enum constant of this class with the specified name.static Dispatch.Type[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SYNCHRONOUS
The method is dispatched, blocking until the method returns or an exception is thrown. This mode is automatically selected if aMethod
returns an object and neitherResultHandler
orErrorHandler
are specified in the parameters. This implies that the return type must be serializable. The invocation will block until the remote end produces a result and returns the value. -
ASYNCHRONOUS
The method is dispatched, returning immediately and deferring the driving of results to a background process Which will call the associatedErrorHandler
andResultHandler
parameters. This mode is automatically selected if aMethod
returns void and has both aResultHandler
andErrorHandler
specified in the parameters. This implies that the return type must be serializable. -
FUTURE
This behaves similar toSYNCHRONOUS
, except the calling method must return some type ofFuture<?>
. The result is obtained throughFuture.get()
, orExecutionException
in the event of a failure. The method may useResultHandler
orErrorHandler
to receive results in addition to the returnedFuture
, and may be independent results. On the client side, eitherResultHandler
orErrorHandler
may be used to receive the result. The client method invocation will not block and instead return an instance ofFuture
which will be used to dispatch the remote invocation. -
HYBRID
This is a type of method that doesn't exactly fit in the other categories. Depending on the context, a method of this type may pick one of the other strategies to do the invocation. Underlying connection details may affect the actual behavior of the method. Usage of this type is discouraged and will generate warnings in logs. -
CONSUMER
Deprecated.Renamed toHYBRID
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
determine
Inspects the suppliedMethod
and determines the type of dispatch used. If not specified, then this method infers the type automatically.- Parameters:
method
-- Returns:
- the
Dispatch.Type
-
HYBRID
.