roboguice.event
Enum EventThread
java.lang.Object
java.lang.Enum<EventThread>
roboguice.event.EventThread
- All Implemented Interfaces:
- Serializable, Comparable<EventThread>
public enum EventThread
- extends Enum<EventThread>
Observes annotation parameter specifying which thread the annotated method will be called from. Use this
parameter to ensure that event manager calls with special requirements are executed properly:
Current:
Default execution technique. The same thread that fires the event calls to the observer.
UI:
When using events from background threads, use this parameter to
NEW:
When observing long running events, especially on the UI thread, use this observer technique to execute the
observing method on a new thread.
- Author:
- John Ericksen
Method Summary |
static EventThread |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static EventThread[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared. |
CURRENT
public static final EventThread CURRENT
UI
public static final EventThread UI
BACKGROUND
public static final EventThread BACKGROUND
values
public static EventThread[] 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 (EventThread c : EventThread.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static EventThread 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.