Class AbstractLifeCycle

java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
All Implemented Interfaces:
LifeCycle, LifeCycle2
Direct Known Subclasses:
AbstractConnectionSource, AbstractFilter, AbstractFilterable, AbstractTriggeringPolicy, AsyncLoggerConfigDisruptor, CompositeFilter, ConfigurationScheduler, IdlePurgePolicy, LoggerContext, WatchManager

public class AbstractLifeCycle extends Object implements LifeCycle2
A life cycle to be extended.

Wraps a LifeCycle.State.

  • Field Details

    • DEFAULT_STOP_TIMEOUT

      public static final int DEFAULT_STOP_TIMEOUT
      See Also:
    • DEFAULT_STOP_TIMEUNIT

      public static final TimeUnit DEFAULT_STOP_TIMEUNIT
    • LOGGER

      protected static final Logger LOGGER
      Allow subclasses access to the status logger without creating another instance.
  • Constructor Details

    • AbstractLifeCycle

      public AbstractLifeCycle()
  • Method Details

    • getStatusLogger

      protected static Logger getStatusLogger()
      Gets the status logger.
      Returns:
      the status logger.
    • equalsImpl

      protected boolean equalsImpl(Object obj)
    • getState

      public LifeCycle.State getState()
      Description copied from interface: LifeCycle
      Gets the life-cycle state.
      Specified by:
      getState in interface LifeCycle
      Returns:
      the life-cycle state
    • hashCodeImpl

      protected int hashCodeImpl()
    • isInitialized

      public boolean isInitialized()
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface LifeCycle
    • isStarting

      public boolean isStarting()
    • isStopped

      public boolean isStopped()
      Specified by:
      isStopped in interface LifeCycle
    • isStopping

      public boolean isStopping()
    • setStarted

      protected void setStarted()
    • setStarting

      protected void setStarting()
    • setState

      protected void setState(LifeCycle.State newState)
    • setStopped

      protected void setStopped()
    • setStopping

      protected void setStopping()
    • initialize

      public void initialize()
      Specified by:
      initialize in interface LifeCycle
    • start

      public void start()
      Specified by:
      start in interface LifeCycle
    • stop

      public void stop()
      Specified by:
      stop in interface LifeCycle
    • stop

      protected boolean stop(Future<?> future)
    • stop

      public boolean stop(long timeout, TimeUnit timeUnit)
      Description copied from interface: LifeCycle2
      Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
      Specified by:
      stop in interface LifeCycle2
      Parameters:
      timeout - the maximum time to wait
      timeUnit - the time unit of the timeout argument
      Returns:
      true if the receiver was stopped cleanly and normally, false otherwise.