|
JBoss LogManager 1.1.0.CR6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.logmanager.ClassLoaderLogContextSelector
public final class ClassLoaderLogContextSelector
A log context selector which chooses a log context based on the caller's classloader. This selector maintains weak references to the classloader as well as the log context; if either is collected, the association is broken. Therefore, strong references must be kept external to this class.
Constructor Summary | |
---|---|
ClassLoaderLogContextSelector()
Construct a new instance. |
|
ClassLoaderLogContextSelector(LogContextSelector defaultSelector)
Construct a new instance. |
Method Summary | |
---|---|
LogContext |
getLogContext()
Get the current log context. |
void |
registerLogContext(ClassLoader classLoader,
LogContext logContext)
Register a class loader with a log context. |
boolean |
unregisterLogContext(ClassLoader classLoader,
LogContext logContext)
Unregister a class loader/log context association. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassLoaderLogContextSelector(LogContextSelector defaultSelector)
defaultSelector
- the selector to consult if no matching log context is foundpublic ClassLoaderLogContextSelector()
Method Detail |
---|
public LogContext getLogContext()
getLogContext
in interface LogContextSelector
public void registerLogContext(ClassLoader classLoader, LogContext logContext) throws IllegalArgumentException
registerLogContext
RuntimePermission
.
classLoader
- the classloaderlogContext
- the log context
IllegalArgumentException
- if the classloader is already associated with a log contextpublic boolean unregisterLogContext(ClassLoader classLoader, LogContext logContext)
unregisterLogContext
RuntimePermission
.
classLoader
- the classloaderlogContext
- the log context
true
if the association exists and was removed, false
otherwise
|
JBoss LogManager 1.1.0.CR6 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |