Interface Lifecycle

All Superinterfaces:
AutoCloseable
All Known Subinterfaces:
Deployment, DeploymentContainer

public interface Lifecycle extends AutoCloseable
Implemented by objects with an unmanaged lifecycle.
Author:
Paul Ferraro
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Stops this object, if started.
    static Lifecycle
    composite(Collection<? extends Lifecycle> lifecycles)
    Returns a composite lifecycle object, useful for performing bulk lifecycle operations.
    boolean
    Indicates whether this object is started.
    void
    Starts this object.
    void
    Stops this object.
  • Method Details

    • start

      void start()
      Starts this object.
    • stop

      void stop()
      Stops this object.
    • isStarted

      boolean isStarted()
      Indicates whether this object is started.
      Returns:
      true, if this object is started, false otherwise.
    • close

      default void close()
      Stops this object, if started.
      Specified by:
      close in interface AutoCloseable
    • composite

      static Lifecycle composite(Collection<? extends Lifecycle> lifecycles)
      Returns a composite lifecycle object, useful for performing bulk lifecycle operations.
      Parameters:
      lifecycles - a collection of lifecycle objects
      Returns:
      a composite lifecycle