org.apache.logging.log4j.core.jmx
Interface RingBufferAdminMBean

All Known Implementing Classes:
RingBufferAdmin

public interface RingBufferAdminMBean

The MBean interface for monitoring and managing an LMAX Disruptor ring buffer.


Field Summary
static String PATTERN_ASYNC_LOGGER
          ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer") for the RingBufferAdmin MBean that instruments the global AsyncLogger ring buffer.
static String PATTERN_ASYNC_LOGGER_CONFIG
          ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer") for RingBufferAdmin MBeans that instrument AsyncLoggerConfig ring buffers.
 
Method Summary
 long getBufferSize()
          Returns the number of slots that the ring buffer was configured with.
 long getRemainingCapacity()
          Returns the number of available slots in the ring buffer.
 

Field Detail

PATTERN_ASYNC_LOGGER

static final String PATTERN_ASYNC_LOGGER
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=AsyncLoggerRingBuffer") for the RingBufferAdmin MBean that instruments the global AsyncLogger ring buffer. This pattern contains one variable: the name of the context.

You can find the registered RingBufferAdmin MBean for the global AsyncLogger like this:

 MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 String pattern = String.format(RingBufferAdminMBean.PATTERN_ASYNC_LOGGER, "*");
 Set<ObjectName> asyncLoggerNames = mbs.queryNames(new ObjectName(pattern), null);
 

See Also:
Constant Field Values

PATTERN_ASYNC_LOGGER_CONFIG

static final String PATTERN_ASYNC_LOGGER_CONFIG
ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=Loggers,name=%s,subtype=RingBuffer") for RingBufferAdmin MBeans that instrument AsyncLoggerConfig ring buffers. This pattern contains three variables, where the first is the name of the context, the second and third are identical and the name of the instrumented logger config.

You can find all registered RingBufferAdmin MBeans like this:

 MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
 String pattern = String.format(RingBufferAdminMBean.PATTERN_ASYNC_LOGGER_CONFIG, "*", "*");
 Set<ObjectName> asyncConfigNames = mbs.queryNames(new ObjectName(pattern), null);
 

See Also:
Constant Field Values
Method Detail

getBufferSize

long getBufferSize()
Returns 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.

Returns:
the number of slots that the ring buffer was configured with

getRemainingCapacity

long getRemainingCapacity()
Returns the number of available slots in the ring buffer. May vary wildly between invocations.

Returns:
the number of available slots in the ring buffer


Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.