|
TPTP 4.5.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.FileLoggerFactory
public class FileLoggerFactory
Implementation of the Apache Commons
org.apache.commons.logging.LogFacotry abstract class which represents a
proxy factory specific for org.eclipse.hyades.logging.commons.FileLogger 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.FileLogger instances but all
class loaders will be forced to use the org.eclipse.hyades.logging.commons.FileLogger 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.FileLoggerFactory...
- or -
System.setProperty("org.apache.commons.logging.LogFactory","org.eclipse.hyades.logging.commons.FileLoggerFactory");
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.FileLoggerFactory
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.FileLoggerFactory
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,
FileLogger| Field Summary |
|---|
| Fields inherited from class org.apache.commons.logging.LogFactory |
|---|
FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY |
| Constructor Summary | |
|---|---|
FileLoggerFactory()
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.FileLogger 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.FileLogger based on the
parameter name. |
void |
release()
Releases all cached org.eclipse.hyades.logging.commons.FileLogger instances
created by this
org.eclipse.hyades.logging.commons.FileLoggerFactory 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 |
|---|
getFactory, getLog, getLog, release, releaseAll |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileLoggerFactory()
| 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).
setAttribute in class org.apache.commons.logging.LogFactoryname - 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.
removeAttribute in class org.apache.commons.logging.LogFactoryname - 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.
getAttribute in class org.apache.commons.logging.LogFactoryname - Name of the requested configuration attribute.
null if
no such named attribute existsLogFactory.getAttribute(java.lang.String)public java.lang.String[] getAttributeNames()
getAttributeNames in class org.apache.commons.logging.LogFactoryLogFactory.getAttributeNames()
public org.apache.commons.logging.Log getInstance(java.lang.Class classInstance)
throws org.apache.commons.logging.LogConfigurationException
org.eclipse.hyades.logging.commons.FileLogger based on the
name of the parameter class instance.
An instance of a named
org.eclipse.hyades.logging.commons.FileLogger is created if no
named instance current exists or all instances have been released.
Once a named org.eclipse.hyades.logging.commons.FileLogger is
created, the instance is cached for future calls to retrieve the same
named org.eclipse.hyades.logging.commons.FileLogger.
The name of the org.eclipse.hyades.logging.commons.FileLogger
uniquely identifies an instance of an
org.eclipse.hyades.logging.commons.FileLogger. All subsequent
calls will return the same instance of the named
org.eclipse.hyades.logging.commons.FileLogger.
getInstance in class org.apache.commons.logging.LogFactoryclassInstance - Class instance used to derive the name of the returned
org.eclipse.hyades.logging.commons.FileLogger
instance.
org.eclipse.hyades.logging.commons.FileLogger
instance.
org.apache.commons.logging.LogConfigurationException - if the named
org.eclipse.hyades.logging.commons.FileLogger
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.FileLogger 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.FileLogger is created if no
named instance current exists or all instances have been released.
Once a named org.eclipse.hyades.logging.commons.FileLogger is
created, the instance is cached for future calls to retrieve the same
named org.eclipse.hyades.logging.commons.FileLogger.
The name of the org.eclipse.hyades.logging.commons.FileLogger
uniquely identifies an instance of an
org.eclipse.hyades.logging.commons.FileLogger. All subsequent
calls will return the same instance of the named
org.eclipse.hyades.logging.commons.FileLogger.
getInstance in class org.apache.commons.logging.LogFactoryloggerName - The non-null name of the returned
org.eclipse.hyades.logging.commons.FileLogger
instance.
org.eclipse.hyades.logging.commons.FileLogger
instance, otherwise null if the parameter logger
name is null.
org.apache.commons.logging.LogConfigurationException - if the named
org.eclipse.hyades.logging.commons.FileLogger
instance could not be created.LogFactory.getInstance(java.lang.String)public void release()
org.eclipse.hyades.logging.commons.FileLogger instances
created by this
org.eclipse.hyades.logging.commons.FileLoggerFactory instance.
All cached org.eclipse.hyades.logging.commons.FileLogger are
de-registered (e.g.
org.eclipse.hyades.logging.commons.FileLogger#finalize()
before being released.
release in class org.apache.commons.logging.LogFactoryLogFactory.release()
|
TPTP 4.5.0 Platform Project Public API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||