Interface ContextSelectorAdminMBean

All Known Implementing Classes:
ContextSelectorAdmin

public interface ContextSelectorAdminMBean
The MBean interface for monitoring and managing the ContextSelector.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=ContextSelector") for ContextSelectorAdmin MBeans.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the name of the class implementing the ContextSelector interface.
  • Field Details

    • PATTERN

      static final String PATTERN
      ObjectName pattern ("org.apache.logging.log4j2:type=%s,component=ContextSelector") for ContextSelectorAdmin MBeans. This pattern contains a variable, which is the name of the logger context.

      You can find all registered ContextSelectorAdmin MBeans like this:

       MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
       String pattern = String.format(ContextSelectorAdminMBean.PATTERN, "*");
       Set<ObjectName> contextSelectorNames = mbs.queryNames(new ObjectName(pattern), null);
       

      Some characters are not allowed in ObjectNames. The logger context name may be quoted. When ContextSelectorAdmin MBeans are registered, their ObjectNames are created using this pattern as follows:

       String ctxName = Server.escape(loggerContext.getName());
       String name = String.format(PATTERN, ctxName);
       ObjectName objectName = new ObjectName(name);
       
      See Also:
  • Method Details

    • getImplementationClassName

      String getImplementationClassName()
      Returns the name of the class implementing the ContextSelector interface.
      Returns:
      the name of the ContextSelector implementation class.