Package io.micronaut.context
Interface LifeCycle<T extends LifeCycle>
- Type Parameters:
T
- The type
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Subinterfaces:
ApplicationContext
,ApplicationContextLifeCycle<T>
,BeanContext
,BlockingHttpClient
,ConfigurableApplicationContext
,ConfigurableBeanContext
,EmbeddedApplication<T>
,EmbeddedServer
,Environment
,HttpClient
,InitializableBeanContext
,JdkHttpClient
,NettyEmbeddedServer
,StreamingHttpClient
- All Known Implementing Classes:
AbstractConcurrentCustomScope
,DefaultApplicationContext
,DefaultBeanContext
,DefaultEnvironment
,DefaultHttpClient
,DefaultJdkHttpClient
,DefaultWatchThread
,DeleteEndpointRouteBuilder
,JdkBlockingHttpClient
,MacOsWatchThread
,MessagingApplication
,NettyHttpServer
,ReadEndpointRouteBuilder
,RefreshScope
,WriteEndpointRouteBuilder
A 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
- Author:
- Graeme Rocher
-
Method Summary
-
Method Details
-
isRunning
boolean isRunning()- Returns:
- Whether the component is running
-
start
Starts the lifecyle component.- Returns:
- This lifecycle component
-
stop
Stops the life cycle component.- Returns:
- This lifecycle component
-
close
default void close()Delegates tostop()
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
refresh
- Returns:
- This lifecycle component
-