Class AsyncLoggerDisruptor
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.async.logger.AsyncLoggerDisruptor
- All Implemented Interfaces:
LifeCycle
Helper class for async loggers: AsyncLoggerDisruptor handles the mechanics of working with the LMAX Disruptor, and
works with its associated AsyncLoggerContext to synchronize the life cycle of the Disruptor and its thread with the
life cycle of the context. The AsyncLoggerDisruptor of the context is shared by all AsyncLogger objects created by
that AsyncLoggerContext.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncLoggerDisruptor
(String contextName, AsyncQueueFullPolicy asyncQueueFullPolicy, com.lmax.disruptor.WaitStrategy waitStrategy, AsyncLoggerProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
setContextName
(String name) void
start()
Creates and starts a new Disruptor and associated thread if none currently exists.boolean
Decreases the reference count.Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
Constructor Details
-
AsyncLoggerDisruptor
public AsyncLoggerDisruptor(String contextName, AsyncQueueFullPolicy asyncQueueFullPolicy, com.lmax.disruptor.WaitStrategy waitStrategy, AsyncLoggerProperties properties)
-
-
Method Details
-
getContextName
-
setContextName
-
start
public void start()Creates and starts a new Disruptor and associated thread if none currently exists.- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classAbstractLifeCycle
- See Also:
-
stop
Decreases the reference count. If the reference count reached zero, the Disruptor and its associated thread are shut down and their references set tonull
.- Specified by:
stop
in interfaceLifeCycle
- Overrides:
stop
in classAbstractLifeCycle
-