Logback API
Version 0.9.8

ch.qos.logback.classic.selector
Class ContextJNDISelector

java.lang.Object
  extended by ch.qos.logback.classic.selector.ContextJNDISelector
All Implemented Interfaces:
ContextSelector

public class ContextJNDISelector
extends Object
implements ContextSelector

A class that allows the LoggerFactory to access an environment-based LoggerContext. To add in catalina.sh JAVA_OPTS="$JAVA_OPTS "-Dlogback.ContextSelector=JNDI""

Author:
Ceki Gülcü, Sébastien Pennec

Constructor Summary
ContextJNDISelector(LoggerContext context)
           
 
Method Summary
 LoggerContext detachLoggerContext(String loggerContextName)
           
 List<String> getContextNames()
           
 int getCount()
          Returns the number of managed contexts Used for testing purposes
 LoggerContext getDefaultLoggerContext()
           
 LoggerContext getLoggerContext()
           
 LoggerContext getLoggerContext(String name)
           
 void removeLocalContext()
           
 void setLocalContext(LoggerContext context)
          These methods are used by the LoggerContextFilter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextJNDISelector

public ContextJNDISelector(LoggerContext context)
Method Detail

getLoggerContext

public LoggerContext getLoggerContext()
Specified by:
getLoggerContext in interface ContextSelector

getDefaultLoggerContext

public LoggerContext getDefaultLoggerContext()
Specified by:
getDefaultLoggerContext in interface ContextSelector

detachLoggerContext

public LoggerContext detachLoggerContext(String loggerContextName)
Specified by:
detachLoggerContext in interface ContextSelector

getContextNames

public List<String> getContextNames()
Specified by:
getContextNames in interface ContextSelector

getLoggerContext

public LoggerContext getLoggerContext(String name)
Specified by:
getLoggerContext in interface ContextSelector

getCount

public int getCount()
Returns the number of managed contexts Used for testing purposes

Returns:
the number of managed contexts

setLocalContext

public void setLocalContext(LoggerContext context)
These methods are used by the LoggerContextFilter. They provide a way to tell the selector which context to use, thus saving the cost of a JNDI call at each new request.

Parameters:
context -

removeLocalContext

public void removeLocalContext()

Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.