org.x4juli.handlers.rolling.helper
Class AbstractAction

java.lang.Object
  extended byorg.x4juli.global.components.AbstractComponent
      extended byorg.x4juli.handlers.rolling.helper.AbstractAction
All Implemented Interfaces:
Action, Component, java.lang.Runnable
Direct Known Subclasses:
CompositeAction, FileRenameAction, GZCompressAction, NOPAction, ZipCompressAction

public abstract class AbstractAction
extends AbstractComponent
implements Action

Abstract base class for implementations of Action.

Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Curt Arnold. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Field Summary
private  boolean complete
          Is action complete.
private  boolean interrupted
          Is action interrupted.
 
Fields inherited from class org.x4juli.global.components.AbstractComponent
manager, repository
 
Constructor Summary
protected AbstractAction()
           
 
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(java.lang.Exception ex)
          Capture exception.
 void run()
          
 
Methods inherited from class org.x4juli.global.components.AbstractComponent
getLogger, getLoggerRepository, getMessageProperties, getNonFloodingLogger, getProperty, getProperty, getProperty, getProperty, resetErrorCount, setObjectStore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

complete

private boolean complete
Is action complete.


interrupted

private boolean interrupted
Is action interrupted.

Constructor Detail

AbstractAction

protected AbstractAction()
Method Detail

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.

execute

public abstract boolean execute()
                         throws java.io.IOException
Perform action.

Specified by:
execute in interface Action
Returns:
true if successful.
Throws:
java.io.IOException - if IO error.

run

public void run()

Specified by:
run in interface java.lang.Runnable

reportException

protected void reportException(java.lang.Exception ex)
Capture exception.

Parameters:
ex - exception.


${license_html}