org.apache.logging.log4j.core.appender.rolling.action
Class AbstractAction

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

public abstract class AbstractAction
extends Object
implements Action

Abstract base class for implementations of Action.


Field Summary
protected static org.apache.logging.log4j.Logger LOGGER
          Allow subclasses access to the status logger without creating another instance.
 
Constructor Summary
protected AbstractAction()
          Constructor.
 
Method Summary
 void close()
          Cancels the action if not already initialized or waits till completion.
abstract  boolean execute()
          Perform action.
 boolean isComplete()
          Tests if the action is complete.
protected  void reportException(Exception ex)
          Capture exception.
 void run()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.apache.logging.log4j.Logger LOGGER
Allow subclasses access to the status logger without creating another instance.

Constructor Detail

AbstractAction

protected AbstractAction()
Constructor.

Method Detail

execute

public abstract boolean execute()
                         throws IOException
Perform 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.

reportException

protected void reportException(Exception ex)
Capture exception.

Parameters:
ex - exception.


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.