|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectledge.logging.LoggerFactory
public class LoggerFactory
Provides Logger objects to the components being initialized using Log4J.
Logger factory plugs into the container using
component customization mechanism,
and provides components that declare a dependency on a DNA Logger (using a
org.jcontainer.dna.Logger component parameter) with an initialized
and ready to go logger instance.
The default implementation creates Log4j loggers, but it can be easily extended to work with any other type of logger compatible with DNA.
The LoggerFactory component has the ability to transparently replace
the logger used by a component with another logger.
(This is done using Pico's ImplementationHidingComponentAdapter).
This might be useful for run-time administraiton, especially in case of Logger
objects that are immutable.
| Field Summary | |
|---|---|
private org.picocontainer.MutablePicoContainer |
loggerContainer
|
private LoggingConfigurator |
loggingConfigurator
|
| Constructor Summary | |
|---|---|
LoggerFactory(LoggingConfigurator loggingConfigurator)
Creates a new instance of Factory and installs apropriate component adapter. |
|
| Method Summary | |
|---|---|
protected String |
getComponentMarker(Object key)
Returns a marker for the component (used as key in the logger container). |
Class |
getCustomizedComponentImplementation()
Returns the type of the customized components. |
Object |
getCustomizedComponentInstance(org.picocontainer.PicoContainer container,
Object componentKey,
Class componentImplementaion)
Returns a customized component instance. |
org.jcontainer.dna.Logger |
getLogger(Object key)
Returns a logger for the specified component. |
void |
setLogger(Object key,
org.jcontainer.dna.Logger logger)
Sets the logger for the specified component. |
void |
verify(org.picocontainer.PicoContainer container)
Verifies if the customized component can be instantiated using the dependencies present in the associated container. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final LoggingConfigurator loggingConfigurator
private final org.picocontainer.MutablePicoContainer loggerContainer
| Constructor Detail |
|---|
public LoggerFactory(LoggingConfigurator loggingConfigurator)
We depend LoggingConfigurator to make sure that logging is configured before we create any logs.
loggingConfigurator - the LoggingConfigurator.| Method Detail |
|---|
public org.jcontainer.dna.Logger getLogger(Object key)
key - the component key.
public void setLogger(Object key,
org.jcontainer.dna.Logger logger)
key - the component key.logger - the logger.
public Object getCustomizedComponentInstance(org.picocontainer.PicoContainer container,
Object componentKey,
Class componentImplementaion)
throws org.picocontainer.PicoInitializationException,
org.picocontainer.PicoIntrospectionException,
UnsupportedKeyTypeException
getCustomizedComponentInstance in interface CustomizedComponentProvidercontainer - the container.componentKey - requesting component's key.componentImplementaion - requesting component's implmenetation class.
org.picocontainer.PicoInitializationException - if the customized component cannot be initialized.
org.picocontainer.PicoIntrospectionException - if the customized component cannot be initialized.
UnsupportedKeyTypeException - if the componentKey has unsupported type.public Class getCustomizedComponentImplementation()
getCustomizedComponentImplementation in interface CustomizedComponentProvider
public void verify(org.picocontainer.PicoContainer container)
throws org.picocontainer.PicoVerificationException
verify in interface CustomizedComponentProvidercontainer - the container.
org.picocontainer.PicoVerificationException - if the container does not contain required
dependencies.protected String getComponentMarker(Object key)
key - reqesting component key.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||