- java.lang.Object
-
- java.lang.Enum<Invocable.InvocationType>
-
- org.eclipse.jetty.util.thread.Invocable.InvocationType
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Invocable.InvocationType>
- Enclosing interface:
- Invocable
public static enum Invocable.InvocationType extends java.lang.Enum<Invocable.InvocationType>
The behavior of an
Invocablewhen it is invoked.Typically,
Runnables orCallbacks declare their invocation type; this information is then used by the code that should invoke theRunnableorCallbackto decide whether to invoke it directly, or submit it to a thread pool to be invoked by a different thread.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLOCKINGInvoking theInvocablemay block the invoker thread, and the invocation may be performed immediately (possibly blocking the invoker thread) or deferred to a later time, for example by submitting theInvocableto a thread pool.EITHERNON_BLOCKINGInvoking theInvocabledoes not block the invoker thread, and the invocation may be performed immediately in the invoker thread.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Invocable.InvocationTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Invocable.InvocationType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLOCKING
public static final Invocable.InvocationType BLOCKING
Invoking the
Invocablemay block the invoker thread, and the invocation may be performed immediately (possibly blocking the invoker thread) or deferred to a later time, for example by submitting theInvocableto a thread pool.This invocation type is suitable for
Invocables that call application code, for example to process an HTTP request.
-
NON_BLOCKING
public static final Invocable.InvocationType NON_BLOCKING
Invoking the
Invocabledoes not block the invoker thread, and the invocation may be performed immediately in the invoker thread.This invocation type is suitable for
Invocables that call implementation code that is guaranteed to never block the invoker thread.
-
EITHER
public static final Invocable.InvocationType EITHER
-
-
Method Detail
-
values
public static Invocable.InvocationType[] 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 (Invocable.InvocationType c : Invocable.InvocationType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Invocable.InvocationType valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-