java.lang.Object
org.apache.logging.log4j.core.appender.rolling.action.AbstractAction
All Implemented Interfaces:
Runnable, Action
Direct Known Subclasses:
AbstractPathAction, CommonsCompressAction, CompositeAction, FileRenameAction, GzCompressAction, RollingFileManager.AsyncAction, ZipCompressAction

public abstract class AbstractAction extends Object implements Action
Abstract base class for implementations of Action.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Is action complete.
    private boolean
    Is action interrupted.
    protected static final Logger
    Allows subclasses access to the status logger without creating another instance.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the action if not already initialized or waits till completion.
    abstract boolean
    Performs action.
    boolean
    Tests if the action is complete.
    boolean
     
    protected void
    Captures exception.
    void
    run()

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      protected static final Logger LOGGER
      Allows subclasses access to the status logger without creating another instance.
    • complete

      private boolean complete
      Is action complete.
    • interrupted

      private boolean interrupted
      Is action interrupted.
  • Constructor Details

    • AbstractAction

      protected AbstractAction()
      Constructor.
  • Method Details

    • execute

      public abstract boolean execute() throws IOException
      Performs action.
      Specified by:
      execute in interface Action
      Returns:
      true if successful.
      Throws:
      IOException - if IO error.
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • close

      public void close()
      Cancels the action if not already initialized or waits till completion.
      Specified by:
      close in interface Action
    • isComplete

      public boolean isComplete()
      Tests if the action is complete.
      Specified by:
      isComplete in interface Action
      Returns:
      true if action is complete.
    • isInterrupted

      public boolean isInterrupted()
    • reportException

      protected void reportException(Exception ex)
      Captures exception.
      Parameters:
      ex - exception.