|
TPTP 4.4.0 Platform Project Public API Specification |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.commons.logging.LogFactory
org.eclipse.hyades.logging.commons.LoggerFactory
Implementation of the Apache Commons
org.apache.commons.logging.LogFacotry abstract class which represents a
proxy factory specific for org.eclipse.hyades.logging.commons.Logger instances.
This proxy factory is intended for use in multiple class loader environments where
one or more different types of loggers and their factories are required for each
separate class loader, all utilizing the same Apache Commons binaries. Alternatively,
users may configure the default org.apache.commons.logging.LogFactory implementation
to use the generate org.eclipse.hyades.logging.commons.Logger instances but all
class loaders will be forced to use the org.eclipse.hyades.logging.commons.Logger instances.
An instance of this class will be returned from the static getFactory()
API on the default org.apache.commons.logging.LogFactory implementation. The
org.apache.commons.logging.LogFactory implementation uses the
following discovery process to resolve the configured
org.apache.commons.logging.LogFactory implementation within the caller's class
loader:
1) Look for a system property named
org.apache.commons.logging.LogFactory.
For example,
...-Dorg.apache.commons.logging.LogFactory=org.eclipse.hyades.logging.commons.LoggerFactory...
- or -
System.setProperty("org.apache.commons.logging.LogFactory","org.eclipse.hyades.logging.commons.LoggerFactory");
2) Use the JDK 1.3 JAR Services Discovery mechanism (see http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html)
to look for a resource named META-INF/services/org.apache.commons.logging.LogFactory whose first
line is assumed to contain the desired class name.
For example (META-INF/services/org.apache.commons.logging.LogFactory),
org.eclipse.hyades.logging.commons.LoggerFactory
2) Look for a properties file named commons-logging.properties visible in the application class path,
with a property named org.apache.commons.logging.LogFactory defining the desired implementation class name.
For example,
org.apache.commons.logging.LogFactory=org.eclipse.hyades.logging.commons.LoggerFactory
NOTE: Although this proxy factory provides functionality for setting/getting/removing configuration attributes, no configuration attributes are used internally. As such, setting any configuration attributes will have no effect aside from containment purposes.
NOTE: The Apache Commons logging classes must be on the CLASSPATH at run-time to utilize this logging class
LogFactory,
Logger| Field Summary | |
|---|---|
protected java.util.Hashtable |
loggers
Private store of org.eclipse.hyades.logging.commons.Logger instances. |
| Fields inherited from class org.apache.commons.logging.LogFactory |
|---|
factories, FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY, SERVICE_ID |
| Constructor Summary | |
|---|---|
LoggerFactory()
No-argument constructor. |
|
| Method Summary | |
|---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Returns the configuration attribute with the specified non-null name, or null if no such named attribute exists.
|
java.lang.String[] |
getAttributeNames()
Returns an array containing the names of all currently defined configuration attributes. |
org.apache.commons.logging.Log |
getInstance(java.lang.Class classInstance)
Convenience API which returns an instance of a named org.eclipse.hyades.logging.commons.Logger based on the
name of the parameter class instance.
|
org.apache.commons.logging.Log |
getInstance(java.lang.String loggerName)
Returns an instance of a non-null named org.eclipse.hyades.logging.commons.Logger based on the
parameter name.
|
void |
release()
Releases all cached org.eclipse.hyades.logging.commons.Logger instances
created by this
org.eclipse.hyades.logging.commons.LoggerFactory instance.
|
void |
removeAttribute(java.lang.String name)
Removes a configuration attribute with the specified non-null name. |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Set a configuration attribute with the specified non-null 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 |
| Field Detail |
protected java.util.Hashtable loggers
org.eclipse.hyades.logging.commons.Logger instances.
| Constructor Detail |
public LoggerFactory()
| Method Detail |
public void setAttribute(java.lang.String name,
java.lang.Object value)
Passing a null name results in no action.
Passing a null value is equivalent to calling
#removeAttribute(String).
name - The non-null name of the configuration attribute.value - The value of the configuration attribute, or null
to remove the named configuration attribute.LogFactory.setAttribute(java.lang.String,
java.lang.Object)public void removeAttribute(java.lang.String name)
Passing a null name results in a no-operation.
name - The non-null name of the configuration attribute to be
removed.LogFactory.removeAttribute(java.lang.String)public java.lang.Object getAttribute(java.lang.String name)
null if no such named attribute exists.
Passing a null name results in a null
return value.
name - Name of the requested configuration attribute.
null if
no such named attribute existsLogFactory.getAttribute(java.lang.String)public java.lang.String[] getAttributeNames()
LogFactory.getAttributeNames()
public org.apache.commons.logging.Log getInstance(java.lang.Class classInstance)
throws org.apache.commons.logging.LogConfigurationException
org.eclipse.hyades.logging.commons.Logger based on the
name of the parameter class instance.
An instance of a named
org.eclipse.hyades.logging.commons.Logger is created if no
named instance current exists or all instances have been released.
Once a named org.eclipse.hyades.logging.commons.Logger is
created, the instance is cached for future calls to retrieve the same
named org.eclipse.hyades.logging.commons.Logger.
The name of the org.eclipse.hyades.logging.commons.Logger
uniquely identifies an instance of an
org.eclipse.hyades.logging.commons.Logger. All subsequent
calls will return the same instance of the named
org.eclipse.hyades.logging.commons.Logger.
classInstance - Class instance used to derive the name of the returned
org.eclipse.hyades.logging.commons.Logger
instance.
org.eclipse.hyades.logging.commons.Logger
instance.
org.apache.commons.logging.LogConfigurationException - if the named
org.eclipse.hyades.logging.commons.Logger
instance could not be created.LogFactory.getInstance(java.lang.Class),
getInstance(String)
public org.apache.commons.logging.Log getInstance(java.lang.String loggerName)
throws org.apache.commons.logging.LogConfigurationException
org.eclipse.hyades.logging.commons.Logger based on the
parameter name.
Passing a null logger name results in a null
return value.
An instance of a named
org.eclipse.hyades.logging.commons.Logger is created if no
named instance current exists or all instances have been released.
Once a named org.eclipse.hyades.logging.commons.Logger is
created, the instance is cached for future calls to retrieve the same
named org.eclipse.hyades.logging.commons.Logger.
The name of the org.eclipse.hyades.logging.commons.Logger
uniquely identifies an instance of an
org.eclipse.hyades.logging.commons.Logger. All subsequent
calls will return the same instance of the named
org.eclipse.hyades.logging.commons.Logger.
loggerName - The non-null name of the returned
org.eclipse.hyades.logging.commons.Logger
instance.
org.eclipse.hyades.logging.commons.Logger
instance, otherwise null if the parameter logger
name is null.
org.apache.commons.logging.LogConfigurationException - if the named
org.eclipse.hyades.logging.commons.Logger
instance could not be created.LogFactory.getInstance(java.lang.String)public void release()
org.eclipse.hyades.logging.commons.Logger instances
created by this
org.eclipse.hyades.logging.commons.LoggerFactory instance.
All cached org.eclipse.hyades.logging.commons.Logger are
de-registered (e.g.
org.eclipse.hyades.logging.commons.Logger#finalize()
before being released.
LogFactory.release()
|
TPTP 4.4.0 Platform Project Public API Specification |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||