Log4j 1.3alpha-8

org.apache.log4j.spi
Interface LoggerRepositoryEx

All Superinterfaces:
LoggerRepository
All Known Implementing Classes:
Hierarchy

public interface LoggerRepositoryEx
extends LoggerRepository

A LoggerRepository is used to create and retrieve Loggers. The relation between loggers in a repository depends on the repository but typically loggers are arranged in a named hierarchy.

In addition to the creational methods, a LoggerRepository can be queried for existing loggers, can act as a point of registry for events related to loggers.

Since:
1.3
Author:
Ceki Gülcü, Mark Womack, Curt Arnold

Method Summary
 void addErrorItem(ErrorItem errorItem)
          Errors which cannot be logged, go to the error list
 void addLoggerEventListener(LoggerEventListener listener)
          Add a LoggerEventListener to the repository.
 void addLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
          Add a LoggerRepositoryEventListener to the repository.
 void fireConfigurationChangedEvent()
          Requests that a configuration changed event be sent to any registered LoggerRepositoryEventListener.
 void fireLevelChangedEvent(Logger logger)
          Requests that a level changed event be sent to any registered LoggerEventListener.
 void fireRemoveAppenderEvent(Category logger, Appender appender)
          Requests that a appender removed event be sent to any registered LoggerEventListener.
 List getErrorList()
          Errors which cannot be logged, go to the error list
 String getName()
          Get the name of this logger repository.
 Object getObject(String key)
          A LoggerRepository can also act as a store for various objects used by log4j components.
 PluginRegistry getPluginRegistry()
          Return the PluginRegisty for this LoggerRepository.
 Map getProperties()
          Get the properties specific for this repository.
 String getProperty(String key)
          Get the property of this repository.
 org.apache.log4j.scheduler.Scheduler getScheduler()
          Return the Scheduler for this LoggerRepository.
 boolean isPristine()
          Is the current configuration of the repository in its original (pristine) state?
 void putObject(String key, Object value)
          Store an object under 'key'.
 void removeLoggerEventListener(LoggerEventListener listener)
          Remove a LoggerEventListener from the repository.
 void removeLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
          Remove a LoggerRepositoryEventListener from the repository.
 void setName(String repoName)
          A logger repository is a named entity.
 void setPristine(boolean state)
          Set the pristine flag.
 void setProperty(String key, String value)
          Set a property of this repository.
 
Methods inherited from interface org.apache.log4j.spi.LoggerRepository
addHierarchyEventListener, emitNoAppenderWarning, exists, fireAddAppenderEvent, getCurrentCategories, getCurrentLoggers, getLogger, getLogger, getRootLogger, getThreshold, isDisabled, resetConfiguration, setThreshold, setThreshold, shutdown
 

Method Detail

addLoggerRepositoryEventListener

public void addLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
Add a LoggerRepositoryEventListener to the repository. The listener will be called when repository events occur.
Parameters:
listener - event listener, may not be null.
Since:
1.3

removeLoggerRepositoryEventListener

public void removeLoggerRepositoryEventListener(LoggerRepositoryEventListener listener)
Remove a LoggerRepositoryEventListener from the repository.
Parameters:
listener - listener.
Since:
1.3

addLoggerEventListener

public void addLoggerEventListener(LoggerEventListener listener)
Add a LoggerEventListener to the repository. The listener will be called when repository events occur.
Parameters:
listener - listener, may not be null.
Since:
1.3

removeLoggerEventListener

public void removeLoggerEventListener(LoggerEventListener listener)
Remove a LoggerEventListener from the repository.
Parameters:
listener - listener, may not be null.
Since:
1.3

getName

public String getName()
Get the name of this logger repository.
Returns:
name, may not be null.
Since:
1.3

setName

public void setName(String repoName)
A logger repository is a named entity.
Parameters:
repoName - new name, may not be null.
Since:
1.3

isPristine

public boolean isPristine()
Is the current configuration of the repository in its original (pristine) state?
Returns:
true if repository is in original state.
Since:
1.3

setPristine

public void setPristine(boolean state)
Set the pristine flag.
Parameters:
state - state
Since:
1.3
See Also:
isPristine()

fireRemoveAppenderEvent

public void fireRemoveAppenderEvent(Category logger,
                                    Appender appender)
Requests that a appender removed event be sent to any registered LoggerEventListener.
Parameters:
logger - The logger from which the appender was removed.
appender - The appender removed from the logger.
Since:
1.3

fireLevelChangedEvent

public void fireLevelChangedEvent(Logger logger)
Requests that a level changed event be sent to any registered LoggerEventListener.
Parameters:
logger - The logger which changed levels.
Since:
1.3

fireConfigurationChangedEvent

public void fireConfigurationChangedEvent()
Requests that a configuration changed event be sent to any registered LoggerRepositoryEventListener.
Since:
1.3

getPluginRegistry

public PluginRegistry getPluginRegistry()
Return the PluginRegisty for this LoggerRepository.
Returns:
plug in registry.
Since:
1.3

getScheduler

public org.apache.log4j.scheduler.Scheduler getScheduler()
Return the Scheduler for this LoggerRepository.
Returns:
scheduler.
Since:
1.3

getProperties

public Map getProperties()
Get the properties specific for this repository.
Returns:
property map.
Since:
1.3

getProperty

public String getProperty(String key)
Get the property of this repository.
Parameters:
key - property key.
Returns:
key value or null if not set.
Since:
1.3

setProperty

public void setProperty(String key,
                        String value)
Set a property of this repository.
Parameters:
key - key, may not be null.
value - new value, if null, property will be removed.
Since:
1.3

getErrorList

public List getErrorList()
Errors which cannot be logged, go to the error list
Returns:
List

addErrorItem

public void addErrorItem(ErrorItem errorItem)
Errors which cannot be logged, go to the error list
Parameters:
errorItem - an ErrorItem to add to the error list

getObject

public Object getObject(String key)
A LoggerRepository can also act as a store for various objects used by log4j components.
Parameters:
key - key, may not be null.
Returns:
The object stored under 'key'.
Since:
1.3

putObject

public void putObject(String key,
                      Object value)
Store an object under 'key'. If no object can be found, null is returned.
Parameters:
key - key, may not be null.
value - value, may be null.

Log4j 1.3alpha-8

Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.