Package io.micronaut.context
Interface LifeCycle<T extends LifeCycle>
-
- Type Parameters:
T- The type
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
- All Known Subinterfaces:
ApplicationContext,ApplicationContextLifeCycle<T>,BeanContext,Environment,InitializableBeanContext
- All Known Implementing Classes:
AbstractConcurrentCustomScope,DefaultApplicationContext,DefaultBeanContext,DefaultEnvironment
public interface LifeCycle<T extends LifeCycle> extends java.io.Closeable, java.lang.AutoCloseableA life cycle interface providing a start method and extending Closeable which provides a close() method for termination.Components can implement this interface
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidclose()Delegates tostop().booleanisRunning()default Trefresh()Refreshes the current life cycle object.default Tstart()Starts the lifecyle component.default Tstop()Stops the life cycle component.
-
-
-
Method Detail
-
isRunning
boolean isRunning()
- Returns:
- Whether the component is running
-
start
@NonNull default T start()
Starts the lifecyle component.- Returns:
- This lifecycle component
-
stop
@NonNull default T stop()
Stops the life cycle component.- Returns:
- This lifecycle component
-
close
default void close()
Delegates tostop().- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
refresh
@NonNull default T refresh()
- Returns:
- This lifecycle component
-
-