public interface StateMachine<T> extends Resource<StateMachine<T>>
| Modifier and Type | Method and Description |
|---|---|
static <T> StateMachine<T> |
create(String name,
Class<T> stateType,
Class<? extends T> initialState)
Creates a new state machine with the default cluster and state machine configurations.
|
static <T> StateMachine<T> |
create(String name,
Class<T> stateType,
Class<? extends T> initialState,
ClusterConfig cluster)
Creates a new state machine with the default state machine configuration.
|
static <T> StateMachine<T> |
create(String name,
ClusterConfig cluster,
StateMachineConfig config)
Creates a new state machine.
|
<U> U |
createProxy(Class<U> type)
Creates a state machine proxy.
|
<U> U |
createProxy(Class<U> type,
ClassLoader classLoader)
Creates a state machine proxy.
|
addShutdownTask, addStartupTask, cluster, name, statestatic <T> StateMachine<T> create(String name, Class<T> stateType, Class<? extends T> initialState)
The state machine will be constructed with the default cluster configuration. The default cluster configuration
searches for two resources on the classpath - cluster and {cluster-defaults} - in that order. Configuration
options specified in cluster.conf will override those in {cluster-defaults.conf}.
Additionally, the state machine will be constructed with an state machine configuration that searches the classpath for
three configuration files - {name}, state-machine, state-machine-defaults, resource, and
resource-defaults - in that order. The first resource is a configuration resource with the same name
as the state machine resource. If the resource is namespaced - e.g. `state-machines.my-machine.conf` - then resource
configurations will be loaded according to namespaces as well; for example, `state-machines.conf`.
name - The state machine resource name.stateType - The state machine state type.initialState - The state machine state.static <T> StateMachine<T> create(String name, Class<T> stateType, Class<? extends T> initialState, ClusterConfig cluster)
The state machine will be constructed with an state machine configuration that searches the classpath for three
configuration files - {name}, state-machine, state-machine-defaults, resource, and
resource-defaults - in that order. The first resource is a configuration resource with the same name
as the state machine resource. If the resource is namespaced - e.g. `state-machines.my-machine.conf` - then resource
configurations will be loaded according to namespaces as well; for example, `state-machines.conf`.
name - The state machine resource name.stateType - The state machine state type.initialState - The state machine state.cluster - The state machine cluster configuration.static <T> StateMachine<T> create(String name, ClusterConfig cluster, StateMachineConfig config)
name - The state machine resource name.cluster - The state machine cluster configuration.config - The state machine configuration.<U> U createProxy(Class<U> type)
U - The proxy type.type - The proxy interface.<U> U createProxy(Class<U> type, ClassLoader classLoader)
U - The proxy type.type - The proxy interface.classLoader - The class loader to define the proxy class.Copyright © 2013-2015. All Rights Reserved.