org.objectweb.jonas_lib.deployment.work
Class AbsCleanTask

java.lang.Object
  extended by org.objectweb.jonas_lib.deployment.work.AbsCleanTask
Direct Known Subclasses:
EarCleanTask, JarCleanTask

public abstract class AbsCleanTask
extends java.lang.Object

Abstract Clean Task class which define a generic job executed by the cleaner thread

Author:
Benoit PELLETIER

Constructor Summary
protected AbsCleanTask()
          Default constructor : Construct a new cleaner.
 
Method Summary
 void execute()
          Run the clean task
protected abstract  java.util.Vector getLogEntries()
          Abstract method defined in the derived classes get the log entries
protected static org.objectweb.util.monolog.api.Logger getLogger()
           
protected abstract  boolean isDeployLogEntry(LogEntry logEntry)
          Check if the package pointed by the log entry is currently deploy
protected abstract  boolean isValidLogEntry(LogEntry logEntry)
          Abstract method defined in the derived classes return true if the work copy exist and is up to date
protected abstract  void removeLogEntry(LogEntry logEntry)
          Abstract method defined in the derived classes remove the work copy specified in the log entry and the log entry
protected  void removeRecursiveDirectory(java.io.File file)
          Remove a directory with all its child (recursive)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbsCleanTask

protected AbsCleanTask()
Default constructor : Construct a new cleaner.

Method Detail

getLogger

protected static org.objectweb.util.monolog.api.Logger getLogger()
Returns:
the logger

isValidLogEntry

protected abstract boolean isValidLogEntry(LogEntry logEntry)
                                    throws CleanerException
Abstract method defined in the derived classes return true if the work copy exist and is up to date

Parameters:
logEntry - entry in a deploy log
Returns:
true if the work copy exists and is up to date
Throws:
CleanerException - if it fails

removeLogEntry

protected abstract void removeLogEntry(LogEntry logEntry)
                                throws CleanerException
Abstract method defined in the derived classes remove the work copy specified in the log entry and the log entry

Parameters:
logEntry - entry in a deploy log
Throws:
CleanerException - if it fails

getLogEntries

protected abstract java.util.Vector getLogEntries()
Abstract method defined in the derived classes get the log entries

Returns:
the log entries

isDeployLogEntry

protected abstract boolean isDeployLogEntry(LogEntry logEntry)
                                     throws CleanerException
Check if the package pointed by the log entry is currently deploy

Parameters:
logEntry - entry in a deploy log
Returns:
true if the package pointed by the log entry is currently deployed
Throws:
CleanerException - if it fails

execute

public void execute()
             throws CleanerException
Run the clean task

Throws:
CleanerException - if it failed.

removeRecursiveDirectory

protected void removeRecursiveDirectory(java.io.File file)
Remove a directory with all its child (recursive)

Parameters:
file - the file or directory which must be deleted