org.jboss.threads
Enum RejectionPolicy

java.lang.Object
  extended by java.lang.Enum<RejectionPolicy>
      extended by org.jboss.threads.RejectionPolicy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<RejectionPolicy>

public enum RejectionPolicy
extends java.lang.Enum<RejectionPolicy>

Specify the way a task rejection should be handled.


Enum Constant Summary
ABORT
          Abort execution with an exception.
BLOCK
          Wait until there is room in the queue, or the calling thread is interrupted.
DISCARD
          Discard the excess task silently.
DISCARD_OLDEST
          Discard the oldest task in the queue silently, and enqueue the new task.
HANDOFF
          Hand off the task to another executor.
 
Method Summary
static RejectionPolicy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static RejectionPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ABORT

public static final RejectionPolicy ABORT
Abort execution with an exception.


BLOCK

public static final RejectionPolicy BLOCK
Wait until there is room in the queue, or the calling thread is interrupted.


DISCARD

public static final RejectionPolicy DISCARD
Discard the excess task silently.


DISCARD_OLDEST

public static final RejectionPolicy DISCARD_OLDEST
Discard the oldest task in the queue silently, and enqueue the new task. If the queue has no capacity then the new task will be discarded.


HANDOFF

public static final RejectionPolicy HANDOFF
Hand off the task to another executor.

Method Detail

values

public static RejectionPolicy[] 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 (RejectionPolicy c : RejectionPolicy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static RejectionPolicy 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 name
java.lang.NullPointerException - if the argument is null


Copyright © 2011. All Rights Reserved.