Class RingBufferAdmin
- java.lang.Object
-
- org.apache.logging.log4j.core.jmx.RingBufferAdmin
-
- All Implemented Interfaces:
RingBufferAdminMBean
public class RingBufferAdmin extends java.lang.Object implements RingBufferAdminMBean
Instruments an LMAX Disruptor ring buffer.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.management.ObjectNameobjectNameprivate com.lmax.disruptor.RingBuffer<?>ringBuffer-
Fields inherited from interface org.apache.logging.log4j.core.jmx.RingBufferAdminMBean
PATTERN_ASYNC_LOGGER, PATTERN_ASYNC_LOGGER_CONFIG
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRingBufferAdmin(com.lmax.disruptor.RingBuffer<?> ringBuffer, java.lang.String mbeanName)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RingBufferAdminforAsyncLogger(com.lmax.disruptor.RingBuffer<?> ringBuffer, java.lang.String contextName)static RingBufferAdminforAsyncLoggerConfig(com.lmax.disruptor.RingBuffer<?> ringBuffer, java.lang.String contextName, java.lang.String configName)longgetBufferSize()Returns the number of slots that the ring buffer was configured with.javax.management.ObjectNamegetObjectName()Returns theObjectNameof this mbean.longgetRemainingCapacity()Returns the number of available slots in the ring buffer.
-
-
-
Method Detail
-
forAsyncLogger
public static RingBufferAdmin forAsyncLogger(com.lmax.disruptor.RingBuffer<?> ringBuffer, java.lang.String contextName)
-
forAsyncLoggerConfig
public static RingBufferAdmin forAsyncLoggerConfig(com.lmax.disruptor.RingBuffer<?> ringBuffer, java.lang.String contextName, java.lang.String configName)
-
getBufferSize
public long getBufferSize()
Description copied from interface:RingBufferAdminMBeanReturns the number of slots that the ring buffer was configured with. Disruptor ring buffers are bounded-size data structures, this number does not change during the life of the ring buffer.- Specified by:
getBufferSizein interfaceRingBufferAdminMBean- Returns:
- the number of slots that the ring buffer was configured with
-
getRemainingCapacity
public long getRemainingCapacity()
Description copied from interface:RingBufferAdminMBeanReturns the number of available slots in the ring buffer. May vary wildly between invocations.- Specified by:
getRemainingCapacityin interfaceRingBufferAdminMBean- Returns:
- the number of available slots in the ring buffer
-
getObjectName
public javax.management.ObjectName getObjectName()
Returns theObjectNameof this mbean.- Returns:
- the
ObjectName - See Also:
RingBufferAdminMBean.PATTERN_ASYNC_LOGGER,RingBufferAdminMBean.PATTERN_ASYNC_LOGGER_CONFIG
-
-