|
Log4j 1.3alpha-5 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log4j.spi.ComponentBase | +--org.apache.log4j.plugins.PluginSkeleton
A convienent abstract class for plugin subclasses that implements the basic methods of the Plugin interface. Subclasses are required to implement the isActive(), activateOptions(), and shutdown() methods.
Developers are not required to subclass PluginSkeleton to develop their own plugins (they are only required to implement the Plugin interface), but it provides a convenient base class to start from. Contributors: Nicko Cadell
Field Summary | |
protected boolean |
active
|
protected java.lang.String |
name
Name of this plugin. |
Fields inherited from class org.apache.log4j.spi.ComponentBase |
repository |
Constructor Summary | |
PluginSkeleton()
|
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener that will be notified of all property changes. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this instance which is notified only by changes of the property with name propertyName |
protected void |
firePropertyChange(java.beans.PropertyChangeEvent evt)
|
protected void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue)
|
protected void |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue)
|
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue)
|
LoggerRepository |
getLoggerRepository()
Gets the logger repository for this plugin. |
java.lang.String |
getName()
Gets the name of the plugin. |
boolean |
isActive()
Returns whether this plugin is Active or not |
boolean |
isEquivalent(Plugin testPlugin)
Returns true if the plugin has the same name and logger repository as the testPlugin passed in. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a specific PropertyChangeListener from this instances registry that has been mapped to be notified of all property changes. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes a specific PropertyChangeListener from this instance's registry which has been previously registered to be notified of only a specific property change. |
void |
setLoggerRepository(LoggerRepository repository)
Sets the logger repository used by this plugin and notifies an relevant PropertyChangeListeners registered. |
void |
setName(java.lang.String name)
Sets the name of the plugin and notifies PropertyChangeListeners of the change |
Methods inherited from class org.apache.log4j.spi.ComponentBase |
getLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.log4j.plugins.Plugin |
shutdown |
Methods inherited from interface org.apache.log4j.spi.OptionHandler |
activateOptions |
Field Detail |
protected java.lang.String name
protected boolean active
Constructor Detail |
public PluginSkeleton()
Method Detail |
public java.lang.String getName()
getName
in interface Plugin
public void setName(java.lang.String name)
setName
in interface Plugin
name
- the name of the plugin to set.public LoggerRepository getLoggerRepository()
getLoggerRepository
in interface Plugin
public void setLoggerRepository(LoggerRepository repository)
setLoggerRepository
in interface Plugin
setLoggerRepository
in class ComponentBase
repository
- the logger repository that this plugin should affect.public boolean isActive()
isActive
in interface Plugin
public boolean isEquivalent(Plugin testPlugin)
isEquivalent
in interface Plugin
testPlugin
- The plugin to test equivalency against.
public final void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Plugin
addPropertyChangeListener
in interface Plugin
listener
- public final void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Plugin
addPropertyChangeListener
in interface Plugin
propertyName
- listener
- public final void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Plugin
removePropertyChangeListener
in interface Plugin
listener
- public final void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
Plugin
removePropertyChangeListener
in interface Plugin
propertyName
- listener
- protected final void firePropertyChange(java.beans.PropertyChangeEvent evt)
evt
- protected final void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
propertyName
- oldValue
- newValue
- protected final void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
propertyName
- oldValue
- newValue
- protected final void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
propertyName
- oldValue
- newValue
-
|
Log4j 1.3alpha-5 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |