| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| private volatile boolean | |
| private final LogContext | |
| private final int | |
| private final Map | |
| private final Level |
| Access | Constructor and Description |
|---|---|
| public | |
| public | DelayedHandler(LogContext
the log context to use for level checks on replay, or logContext)null for noneConstruct a new instance, with the given log context used to recheck log levels on replay. |
| public | |
| public | DelayedHandler(LogContext
the log context to use for level checks on replay, or logContext, int null for nonethe queue limit queueLimit)Construct a new instance, with the given log context used to recheck log levels on replay. |
| public | DelayedHandler(int
the queue limit queueLimit, Level the threshold level to report queue overruns for warnThreshold)Construct a new instance. |
| public | DelayedHandler(LogContext
the log context to use for level checks on replay, or logContext, int null for nonethe queue limit queueLimit, Level the threshold level to report queue overruns for warnThreshold)Construct a new instance, with the given log context used to recheck log levels on replay. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | addHandler(final Handler
the handler to add handler)Overrides org. Add a sub-handler to this handler. |
| public Handler[] | clearHandlers()
Overrides org. A convenience method to atomically get and clear all sub-handlers. |
| public final void | close()
Overrides org. Implements java. Close all child handlers. |
| protected void | doPublish(final ExtLogRecord
the log record to publish record)Overrides org. Do the actual work of publication; the record will have been filtered already. |
| private Supplier | |
| private void | enqueueOrdered(Deque<ExtLogRecord>
the queue q, ExtLogRecord the record record)Enqueue the log record such that the queue's order (by sequence number) is maintained. |
| public final boolean | Returns: true if the handler has been activated, otherwise falseIndicates whether or not this handler has been activated. |
| public boolean | isCallerCalculationRequired()
Overrides org. Indicates whether or not the formatter associated with this handler or a formatter from a child handler requires the caller to be calculated. |
| private static <E> Deque | |
| public void | removeHandler(final Handler
the handler to remove handler)Overrides org. Remove a sub-handler from this handler. |
| public void | setCallerCalculationRequired(final boolean
true if the caller information
should always be calculated before the record is being placed in the queueSets whether or not caller information will be required when formatting records. |
| public Handler[] | setHandlers(final Handler[]
the new sub-handlers newHandlers)Overrides org. A convenience method to atomically get and replace the sub-handler array. |
| activated | back to summary |
|---|---|
| private volatile boolean activated | |
| callerCalculationRequired | back to summary |
|---|---|
| private volatile boolean callerCalculationRequired | |
| logContext | back to summary |
|---|---|
| private final LogContext logContext | |
| queueLimit | back to summary |
|---|---|
| private final int queueLimit | |
| queues | back to summary |
|---|---|
| private final Map<Level, Deque<ExtLogRecord>> queues | |
| warnThreshold | back to summary |
|---|---|
| private final Level warnThreshold | |
| DelayedHandler | back to summary |
|---|---|
| public DelayedHandler() Construct a new instance. | |
| DelayedHandler | back to summary |
|---|---|
| public DelayedHandler(LogContext logContext) Construct a new instance, with the given log context used to recheck log levels on replay.
| |
| DelayedHandler | back to summary |
|---|---|
| public DelayedHandler(int queueLimit) Construct a new instance. The given queue limit value is used to limit the length of each level queue.
| |
| DelayedHandler | back to summary |
|---|---|
| public DelayedHandler(LogContext logContext, int queueLimit) Construct a new instance, with the given log context used to recheck log levels on replay. The given queue limit value is used to limit the length of each level queue.
| |
| DelayedHandler | back to summary |
|---|---|
| public DelayedHandler(int queueLimit, Level warnThreshold) Construct a new instance. The given queue limit value is used to limit the length of each level queue. The warning threshold specifies that only queues with the threshold level or higher will report overrun errors.
| |
| DelayedHandler | back to summary |
|---|---|
| public DelayedHandler(LogContext logContext, int queueLimit, Level warnThreshold) Construct a new instance, with the given log context used to recheck log levels on replay. The given queue limit value is used to limit the length of each level queue. The warning threshold specifies that only queues with the threshold level or higher will report overrun errors.
| |
| activate | back to summary |
|---|---|
| private void activate() | |
| addHandler | back to summary |
|---|---|
| public void addHandler(final Handler handler) throws SecurityException Overrides org. Doc from org. Add a sub-handler to this handler. Some handler types do not utilize sub-handlers.
Note that once this is invoked the handler will be activated and the messages will no longer be queued. If more
than one child handler is required the
| |
| clearHandlers | back to summary |
|---|---|
| public Handler[] clearHandlers() throws SecurityException Overrides org. Doc from org. A convenience method to atomically get and clear all sub-handlers. Note that once this is invoked the handler will no longer be activated and messages will again be queued.
| |
| close | back to summary |
|---|---|
| public final void close() throws SecurityException Overrides org. Implements java. Doc from org. Close all child handlers.
| |
| doPublish | back to summary |
|---|---|
| protected void doPublish(final ExtLogRecord record) Overrides org. Doc from org. Do the actual work of publication; the record will have been filtered already. The default implementation
does nothing except to flush if the
| |
| drain | back to summary |
|---|---|
| private Supplier | |
| enqueueOrdered | back to summary |
|---|---|
| private void enqueueOrdered(Deque<ExtLogRecord> q, ExtLogRecord record) Enqueue the log record such that the queue's order (by sequence number) is maintained.
| |
| isActivated | back to summary |
|---|---|
| public final boolean isActivated() Indicates whether or not this handler has been activated.
| |
| isCallerCalculationRequired | back to summary |
|---|---|
| public boolean isCallerCalculationRequired() Overrides org. Doc from org. Indicates whether or not the formatter associated with this handler or a formatter from a child handler requires the caller to be calculated.
Calculating the caller on a log record can be an expensive operation. Some handlers
may be required to copy some data from the log record, but may not need the caller information. If the
formatter is a
This can be overridden to always require the caller calculation by setting the
| |
| newDeque | back to summary |
|---|---|
| private static <E> Deque | |
| removeHandler | back to summary |
|---|---|
| public void removeHandler(final Handler handler) throws SecurityException Overrides org. Doc from org. Remove a sub-handler from this handler. Some handler types do not utilize sub-handlers. Note that if the last child handler is removed the handler will no longer be activated and the messages will again be queued.
| |
| setCallerCalculationRequired | back to summary |
|---|---|
| public void setCallerCalculationRequired(final boolean callerCalculationRequired) Sets whether or not caller information will be required when formatting records.
If set to Note that the caller information is only attempted to be calculated when the handler has not been activated. Once activated it's up to the children handlers to determine how the record is processed.
| |
| setHandlers | back to summary |
|---|---|
| public Handler[] setHandlers(final Handler[] newHandlers) throws SecurityException Overrides org. Doc from org. A convenience method to atomically get and replace the sub-handler array. Note that once this is invoked the handler will be activated and the messages will no longer be queued.
| |