public class StateMachineConfig extends StateLogConfig
config| Modifier | Constructor and Description |
|---|---|
|
StateMachineConfig() |
|
StateMachineConfig(Map<String,Object> config) |
protected |
StateMachineConfig(StateMachineConfig config) |
|
StateMachineConfig(String resource) |
| Modifier and Type | Method and Description |
|---|---|
StateMachineConfig |
addReplica(String replica) |
StateMachineConfig |
clearReplicas() |
StateMachineConfig |
copy() |
<T> Class<T> |
getInitialState()
Returns the state machine's initial state.
|
<T> Class<T> |
getStateType()
Returns the state machine state type.
|
StateMachineConfig |
removeReplica(String replica) |
CoordinatedResourceConfig |
resolve(ClusterConfig cluster) |
void |
setInitialState(Class<?> initialState)
Sets the state machine's initial state.
|
void |
setInitialState(String initialState)
Sets the state machine's initial state.
|
void |
setStateType(Class<?> stateType)
Sets the state machine state type.
|
void |
setStateType(String stateType)
Sets the state machine state type.
|
StateMachineConfig |
withDefaultConsistency(Consistency consistency) |
StateMachineConfig |
withDefaultConsistency(String consistency) |
StateMachineConfig |
withElectionTimeout(long electionTimeout) |
StateMachineConfig |
withElectionTimeout(long electionTimeout,
TimeUnit unit) |
StateMachineConfig |
withExecutor(Executor executor) |
StateMachineConfig |
withHeartbeatInterval(long heartbeatInterval) |
StateMachineConfig |
withHeartbeatInterval(long heartbeatInterval,
TimeUnit unit) |
StateMachineConfig |
withInitialState(Class<?> initialState)
Sets the state machine's initial state, returning the state machine configuration for method chaining.
|
StateMachineConfig |
withInitialState(String initialState)
Sets the state machine's initial state, returning the state machine configuration for method chaining.
|
StateMachineConfig |
withLog(Log log) |
StateMachineConfig |
withReplicas(Collection<String> replicas) |
StateMachineConfig |
withReplicas(String... replicas) |
StateMachineConfig |
withSerializer(Class<? extends Serializer> serializer) |
StateMachineConfig |
withSerializer(Serializer serializer) |
StateMachineConfig |
withSerializer(String serializer) |
StateMachineConfig |
withStateType(Class<?> stateType)
Sets the state machine state type, returning the state machine configuration for method chaining.
|
StateMachineConfig |
withStateType(String stateType)
Sets the state machine state type, returning the state machine configuration for method chaining.
|
getDefaultConsistency, setDefaultConsistency, setDefaultConsistencygetDefaultSerializer, getElectionTimeout, getExecutor, getHeartbeatInterval, getLog, getReplicas, getSerializer, setDefaultSerializer, setElectionTimeout, setElectionTimeout, setExecutor, setHeartbeatInterval, setHeartbeatInterval, setLog, setReplicas, setReplicas, setSerializer, setSerializer, setSerializer, withDefaultSerializeraddResources, configure, equals, hashCode, toMap, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitloadpublic StateMachineConfig()
public StateMachineConfig(String resource)
protected StateMachineConfig(StateMachineConfig config)
public StateMachineConfig copy()
copy in interface Copyable<Configurable>copy in class StateLogConfigpublic void setStateType(String stateType)
stateType - The state machine state interface.NullPointerException - If the stateType is nullConfigurationException - If the given class is not foundIllegalArgumentException - If the given class is not a valid interfacepublic void setStateType(Class<?> stateType)
stateType - The state machine state type.NullPointerException - If the stateType is nullIllegalArgumentException - If the given class is not a valid interfacepublic <T> Class<T> getStateType()
ConfigurationException - If the configured class is not foundpublic StateMachineConfig withStateType(String stateType)
stateType - The state machine state type.NullPointerException - If the stateType is nullConfigurationException - If the given class is not foundIllegalArgumentException - If the given class is not a valid interfacepublic StateMachineConfig withStateType(Class<?> stateType)
stateType - The state machine state type.NullPointerException - If the stateType is nullIllegalArgumentException - If the given class is not a valid interfacepublic void setInitialState(String initialState)
initialState - The state machine's initial state.NullPointerException - If the stateType is nullConfigurationException - If the given class is not foundIllegalArgumentException - If the given class is not a valid interfacepublic void setInitialState(Class<?> initialState)
initialState - The state machine's initial state.NullPointerException - If the stateType is nullIllegalArgumentException - If the given class is not a valid interfacepublic <T> Class<T> getInitialState()
ConfigurationException - If the configured class is not foundpublic StateMachineConfig withInitialState(String initialState)
initialState - The state machine's initial state.NullPointerException - If the stateType is nullConfigurationException - If the given class is not foundIllegalArgumentException - If the given class is not a valid interfacepublic StateMachineConfig withInitialState(Class<?> initialState)
initialState - The state machine's initial state.NullPointerException - If the stateType is nullIllegalArgumentException - If the given class is not a valid interfacepublic StateMachineConfig withSerializer(String serializer)
withSerializer in class ResourceConfig<StateLogConfig>public StateMachineConfig withSerializer(Class<? extends Serializer> serializer)
withSerializer in class ResourceConfig<StateLogConfig>public StateMachineConfig withSerializer(Serializer serializer)
withSerializer in class ResourceConfig<StateLogConfig>public StateMachineConfig withExecutor(Executor executor)
withExecutor in class ResourceConfig<StateLogConfig>public StateMachineConfig withElectionTimeout(long electionTimeout)
withElectionTimeout in class ResourceConfig<StateLogConfig>public StateMachineConfig withElectionTimeout(long electionTimeout, TimeUnit unit)
withElectionTimeout in class ResourceConfig<StateLogConfig>public StateMachineConfig withHeartbeatInterval(long heartbeatInterval)
withHeartbeatInterval in class ResourceConfig<StateLogConfig>public StateMachineConfig withHeartbeatInterval(long heartbeatInterval, TimeUnit unit)
withHeartbeatInterval in class ResourceConfig<StateLogConfig>public StateMachineConfig withReplicas(String... replicas)
withReplicas in class ResourceConfig<StateLogConfig>public StateMachineConfig withReplicas(Collection<String> replicas)
withReplicas in class ResourceConfig<StateLogConfig>public StateMachineConfig addReplica(String replica)
addReplica in class ResourceConfig<StateLogConfig>public StateMachineConfig removeReplica(String replica)
removeReplica in class ResourceConfig<StateLogConfig>public StateMachineConfig clearReplicas()
clearReplicas in class ResourceConfig<StateLogConfig>public StateMachineConfig withLog(Log log)
withLog in class ResourceConfig<StateLogConfig>public StateMachineConfig withDefaultConsistency(String consistency)
withDefaultConsistency in class StateLogConfigpublic StateMachineConfig withDefaultConsistency(Consistency consistency)
withDefaultConsistency in class StateLogConfigpublic CoordinatedResourceConfig resolve(ClusterConfig cluster)
resolve in class StateLogConfigCopyright © 2013-2015. All Rights Reserved.