Javolution 6.0.0 java
|
Public Member Functions | |
void | prefix (Object... pfx) |
void | setLevel (Level level) |
void | suffix (Object... sfx) |
abstract void | setLevel (Level level) |
void | exit () |
Static Public Member Functions | |
static void | debug (Object... message) |
static LogContext | enter () |
static< T extends AbstractContext > T | enter (Class< T > custom) |
static void | error (Object... message) |
static void | info (Object... message) |
static void | warning (Object... message) |
static AbstractContext | current () |
static void | inherit (AbstractContext ctx) |
Static Public Attributes | |
static final Configurable< Level > | LEVEL |
Protected Member Functions | |
LogContext | inner () |
void | log (Level level, Object... message) |
abstract void | log (Level level, Object... message) |
AbstractContext | enterInner () |
AbstractContext | getOuter () |
Static Protected Member Functions | |
static< T extends AbstractContext > T | current (Class< T > type) |
Private Member Functions | |
Level | currentLevel () |
Static Private Member Functions | |
static LogContext | currentLogContext () |
Private Attributes | |
Level | level |
Object[] | prefix = NONE |
Object[] | suffix = NONE |
AbstractContext | outer |
Static Private Attributes | |
static final Object[] | NONE = new Object[0] |
static final int[] | TO_OSGI_LEVEL |
static final ThreadLocal< AbstractContext > | CURRENT = new ThreadLocal<AbstractContext>() |
The default implementation of LogContext.
Definition at line 20 of file LogContextImpl.java.
|
staticinherited |
Returns the current context for the current thread or
if this thread has no context (default).
Definition at line 61 of file AbstractContext.java.
References javolution.context.AbstractContext.CURRENT.
Referenced by javolution.context.LogContext.currentLogContext(), javolution.context.SecurityContext.currentSecurityContext(), javolution.text.TextContext.currentTextContext(), javolution.xml.XMLContext.currentXMLContext(), javolution.context.LocalContext.enter(), javolution.context.ConcurrentContext.enter(), and javolution.context.LocalContext.Parameter< T >.get().
|
staticprotectedinherited |
Returns the current context of specified type or
if none.
Definition at line 69 of file AbstractContext.java.
References javolution.context.AbstractContext.CURRENT, and javolution.context.AbstractContext.outer.
|
private |
Definition at line 86 of file LogContextImpl.java.
References javolution.context.LogContext.Level.DEBUG, javolution.context.internal.LogContextImpl.level, and javolution.context.LogContext.LEVEL.
Referenced by javolution.context.internal.LogContextImpl.log().
|
staticprivateinherited |
Definition at line 120 of file LogContext.java.
References javolution.context.AbstractContext.current(), and javolution.osgi.internal.OSGiServices.getLogContext().
Referenced by javolution.context.LogContext.debug(), javolution.context.LogContext.enter(), javolution.context.LogContext.error(), javolution.context.LogContext.info(), and javolution.context.LogContext.warning().
|
staticinherited |
Logs the specified debug message.
Definition at line 87 of file LogContext.java.
References javolution.context.LogContext.currentLogContext(), javolution.context.LogContext.Level.DEBUG, and javolution.context.LogContext.log().
Referenced by javolution.lang.Configurable< javolution.context.LogContext.Level >.Configurable(), javolution.osgi.internal.ConfigurableListenerImpl.configurableInitialized(), javolution.osgi.internal.ConfigurableListenerImpl.configurableReconfigured(), javolution.lang.Initializer.initializeLoadedClasses(), javolution.lang.Initializer.loadClass(), and javolution.test.Perfometer< T >.printDetails().
|
staticinherited |
Enters and returns a new log context instance.
Definition at line 94 of file LogContext.java.
References javolution.context.LogContext.currentLogContext(), and javolution.context.AbstractContext.enterInner().
|
staticinherited |
Enters the scope of a custom context. This method raises a SecurityException if the permission to enter contexts of the specified class is not granted. For example, the following disallow entering any custom context. [code] SecurityContext ctx = SecurityContext.enter(); try { ctx.revoke(new SecurityContext.Permission(AbstractContext.class, "enter")); ... // Cannot enter any custom context. } finally { ctx.exit(); // Back to previous security settings. }[/code]
custom | the custom context to enter. |
IllegalArgumentException | if the specified class default constructor cannot be instantiated. |
SecurityException | if SecurityContext.Permission(custom, "enter")
is not granted. |
Definition at line 101 of file AbstractContext.java.
References javolution.context.SecurityContext.check().
|
protectedinherited |
Enters the scope of an inner context which becomes the current context; the previous current context becomes the outer of this context.
Definition at line 141 of file AbstractContext.java.
References javolution.context.AbstractContext.CURRENT, and javolution.context.AbstractContext.outer.
Referenced by javolution.xml.XMLContext.enter(), javolution.text.TextContext.enter(), javolution.context.LogContext.enter(), javolution.context.LocalContext.enter(), javolution.context.SecurityContext.enter(), and javolution.context.ConcurrentContext.enter().
|
staticinherited |
Logs the specified error message (which may include any Throwable instance).
Definition at line 102 of file LogContext.java.
References javolution.context.LogContext.currentLogContext(), javolution.context.LogContext.Level.ERROR, and javolution.context.LogContext.log().
Referenced by javolution.lang.Initializer.initializeLoadedClasses().
|
inherited |
Exits the scope of this context; the outer of this context becomes
the current context.
IllegalStateException | if this context is not the current context. |
Reimplemented in javolution.context.ConcurrentContext, and javolution.context.internal.ConcurrentContextImpl.
Definition at line 155 of file AbstractContext.java.
References javolution.context.AbstractContext.CURRENT.
|
protectedinherited |
Returns the outer context of this context or
if this context has no outer context.
Definition at line 167 of file AbstractContext.java.
|
staticinherited |
Logs the specified info message.
Definition at line 109 of file LogContext.java.
References javolution.context.LogContext.currentLogContext(), javolution.context.LogContext.Level.INFO, and javolution.context.LogContext.log().
Referenced by javolution.xml.internal.stream.XMLStreamReaderImpl.increaseDataBuffer(), javolution.xml.internal.stream.XMLStreamReaderImpl.increaseStack(), and javolution.test.Perfometer< T >.print().
|
staticinherited |
Inherits the specified context which becomes the context of the current thread. This method is particularly useful when creating new threads to make them inherits from the context stack of the parent thread. [code] //Spawns a new thread inheriting the context of the current thread. MyThread myThread = new MyThread(); myThread.inherited = AbstractContext.current(); myThread.start(); ... class MyThread extends Thread { AbstractContext inherited; public void run() { AbstractContext.inherit(inherited); // Sets current context. ... } }[/code]
Definition at line 131 of file AbstractContext.java.
Referenced by javolution.context.internal.ConcurrentThreadImpl.run().
|
protected |
Returns a new inner instance of this context inheriting the properties of this context. The new instance can be configured independently from its parent.
Reimplemented from javolution.context.AbstractContext.
Definition at line 52 of file LogContextImpl.java.
References javolution.context.internal.LogContextImpl.level, javolution.context.internal.LogContextImpl.prefix, and javolution.context.internal.LogContextImpl.suffix.
|
protected |
Definition at line 61 of file LogContextImpl.java.
References javolution.text.TextBuilder.append(), javolution.context.internal.LogContextImpl.currentLevel(), javolution.osgi.internal.OSGiServices.getLogServices(), javolution.context.internal.LogContextImpl.level, javolution.context.internal.LogContextImpl.prefix, javolution.context.internal.LogContextImpl.suffix, javolution.context.internal.LogContextImpl.TO_OSGI_LEVEL, and javolution.text.TextBuilder.toString().
|
abstractprotectedinherited |
Logs the specified message at the specified level.
Referenced by javolution.context.LogContext.debug(), javolution.context.LogContext.error(), javolution.context.LogContext.info(), and javolution.context.LogContext.warning().
void javolution.context.internal.LogContextImpl.prefix | ( | Object... | prefixes | ) |
Prefixes all messages being logged by the specified prefixes (prefixing existing prefixes if any).
Reimplemented from javolution.context.LogContext.
Definition at line 31 of file LogContextImpl.java.
References javolution.context.internal.LogContextImpl.prefix.
void javolution.context.internal.LogContextImpl.setLevel | ( | Level | level | ) |
Definition at line 39 of file LogContextImpl.java.
References javolution.context.internal.LogContextImpl.level.
|
abstractinherited |
Set the logging level, messages below that level are not logged.
void javolution.context.internal.LogContextImpl.suffix | ( | Object... | suffixes | ) |
Suffixes all messages being logged by the specified suffixes (suffixing existing suffixes if any).
Reimplemented from javolution.context.LogContext.
Definition at line 44 of file LogContextImpl.java.
References javolution.context.internal.LogContextImpl.suffix.
|
staticinherited |
Logs the specified warning message.
Definition at line 116 of file LogContext.java.
References javolution.context.LogContext.currentLogContext(), javolution.context.LogContext.log(), and javolution.context.LogContext.Level.WARNING.
Referenced by javolution.text.internal.TextContextImpl.searchFormat().
|
staticprivateinherited |
Holds the last context entered (thread-local).
Definition at line 45 of file AbstractContext.java.
Referenced by javolution.context.AbstractContext.current(), javolution.context.AbstractContext.enterInner(), and javolution.context.AbstractContext.exit().
|
private |
|
staticinherited |
Holds the default logging level (DEBUG
). This level is configurable. For example, running with the option -Djavolution.context.LogContextLEVEL=WARNING
causes the debug/info not to be logged.
Definition at line 73 of file LogContext.java.
Referenced by javolution.context.internal.LogContextImpl.currentLevel().
|
staticprivate |
Definition at line 22 of file LogContextImpl.java.
|
privateinherited |
Holds the outer context or
if none (top context).
Definition at line 50 of file AbstractContext.java.
Referenced by javolution.context.AbstractContext.current(), and javolution.context.AbstractContext.enterInner().
|
private |
Definition at line 27 of file LogContextImpl.java.
Referenced by javolution.context.internal.LogContextImpl.inner(), javolution.context.internal.LogContextImpl.log(), and javolution.context.internal.LogContextImpl.prefix().
|
private |
Definition at line 28 of file LogContextImpl.java.
Referenced by javolution.context.internal.LogContextImpl.inner(), javolution.context.internal.LogContextImpl.log(), and javolution.context.internal.LogContextImpl.suffix().
|
staticprivate |
Definition at line 23 of file LogContextImpl.java.
Referenced by javolution.context.internal.LogContextImpl.log().