public class LifeCycleStateManager<T extends LifeCycleState> extends Object implements Serializable
| Constructor and Description |
|---|
LifeCycleStateManager(T initialState,
String identifier) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
changeState(T nextState)
Changes the current state to nextState, if nextState is not as same as the current state
|
T |
getCurrentState()
Get the current state
|
String |
getIdentifier() |
T |
getPreviousState()
Retrieves the previous state
|
Stack<T> |
getStateStack()
Get all the states this element has gone through
|
<S extends TopologyEvent> |
isPreConditionsValid(T nextState,
S topologyEvent)
checks if any conditions that should be met for the state transfer is valid
|
boolean |
isStateTransitionValid(T nextState)
Checks if the state transition is valid
|
public <S extends TopologyEvent> boolean isPreConditionsValid(T nextState, S topologyEvent)
S - subclass of Topology eventnextState - possible next state for the topology elementtopologyEvent - relevant ToplogyEventpublic boolean isStateTransitionValid(T nextState)
nextState - possible next state for the topology elementpublic boolean changeState(T nextState)
nextState - the next state to changepublic Stack<T> getStateStack()
public T getCurrentState()
public T getPreviousState()
public String getIdentifier()
Copyright © 2012–2016 The Apache Software Foundation. All rights reserved.