Package org.apache.logging.log4j.jmx.gui
Class Client
- java.lang.Object
-
- org.apache.logging.log4j.jmx.gui.Client
-
public class Client extends java.lang.ObjectThis 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.MBeanServerConnectionconnectionprivate javax.management.remote.JMXConnectorconnector
-
Constructor Summary
Constructors Constructor Description Client(javax.management.MBeanServerConnection mBeanServerConnection)Constructs a newClientobject and creates proxies for all known remote MBeans.Client(javax.management.remote.JMXConnector connector)Constructs a newClientobject and creates proxies for all known remote MBeans.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the client connection to its server.private java.util.Set<javax.management.ObjectName>find(java.lang.String pattern)javax.management.MBeanServerConnectiongetConnection()Returns the MBean server connection through which to communicate with the remote mbeans.LoggerContextAdminMBeangetLoggerContextAdmin(javax.management.ObjectName name)java.util.List<LoggerContextAdminMBean>getLoggerContextAdmins()Returns a list of proxies that allow operations to be performed on the remoteLoggerContextAdminMBeans.StatusLoggerAdminMBeangetStatusLoggerAdmin(java.lang.String contextName)Returns theStatusLoggerAdminMBeanassociated with the specified context name, ornull.javax.management.ObjectNamegetStatusLoggerObjectName(javax.management.ObjectName loggerContextObjName)Returns theObjectNameof theStatusLoggerAdminMBeanassociated with the specifiedLoggerContextAdminMBean.private voidinit()booleanisLoggerContext(javax.management.ObjectName mbeanName)Returnstrueif the specifiedObjectNameis for aLoggerContextAdminMBean,falseotherwise.
-
-
-
Constructor Detail
-
Client
public Client(javax.management.remote.JMXConnector connector) throws javax.management.MalformedObjectNameException, java.io.IOExceptionConstructs a newClientobject 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 mbeansjava.io.IOException- if the connection failed
-
Client
public Client(javax.management.MBeanServerConnection mBeanServerConnection) throws javax.management.MalformedObjectNameException, java.io.IOExceptionConstructs a newClientobject 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 mbeansjava.io.IOException- if the connection failed
-
-
Method Detail
-
init
private void init() throws javax.management.MalformedObjectNameException, java.io.IOException- Throws:
javax.management.MalformedObjectNameExceptionjava.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.JMExceptionjava.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 remoteLoggerContextAdminMBeans.- Returns:
- a list of proxies to the remote
LoggerContextAdminMBeans - Throws:
java.io.IOException- If an I/O error occurredjavax.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 theStatusLoggerAdminMBeanassociated with the specified context name, ornull.- Parameters:
contextName- search key- Returns:
- StatusLoggerAdminMBean or null
- Throws:
javax.management.MalformedObjectNameException- If an object name is malformedjava.io.IOException- If an I/O error occurred
-
isLoggerContext
public boolean isLoggerContext(javax.management.ObjectName mbeanName)
Returnstrueif the specifiedObjectNameis for aLoggerContextAdminMBean,falseotherwise.- Parameters:
mbeanName- theObjectNameto check.- Returns:
trueif the specifiedObjectNameis for aLoggerContextAdminMBean,falseotherwise
-
getStatusLoggerObjectName
public javax.management.ObjectName getStatusLoggerObjectName(javax.management.ObjectName loggerContextObjName)
Returns theObjectNameof theStatusLoggerAdminMBeanassociated with the specifiedLoggerContextAdminMBean.- Parameters:
loggerContextObjName- theObjectNameof aLoggerContextAdminMBean- Returns:
ObjectNameof theStatusLoggerAdminMBean
-
-