- 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.
Method from org.apache.commons.logging.impl.Log4jFactory Detail: |
public Object getAttribute(String name) {
return (attributes.get(name));
} Deprecated!Return the configuration attribute with the specified name (if any),
or null if there is no such attribute. |
public String[] getAttributeNames() {
Vector names = new Vector();
Enumeration keys = attributes.keys();
while (keys.hasMoreElements()) {
names.addElement((String) keys.nextElement());
}
String results[] = new String[names.size()];
for (int i = 0; i < results.length; i++) {
results[i] = (String) names.elementAt(i);
}
return (results);
} 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. |
public Log getInstance(Class clazz) throws LogConfigurationException {
Log instance = (Log) instances.get(clazz);
if( instance != null )
return instance;
instance=new Log4JLogger( Logger.getLogger( clazz ));
instances.put( clazz, instance );
return instance;
} Deprecated!Convenience method to derive a name from the specified class and
call getInstance(String) with it. |
public Log getInstance(String name) throws LogConfigurationException {
Log instance = (Log) instances.get(name);
if( instance != null )
return instance;
instance=new Log4JLogger( Logger.getLogger( name ));
instances.put( name, instance );
return instance;
} Deprecated! |
public void release() {
instances.clear();
// what's the log4j mechanism to cleanup ???
} 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. |
public void removeAttribute(String name) {
attributes.remove(name);
} Deprecated!Remove any configuration attribute associated with the specified name.
If there is no such attribute, no action is taken. |
public void setAttribute(String name,
Object value) {
if (value == null) {
attributes.remove(name);
} else {
attributes.put(name, value);
}
} Deprecated!Set the configuration attribute with the specified name. Calling
this with a null value is equivalent to calling
removeAttribute(name) . |