Class Client


  • public class Client
    extends java.lang.Object
    This class allows client-side code to perform operations on remote (server-side) MBeans via proxies.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.management.MBeanServerConnection connection  
      private javax.management.remote.JMXConnector connector  
    • Constructor Summary

      Constructors 
      Constructor Description
      Client​(javax.management.MBeanServerConnection mBeanServerConnection)
      Constructs a new Client object and creates proxies for all known remote MBeans.
      Client​(javax.management.remote.JMXConnector connector)
      Constructs a new Client object and creates proxies for all known remote MBeans.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the client connection to its server.
      private java.util.Set<javax.management.ObjectName> find​(java.lang.String pattern)  
      javax.management.MBeanServerConnection getConnection()
      Returns the MBean server connection through which to communicate with the remote mbeans.
      LoggerContextAdminMBean getLoggerContextAdmin​(javax.management.ObjectName name)  
      java.util.List<LoggerContextAdminMBean> getLoggerContextAdmins()
      Returns a list of proxies that allow operations to be performed on the remote LoggerContextAdminMBeans.
      StatusLoggerAdminMBean getStatusLoggerAdmin​(java.lang.String contextName)
      Returns the StatusLoggerAdminMBean associated with the specified context name, or null.
      javax.management.ObjectName getStatusLoggerObjectName​(javax.management.ObjectName loggerContextObjName)
      Returns the ObjectName of the StatusLoggerAdminMBean associated with the specified LoggerContextAdminMBean.
      private void init()  
      boolean isLoggerContext​(javax.management.ObjectName mbeanName)
      Returns true if the specified ObjectName is for a LoggerContextAdminMBean, false otherwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • connector

        private javax.management.remote.JMXConnector connector
      • connection

        private final javax.management.MBeanServerConnection connection
    • Constructor Detail

      • Client

        public Client​(javax.management.remote.JMXConnector connector)
               throws javax.management.MalformedObjectNameException,
                      java.io.IOException
        Constructs a new Client object and creates proxies for all known remote MBeans.
        Parameters:
        connector - used to create the MBean server connection through which to communicate with the remote mbeans
        Throws:
        javax.management.MalformedObjectNameException - if a problem occurred identifying one of the remote mbeans
        java.io.IOException - if the connection failed
      • Client

        public Client​(javax.management.MBeanServerConnection mBeanServerConnection)
               throws javax.management.MalformedObjectNameException,
                      java.io.IOException
        Constructs a new Client object and creates proxies for all known remote MBeans.
        Parameters:
        mBeanServerConnection - the MBean server connection through which to communicate with the remote mbeans
        Throws:
        javax.management.MalformedObjectNameException - if a problem occurred identifying one of the remote mbeans
        java.io.IOException - if the connection failed
    • Method Detail

      • init

        private void init()
                   throws javax.management.MalformedObjectNameException,
                          java.io.IOException
        Throws:
        javax.management.MalformedObjectNameException
        java.io.IOException
      • find

        private java.util.Set<javax.management.ObjectName> find​(java.lang.String pattern)
                                                         throws javax.management.JMException,
                                                                java.io.IOException
        Throws:
        javax.management.JMException
        java.io.IOException
      • getLoggerContextAdmins

        public java.util.List<LoggerContextAdminMBean> getLoggerContextAdmins()
                                                                       throws javax.management.JMException,
                                                                              java.io.IOException
        Returns a list of proxies that allow operations to be performed on the remote LoggerContextAdminMBeans.
        Returns:
        a list of proxies to the remote LoggerContextAdminMBeans
        Throws:
        java.io.IOException - If an I/O error occurred
        javax.management.JMException - If a management error occurred
      • getLoggerContextAdmin

        public LoggerContextAdminMBean getLoggerContextAdmin​(javax.management.ObjectName name)
      • close

        public void close()
        Closes the client connection to its server. Any ongoing or new requests to the MBeanServerConnection will fail.
      • getConnection

        public javax.management.MBeanServerConnection getConnection()
        Returns the MBean server connection through which to communicate with the remote mbeans.
        Returns:
        the MBean server connection
      • getStatusLoggerAdmin

        public StatusLoggerAdminMBean getStatusLoggerAdmin​(java.lang.String contextName)
                                                    throws javax.management.MalformedObjectNameException,
                                                           java.io.IOException
        Returns the StatusLoggerAdminMBean associated with the specified context name, or null.
        Parameters:
        contextName - search key
        Returns:
        StatusLoggerAdminMBean or null
        Throws:
        javax.management.MalformedObjectNameException - If an object name is malformed
        java.io.IOException - If an I/O error occurred
      • isLoggerContext

        public boolean isLoggerContext​(javax.management.ObjectName mbeanName)
        Returns true if the specified ObjectName is for a LoggerContextAdminMBean, false otherwise.
        Parameters:
        mbeanName - the ObjectName to check.
        Returns:
        true if the specified ObjectName is for a LoggerContextAdminMBean, false otherwise
      • getStatusLoggerObjectName

        public javax.management.ObjectName getStatusLoggerObjectName​(javax.management.ObjectName loggerContextObjName)
        Returns the ObjectName of the StatusLoggerAdminMBean associated with the specified LoggerContextAdminMBean.
        Parameters:
        loggerContextObjName - the ObjectName of a LoggerContextAdminMBean
        Returns:
        ObjectName of the StatusLoggerAdminMBean