FileDocCategorySizeDatePackage
AbstractLoggerFactory.javaAPI DocGlassfish v2 API4549Fri May 04 22:35:24 BST 2007com.sun.jdo.spi.persistence.utility.logging

AbstractLoggerFactory

public abstract class AbstractLoggerFactory extends Object implements LoggerFactory
author
Rochelle Raccah
version
%I%

Fields Summary
private static final String
_domainPrefix
private static final Map
_loggerCache
private static final String
_bundleName
Constructors Summary
Methods Summary
protected abstract LoggercreateLogger(java.lang.String absoluteLoggerName, java.lang.String bundleName, java.lang.ClassLoader loader)
Create a new Logger. Subclasses are responsible for creating a logger for the named component. The bundle name and class loader are passed to allow the implementation to properly find and construct the internationalization bundle.

param
absoluteLoggerName the absolute name of this logger
param
bundleName the fully qualified name of the resource bundle
param
loader the class loader used to load the resource bundle, or null
return
the logger

protected java.lang.StringgetAbsoluteLoggerName(java.lang.String relativeLoggerName)

		return (relativeLoggerName.startsWith("java") ?			//NOI18N
			relativeLoggerName : (getDomainRoot() + relativeLoggerName));
	
protected java.lang.StringgetDomainRoot()

 return _domainPrefix; 
protected static LoggergetErrorLogger()
Get the error logger which is used to log things during creation of loggers.

 // NOI18N


	               	 
	     
	
		return LogHelper.getLogger("", _bundleName,  // NOI18N
			AbstractLoggerFactory.class.getClassLoader());
	
public synchronized LoggergetLogger(java.lang.String relativeLoggerName, java.lang.String bundleName, java.lang.ClassLoader loader)
Get a Logger. The class that implements this interface is responsible for creating a logger for the named component. The bundle name and class loader are passed to allow the implementation to properly find and construct the internationalization bundle.

param
relativeLoggerName the relative name of this logger
param
bundleName the fully qualified name of the resource bundle
param
loader the class loader used to load the resource bundle, or null
return
the logger

		String absoluteLoggerName = getAbsoluteLoggerName(relativeLoggerName);
		Logger value = (Logger)_loggerCache.get(absoluteLoggerName);

		if (value == null)
		{
			value = createLogger(absoluteLoggerName, bundleName, loader);

			if (value != null)
				_loggerCache.put(absoluteLoggerName, value);
		}

		return value;