| Package | Description |
|---|---|
| org.apache.ratis.util |
| Modifier and Type | Field and Description |
|---|---|
static Set<LifeCycle.State> |
LifeCycle.States.CLOSING_OR_CLOSED |
static Set<LifeCycle.State> |
LifeCycle.States.CLOSING_OR_CLOSED_OR_EXCEPTION |
static Set<LifeCycle.State> |
LifeCycle.States.PAUSING_OR_PAUSED |
static Set<LifeCycle.State> |
LifeCycle.States.RUNNING |
static Set<LifeCycle.State> |
LifeCycle.States.STARTING_OR_RUNNING |
| Modifier and Type | Method and Description |
|---|---|
<T extends Throwable> |
LifeCycle.assertCurrentState(BiFunction<String,LifeCycle.State,T> newThrowable,
Set<LifeCycle.State> expected)
Assert if the current state equals to one of the expected states.
|
LifeCycle.State |
LifeCycle.checkStateAndClose()
Check the current state and, if applicable, transit to
CLOSING. |
<T extends Throwable> |
LifeCycle.checkStateAndClose(CheckedRunnable<T> closeMethod)
Check the current state and, if applicable, run the given close method.
|
LifeCycle.State |
LifeCycle.getCurrentState() |
LifeCycle.State |
LifeCycle.transition(UnaryOperator<LifeCycle.State> operator)
Transition using the given operator.
|
LifeCycle.State |
LifeCycle.transitionAndGet(UnaryOperator<LifeCycle.State> operator)
Transition using the given operator.
|
static LifeCycle.State |
LifeCycle.State.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LifeCycle.State[] |
LifeCycle.State.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
LifeCycle.compareAndTransition(LifeCycle.State from,
LifeCycle.State to)
If the current state is equal to the specified from state,
then transition to the give to state; otherwise, make no change.
|
static boolean |
LifeCycle.State.isValid(LifeCycle.State from,
LifeCycle.State to)
Is the given transition valid?
|
void |
LifeCycle.transition(LifeCycle.State to)
Transition from the current state to the given state.
|
void |
LifeCycle.transitionIfNotEqual(LifeCycle.State to)
Transition from the current state to the given state if the current state is not equal to the given state.
|
boolean |
LifeCycle.transitionIfValid(LifeCycle.State to)
Transition from the current state to the given state only if the transition is valid.
|
| Modifier and Type | Method and Description |
|---|---|
<T extends Throwable> |
LifeCycle.assertCurrentState(BiFunction<String,LifeCycle.State,T> newThrowable,
Set<LifeCycle.State> expected)
Assert if the current state equals to one of the expected states.
|
<T extends Throwable> |
LifeCycle.assertCurrentState(BiFunction<String,LifeCycle.State,T> newThrowable,
Set<LifeCycle.State> expected)
Assert if the current state equals to one of the expected states.
|
void |
LifeCycle.assertCurrentState(Set<LifeCycle.State> expected)
Assert if the current state equals to one of the expected states.
|
LifeCycle.State |
LifeCycle.transition(UnaryOperator<LifeCycle.State> operator)
Transition using the given operator.
|
LifeCycle.State |
LifeCycle.transitionAndGet(UnaryOperator<LifeCycle.State> operator)
Transition using the given operator.
|
Copyright © 2017–2022 The Apache Software Foundation. All rights reserved.