FileDocCategorySizeDatePackage
LoggerGetterBase.javaAPI DocGlassfish v2 API2914Fri May 04 22:31:06 BST 2007com.sun.appserv.management.util.misc

LoggerGetterBase

public abstract class LoggerGetterBase extends Object
A "future" for getting a Logger that might not be needed just now. Thread safe.

Fields Summary
private final String
mLoggerName
private volatile Logger
mLogger
Constructors Summary
public LoggerGetterBase(String loggerName)

        mLoggerName = loggerName;
        mLogger     = null;
    
Methods Summary
protected abstract java.util.logging.Logger_getLogger(java.lang.String loggerName)

public final java.util.logging.LoggergetLogger()

return
the Logger

        // if it's non-null, then it's safe to return it
        if ( mLogger != null )
        {
            return mLogger;
        }
        
        synchronized( this )
        {
            if ( mLogger == null )
            {
                mLogger = _getLogger( mLoggerName );
            }
        }
        return mLogger;