| 程序包 | 说明 |
|---|---|
| org.apache.ratis.util |
| 限定符和类型 | 字段和说明 |
|---|---|
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 |
| 限定符和类型 | 方法和说明 |
|---|---|
<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)
返回带有指定名称的该类型的枚举常量。
|
static LifeCycle.State[] |
LifeCycle.State.values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
| 限定符和类型 | 方法和说明 |
|---|---|
<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–2023 The Apache Software Foundation. All rights reserved.