com.adventnet.afp.log
Class AbstractLogWriter

java.lang.Object
  |
  +--com.adventnet.afp.log.AbstractLogWriter
All Implemented Interfaces:
LogWriter
Direct Known Subclasses:
FileLogWriter

public abstract class AbstractLogWriter
extends java.lang.Object
implements LogWriter

This is the abstract class that implements the LogWriter. This class provides methods for the listening mechanism. Only the registered listeners will be notified when there is any change in the properties of the LogWriter.It gives implementation for important methods provided by the LogWriter interface.


Field Summary
protected  java.util.Vector listeners
          Vector containing property change listeners
 
Constructor Summary
AbstractLogWriter()
          Creates a new AbstractLogWriter instance.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Method for adding PropertyChangeListener to this LogWriter instance.
 java.lang.String getInstanceName()
          This method will return the log writer instance .
 void init(LogWriterProperties prop)
          For initializing implementation class with required properties.
 boolean removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Used to remove the registered PropertyChangeListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.adventnet.afp.log.LogWriter
close, err, flush, out
 

Field Detail

listeners

protected java.util.Vector listeners
Vector containing property change listeners
Constructor Detail

AbstractLogWriter

public AbstractLogWriter()
Creates a new AbstractLogWriter instance.
Method Detail

init

public void init(LogWriterProperties prop)
          throws LogException
For initializing implementation class with required properties. The Properties are taken from the logging configuration file. If the properties are null, then default properties will be taken for the Logging operation.
Specified by:
init in interface LogWriter
Parameters:
prop - Properties containing information read from the logging configuration file.
Throws:
LogException - if an error occurs during initialization

getInstanceName

public java.lang.String getInstanceName()
This method will return the log writer instance . It returns the log writer instance from the logging configuration file. The log writers can be indentified based on the respective log writer instance.
Specified by:
getInstanceName in interface LogWriter
Returns:
The log Writer instance is returned

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Method for adding PropertyChangeListener to this LogWriter instance. This can be used to get notification when any of the properties change.
Specified by:
addPropertyChangeListener in interface LogWriter
Parameters:
listener - PropertyChangeListener to be added

removePropertyChangeListener

public boolean removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Used to remove the registered PropertyChangeListener. On successful removal, this method will return true.
Specified by:
removePropertyChangeListener in interface LogWriter
Parameters:
listener - reference of PropertyChangeListener to be removed
Returns:
boolean value to indicate the result of the operation.


Copyright (c)AdventNet Inc., 1996-2004