Package cn.sliew.milky.common.lifecycle
Interface LifeCycle
-
- All Known Implementing Classes:
AbstractLifeCycle
public interface LifeCycleLife cycle component, which useful for handle component initialize, start and stop.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classLifeCycle.LifeCycleResultstatic classLifeCycle.LifeCycleSupportResultstatic classLifeCycle.StateStatus of a life cycle.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddLifeCycleListener(LifeCycleListener listener)LifeCycle.StategetState()Gets the life-cycle state.LifeCycle.LifeCycleResultinitialize()booleanisStarted()booleanisStopped()voidremoveLifeCycleListener(LifeCycleListener listener)LifeCycle.LifeCycleResultstart()LifeCycle.LifeCycleResultstop()LifeCycle.LifeCycleResultstop(Duration timeout)LifeCycle.LifeCycleSupportResultsupportInitialize()LifeCycle.LifeCycleSupportResultsupportStart()LifeCycle.LifeCycleSupportResultsupportStop()
-
-
-
Method Detail
-
getState
LifeCycle.State getState()
Gets the life-cycle state.- Returns:
- the life-cycle state
-
addLifeCycleListener
void addLifeCycleListener(LifeCycleListener listener)
-
removeLifeCycleListener
void removeLifeCycleListener(LifeCycleListener listener)
-
initialize
LifeCycle.LifeCycleResult initialize()
-
supportInitialize
LifeCycle.LifeCycleSupportResult supportInitialize()
-
start
LifeCycle.LifeCycleResult start()
-
supportStart
LifeCycle.LifeCycleSupportResult supportStart()
-
isStarted
boolean isStarted()
-
stop
LifeCycle.LifeCycleResult stop()
-
supportStop
LifeCycle.LifeCycleSupportResult supportStop()
-
stop
LifeCycle.LifeCycleResult stop(Duration timeout)
-
isStopped
boolean isStopped()
-
-