com.adventnet.afp.log
Class AbstractLogger
java.lang.Object
|
+--com.adventnet.afp.log.AbstractLogger
- All Implemented Interfaces:
- Logger
- Direct Known Subclasses:
- DefaultLogger, LoggerImpl
- public abstract class AbstractLogger
- extends java.lang.Object
- implements Logger
This class is the abstract class that implements the Logger interface. This class provides methods for
listening mechanism. The registered listeners will be notified during any change in the Logger
properties. It implements important methods provided by the Logger interface.
- See Also:
Logger
Constructor Summary |
AbstractLogger()
Creates a new AbstractLogger instance with the default Logger properties. |
Method Summary |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
This method is used to add the PropertyChangeListener to the Logger instance. |
java.lang.String |
getInstanceName()
To get the Instance Name of the Logger by which it is known. |
int |
getLogLevel()
The getLogLevel method is used to get the current Logging level of the Logger. |
void |
init(LoggerProperties loggerProps,
LogWriter logWriter)
The init method is used to intialize the logger. |
boolean |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
This method is used to remove the listener who does not want to get notified during any change
in the properties of the Logger. |
void |
setLogLevel(int level)
The setLogLevel method is used to specify the Log level of the Logger. |
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.Logger |
err, err, out |
loggingLevel
protected int loggingLevel
listeners
protected java.util.Vector listeners
AbstractLogger
public AbstractLogger()
- Creates a new
AbstractLogger
instance with the default Logger properties.
init
public void init(LoggerProperties loggerProps,
LogWriter logWriter)
throws LogException
- The
init
method is used to intialize the logger. A logger will become active
and would start handling inputs only after it is initialized.
- Specified by:
init
in interface Logger
- Parameters:
loggerProps
- specifies the properties of the LoggerlogWriter
- a LogWriter
instance to which the Logger has to be associated.- Throws:
LogException
- if an error occurs during initialization
setLogLevel
public void setLogLevel(int level)
- The
setLogLevel
method is used to specify the Log level of the Logger.
Only messages whose Log level is less than or equal to the Logger's will be logged.
- Specified by:
setLogLevel
in interface Logger
- Parameters:
level
- an int
value
getLogLevel
public int getLogLevel()
- The
getLogLevel
method is used to get the current Logging level of the Logger.
- Specified by:
getLogLevel
in interface Logger
- Returns:
- an
int
value
getInstanceName
public java.lang.String getInstanceName()
- To get the Instance Name of the Logger by which it is known.
- Specified by:
getInstanceName
in interface Logger
- Returns:
- a
String
value
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
- This method is used to add the PropertyChangeListener to the Logger instance. On the Change of
any property in this implementation all registered listeners for property change will be notified
about it.
- Specified by:
addPropertyChangeListener
in interface Logger
- Parameters:
listener
- Listener who register for notification during any change in the properties.
removePropertyChangeListener
public boolean removePropertyChangeListener(java.beans.PropertyChangeListener listener)
- This method is used to remove the listener who does not want to get notified during any change
in the properties of the Logger.
- Specified by:
removePropertyChangeListener
in interface Logger
- Parameters:
listener
- Listener who unregister for notification during any change in properties.
Copyright (c)AdventNet Inc., 1996-2004