org.ow2.jonas.lib.work
Class AbsCleanTask

java.lang.Object
  extended by org.ow2.jonas.lib.work.AbsCleanTask
All Implemented Interfaces:
CleanTask
Direct Known Subclasses:
EarCleanTask, EJB3CleanTask, JarCleanTask, WarCleanTask

public abstract class AbsCleanTask
extends Object
implements CleanTask

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.
abstract  DeployerLog getDeployerLog()
          Returns the DeployerLog of the task.
 Vector<LogEntry> getLogEntries()
          Gets the log entries.
protected  org.ow2.util.log.Log getLogger()
          Get logger.
protected abstract  boolean isDeployedLogEntry(LogEntry logEntry)
          Check if the package pointed by the log entry is currently deploy.
 boolean isValidLogEntry(LogEntry logEntry)
          Return true if the work copy exists and is up to date.
 boolean removeLogEntry(LogEntry logEntry)
          Remove the work copy specified in the log entry and the log entry.
 
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

isDeployedLogEntry

protected abstract boolean isDeployedLogEntry(LogEntry logEntry)
                                       throws WorkCleanerException
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:
WorkCleanerException - If it fails

getDeployerLog

public abstract DeployerLog getDeployerLog()
Returns the DeployerLog of the task.

Returns:
The DeployerLog of the task

isValidLogEntry

public boolean isValidLogEntry(LogEntry logEntry)
                        throws WorkCleanerException
Return true if the work copy exists 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:
WorkCleanerException - if it fails

execute

public void execute()
             throws WorkCleanerException
Run the clean task.

Specified by:
execute in interface CleanTask
Throws:
WorkCleanerException - if it failed.

removeLogEntry

public boolean removeLogEntry(LogEntry logEntry)
                       throws WorkCleanerException
Remove the work copy specified in the log entry and the log entry.

Parameters:
logEntry - entry in a deploy log
Returns:
true if the log entry has been removed successfully
Throws:
WorkCleanerException - if it fails

getLogEntries

public Vector<LogEntry> getLogEntries()
Gets the log entries.

Returns:
the log entries

getLogger

protected org.ow2.util.log.Log getLogger()
Get logger.

Returns:
the logger


Copyright © 2010 OW2 Consortium. All Rights Reserved.