Interface LifeCycle<T extends LifeCycle<T>>

Type Parameters:
T - The type
All Superinterfaces:
AutoCloseable, Closeable
All Known Subinterfaces:
ApplicationContext, ApplicationContextLifeCycle<T>, BeanContext, ConfigurableApplicationContext, ConfigurableBeanContext, Environment
All Known Implementing Classes:
AbstractConcurrentCustomScope, DefaultBeanContext

public interface LifeCycle<T extends LifeCycle<T>> extends Closeable, AutoCloseable
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
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Delegates to stop().
    boolean
     
    default T
    Refreshes the current life cycle object.
    default T
    Starts the lifecyle component.
    default T
    Stops the life cycle component.
  • Method Details

    • isRunning

      boolean isRunning()
      Returns:
      Whether the component is running
    • start

      default T start()
      Starts the lifecyle component.
      Returns:
      This lifecycle component
    • stop

      default T stop()
      Stops the life cycle component.
      Returns:
      This lifecycle component
    • close

      default void close()
      Delegates to stop().
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • refresh

      default T refresh()
      Refreshes the current life cycle object. Effectively this calls stop() followed by start().
      Returns:
      This lifecycle component