public abstract class ExtHandler extends Handler implements FlushableCloseable
ExtLogRecord
instances.| Modifier and Type | Field and Description |
|---|---|
protected Handler[] |
handlers
The sub-handlers for this handler.
|
protected static org.jboss.logmanager.AtomicArray<ExtHandler,Handler> |
handlersUpdater
The atomic updater for the
handlers field. |
| Modifier | Constructor and Description |
|---|---|
protected |
ExtHandler()
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(Handler handler)
Add a sub-handler to this handler.
|
protected static void |
checkAccess()
Check access.
|
Handler[] |
clearHandlers()
A convenience method to atomically get and clear all sub-handlers.
|
protected void |
doPublish(ExtLogRecord record)
Do the actual work of publication; the record will have been filtered already.
|
Handler[] |
getHandlers()
Get a copy of the sub-handlers array.
|
boolean |
isAutoFlush()
Determine if this handler will auto-flush.
|
void |
publish(ExtLogRecord record)
Publish an
ExtLogRecord. |
void |
publish(LogRecord record) |
void |
removeHandler(Handler handler)
Remove a sub-handler from this handler.
|
void |
setAutoFlush(boolean autoFlush)
Change the autoflush setting for this handler.
|
Handler[] |
setHandlers(Handler[] newHandlers)
A convenience method to atomically get and replace the sub-handler array.
|
close, flush, getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevelprotected volatile Handler[] handlers
handlersUpdater atomic updater. The array
instance should not be modified (treat as immutable).protected static final org.jboss.logmanager.AtomicArray<ExtHandler,Handler> handlersUpdater
handlers field.public final void publish(ExtLogRecord record)
ExtLogRecord.
The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.
The ExtHandler is responsible for formatting the message, when and if necessary. The formatting should
include localization.record - the log record to publishprotected void doPublish(ExtLogRecord record)
autoFlush property is set to true; if this behavior is to be
preserved in a subclass then this method should be called after the record is physically written.record - the log record to publishpublic void addHandler(Handler handler) throws SecurityException
handler - the handler to addSecurityException - if a security manager exists and if the caller does not have LoggingPermission(control)public void removeHandler(Handler handler) throws SecurityException
handler - the handler to removeSecurityException - if a security manager exists and if the caller does not have LoggingPermission(control)public Handler[] getHandlers()
public Handler[] clearHandlers() throws SecurityException
SecurityException - if a security manager exists and if the caller does not have LoggingPermission(control)public Handler[] setHandlers(Handler[] newHandlers) throws SecurityException
newHandlers - the new sub-handlersSecurityException - if a security manager exists and if the caller does not have LoggingPermission(control)public boolean isAutoFlush()
true if auto-flush is enabledpublic void setAutoFlush(boolean autoFlush)
throws SecurityException
autoFlush - true to automatically flush after each write; false otherwiseSecurityException - if a security manager exists and if the caller does not have LoggingPermission(control)protected static void checkAccess()
throws SecurityException
SecurityException - if a security manager is installed and the caller does not have the "control" LoggingPermissionCopyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.