Package net.sf.eBus.config
Enum EConfigure.DispatcherType
- java.lang.Object
-
- java.lang.Enum<EConfigure.DispatcherType>
-
- net.sf.eBus.config.EConfigure.DispatcherType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<EConfigure.DispatcherType>
- Enclosing class:
- EConfigure
public static enum EConfigure.DispatcherType extends java.lang.Enum<EConfigure.DispatcherType>
Enumerates the supported eBus dispatcher thread types. There are effectively two dispatcher types: eBus and GUI with GUI divided between Swing and JavaFX.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EBUS
Default eBus dispatcher based on a run queue, so the dispatcher method isEClient.doDispatch(Runnable)
.JAVAFX
Posts a task to the JavaFX GUI thread usingjavafx.application.Platform.runLater(Runnable)
.SWING
Posts a task to the Swing GUI thread usingjavax.swing.SwingUtilities.invokeLater(Runnable)
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.function.Consumer<java.lang.Runnable>
dispatchHandle()
Returns the task dispatch method handle.static EConfigure.DispatcherType
findType(java.lang.String name)
Returns theEConfigure.DispatcherType
for the givenname
using case-insensitive string matching.boolean
isSpecial()
Returnstrue
if this dispatcher type is a special, non-configurable dispatcher.static EConfigure.DispatcherType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static EConfigure.DispatcherType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EBUS
public static final EConfigure.DispatcherType EBUS
Default eBus dispatcher based on a run queue, so the dispatcher method isEClient.doDispatch(Runnable)
.
-
JAVAFX
public static final EConfigure.DispatcherType JAVAFX
Posts a task to the JavaFX GUI thread usingjavafx.application.Platform.runLater(Runnable)
.
-
SWING
public static final EConfigure.DispatcherType SWING
Posts a task to the Swing GUI thread usingjavax.swing.SwingUtilities.invokeLater(Runnable)
.
-
-
Method Detail
-
values
public static EConfigure.DispatcherType[] 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 (EConfigure.DispatcherType c : EConfigure.DispatcherType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EConfigure.DispatcherType 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
-
isSpecial
public boolean isSpecial()
Returnstrue
if this dispatcher type is a special, non-configurable dispatcher.- Returns:
true
if a special dispatcher.
-
dispatchHandle
public java.util.function.Consumer<java.lang.Runnable> dispatchHandle()
Returns the task dispatch method handle. May benull
.- Returns:
- dispatch method handle.
-
findType
public static EConfigure.DispatcherType findType(java.lang.String name)
Returns theEConfigure.DispatcherType
for the givenname
using case-insensitive string matching. Ifname
is eithernull
or an empty string, then returnsEBUS
by default.- Parameters:
name
- find dispatcher type with the given name using case-insensitive matching.- Returns:
- matching dispatcher type; defaults to
EBUS
.
-
-