org.apache.beehive.controls.api.bean
Enum ThreadingPolicy

Object
  extended by Enum<ThreadingPolicy>
      extended by ThreadingPolicy
All Implemented Interfaces:
Serializable, Comparable<ThreadingPolicy>

public enum ThreadingPolicy
extends Enum<ThreadingPolicy>

Specifies threading policy for control implementations. The constants of this enumerated type describe the threading policies that apply during execution of controls. They are used in conjunction with the Threading annotation type to specify the responsibilities of the runtime infrastructure and control implementation with respect to threading.


Enum Constant Summary
MULTI_THREADED
          When a control implementation is declared as MULTI_THREADED, the controls infrastructure permits multiple threads to concurrently execute in instances of that control.
SINGLE_THREADED
          When a control implementation is declared as SINGLE_THREADED, the controls infrastructure ensures that only a single thread will be executing in a particular instance of that control at any time.
 
Method Summary
static ThreadingPolicy valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ThreadingPolicy[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

SINGLE_THREADED

public static final ThreadingPolicy SINGLE_THREADED
When a control implementation is declared as SINGLE_THREADED, the controls infrastructure ensures that only a single thread will be executing in a particular instance of that control at any time. This is the default policy if no Threading annotation is specified.


MULTI_THREADED

public static final ThreadingPolicy MULTI_THREADED
When a control implementation is declared as MULTI_THREADED, the controls infrastructure permits multiple threads to concurrently execute in instances of that control. It is then the responsibility of the implementation to ensure internal thread-safety using standard Java concurrency mechanisms. This policy may yield higher performance, at the cost of additional work on the implementor's part.

Method Detail

values

public static final ThreadingPolicy[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ThreadingPolicy c : ThreadingPolicy.values())
        System.out.println(c);

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

valueOf

public static ThreadingPolicy 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