org.ow2.jonas.lib.work
Class AbsDeployerLog<T extends LogEntry>

java.lang.Object
  extended by org.ow2.jonas.lib.work.AbsDeployerLog<T>
All Implemented Interfaces:
IDeployerLog<T>
Direct Known Subclasses:
DeployerLog

public abstract class AbsDeployerLog<T extends LogEntry>
extends Object
implements IDeployerLog<T>

Abstract class for deployer log

Author:
Jeremy Cazaux

Field Summary
protected  Vector<T> logEntries
          The current entries of the logFile.
protected  File logFile
          File for logging.
protected  org.ow2.util.log.Log logger
          The logger.
protected static String SEPARATOR_ENTRY
          Separator char of a entry in the log file.
 
Constructor Summary
AbsDeployerLog(File logFile)
          Constructor for the deployerLog.
 
Method Summary
abstract  Vector<T> addEntry(T logEntry)
          Add the entry and return the new entries.
 Vector<T> getEntries()
          Return the entries of the file.
abstract  T getEntry(File original)
           
protected  org.ow2.util.log.Log getLogger()
           
protected abstract  void loadEntries()
          load the entries of the log file.
 Vector<T> removeEntry(T entry)
          Remove the given entry and return the entries of the file.
protected abstract  void saveEntries()
          Dump(save) the entries to the log file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.ow2.util.log.Log logger
The logger.


SEPARATOR_ENTRY

protected static final String SEPARATOR_ENTRY
Separator char of a entry in the log file.

See Also:
Constant Field Values

logFile

protected File logFile
File for logging.


logEntries

protected Vector<T extends LogEntry> logEntries
The current entries of the logFile.

Constructor Detail

AbsDeployerLog

public AbsDeployerLog(File logFile)
               throws DeployerLogException
Constructor for the deployerLog.

Parameters:
logFile - the file which is used for read/write entries
Throws:
DeployerLogException - if the loadentries failed.
Method Detail

getLogger

protected org.ow2.util.log.Log getLogger()
Returns:
the logger

loadEntries

protected abstract void loadEntries()
                             throws DeployerLogException
load the entries of the log file.

Throws:
DeployerLogException - if the load failed.

saveEntries

protected abstract void saveEntries()
                             throws DeployerLogException
Dump(save) the entries to the log file.

Throws:
DeployerLogException - if the save failed.

getEntries

public Vector<T> getEntries()
Return the entries of the file.

Specified by:
getEntries in interface IDeployerLog<T extends LogEntry>
Returns:
a vector of LogEntry item.

removeEntry

public Vector<T> removeEntry(T entry)
                                       throws DeployerLogException
Remove the given entry and return the entries of the file.

Specified by:
removeEntry in interface IDeployerLog<T extends LogEntry>
Parameters:
entry - the LogEntry which must be remove.
Returns:
the new vector of LogEntry item.
Throws:
DeployerLogException - if the remove can't be done

addEntry

public abstract Vector<T> addEntry(T logEntry)
                                             throws DeployerLogException
Add the entry and return the new entries.

Specified by:
addEntry in interface IDeployerLog<T extends LogEntry>
Parameters:
logEntry - the entry to add
Throws:
DeployerLogException - if the add can't be done

getEntry

public abstract T getEntry(File original)
Specified by:
getEntry in interface IDeployerLog<T extends LogEntry>
Parameters:
original - Original File
Returns:
the entry which match with the orginal file


Copyright © 2012 OW2 Consortium. All Rights Reserved.