org.apache.commons.logging.impl
Class Log4jFactory

java.lang.Object
  |
  +--org.apache.commons.logging.LogFactory
        |
        +--org.apache.commons.logging.impl.Log4jFactory

Deprecated. Per discussion on COMMONS-DEV, the behind-the-scenes use of this class as a proxy factory has been removed. For 1.0, you can still request it directly if you wish, but it doesn't really do anything useful, and will be removed in 1.1.

public final class Log4jFactory
extends LogFactory

Concrete subclass of LogFactory specific to log4j.

Author:
Costin Manolache

Field Summary
 
Fields inherited from class org.apache.commons.logging.LogFactory
factories, FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY, SERVICE_ID
 
Constructor Summary
Log4jFactory()
          Deprecated.  
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Deprecated. Return the configuration attribute with the specified name (if any), or null if there is no such attribute.
 java.lang.String[] getAttributeNames()
          Deprecated. Return an array containing the names of all currently defined configuration attributes.
 org.apache.commons.logging.Log getInstance(java.lang.Class clazz)
          Deprecated. Convenience method to derive a name from the specified class and call getInstance(String) with it.
 org.apache.commons.logging.Log getInstance(java.lang.String name)
          Deprecated. Construct (if necessary) and return a Log instance, using the factory's current set of configuration attributes.
 void release()
          Deprecated. Release any internal references to previously created Log instances returned by this factory.
 void removeAttribute(java.lang.String name)
          Deprecated. Remove any configuration attribute associated with the specified name.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Deprecated. Set the configuration attribute with the specified name.
 
Methods inherited from class org.apache.commons.logging.LogFactory
getContextClassLoader, getFactory, getLog, getLog, newFactory, release, releaseAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log4jFactory

public Log4jFactory()
Deprecated. 
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Deprecated. 
Return the configuration attribute with the specified name (if any), or null if there is no such attribute.

Specified by:
getAttribute in class LogFactory
Parameters:
name - Name of the attribute to return

getAttributeNames

public java.lang.String[] getAttributeNames()
Deprecated. 
Return an array containing the names of all currently defined configuration attributes. If there are no such attributes, a zero length array is returned.

Specified by:
getAttributeNames in class LogFactory

getInstance

public org.apache.commons.logging.Log getInstance(java.lang.Class clazz)
                                           throws LogConfigurationException
Deprecated. 
Convenience method to derive a name from the specified class and call getInstance(String) with it.

Specified by:
getInstance in class LogFactory
Parameters:
clazz - Class for which a suitable Log name will be derived
Throws:
LogConfigurationException - if a suitable Log instance cannot be returned

getInstance

public org.apache.commons.logging.Log getInstance(java.lang.String name)
                                           throws LogConfigurationException
Deprecated. 
Description copied from class: LogFactory

Construct (if necessary) and return a Log instance, using the factory's current set of configuration attributes.

NOTE - Depending upon the implementation of the LogFactory you are using, the Log instance you are returned may or may not be local to the current application, and may or may not be returned again on a subsequent call with the same name argument.

Specified by:
getInstance in class LogFactory
Parameters:
name - Logical name of the Log instance to be returned (the meaning of this name is only known to the underlying logging implementation that is being wrapped)
Throws:
LogConfigurationException - if a suitable Log instance cannot be returned

release

public void release()
Deprecated. 
Release any internal references to previously created Log instances returned by this factory. This is useful in environments like servlet containers, which implement application reloading by throwing away a ClassLoader. Dangling references to objects in that class loader would prevent garbage collection.

Specified by:
release in class LogFactory

removeAttribute

public void removeAttribute(java.lang.String name)
Deprecated. 
Remove any configuration attribute associated with the specified name. If there is no such attribute, no action is taken.

Specified by:
removeAttribute in class LogFactory
Parameters:
name - Name of the attribute to remove

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Deprecated. 
Set the configuration attribute with the specified name. Calling this with a null value is equivalent to calling removeAttribute(name).

Specified by:
setAttribute in class LogFactory
Parameters:
name - Name of the attribute to set
value - Value of the attribute to set, or null to remove any setting for this attribute


Copyright © 2001-2004 The Apache Software Foundation. All Rights Reserved.