Package org.apache.logging.log4j.jmx.gui
Class Client
java.lang.Object
org.apache.logging.log4j.jmx.gui.Client
This class allows client-side code to perform operations on remote
(server-side) MBeans via proxies.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionClient(MBeanServerConnection mBeanServerConnection) Constructs a newClientobject and creates proxies for all known remote MBeans.Client(JMXConnector connector) Constructs a newClientobject and creates proxies for all known remote MBeans. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the client connection to its server.private Set<ObjectName> Returns the MBean server connection through which to communicate with the remote mbeans.Returns a list of proxies that allow operations to be performed on the remoteLoggerContextAdminMBeans.getStatusLoggerAdmin(String contextName) Returns theStatusLoggerAdminMBeanassociated with the specified context name, ornull.getStatusLoggerObjectName(ObjectName loggerContextObjName) Returns theObjectNameof theStatusLoggerAdminMBeanassociated with the specifiedLoggerContextAdminMBean.private voidinit()booleanisLoggerContext(ObjectName mbeanName) Returnstrueif the specifiedObjectNameis for aLoggerContextAdminMBean,falseotherwise.
-
Field Details
-
connector
-
connection
-
-
Constructor Details
-
Client
Constructs 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:
MalformedObjectNameException- if a problem occurred identifying one of the remote mbeansIOException- if the connection failed
-
Client
public Client(MBeanServerConnection mBeanServerConnection) throws MalformedObjectNameException, IOException Constructs 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:
MalformedObjectNameException- if a problem occurred identifying one of the remote mbeansIOException- if the connection failed
-
-
Method Details
-
init
-
find
- Throws:
JMExceptionIOException
-
getLoggerContextAdmins
Returns a list of proxies that allow operations to be performed on the remoteLoggerContextAdminMBeans.- Returns:
- a list of proxies to the remote
LoggerContextAdminMBeans - Throws:
IOException- If an I/O error occurredJMException- If a management error occurred
-
getLoggerContextAdmin
-
close
public void close()Closes the client connection to its server. Any ongoing or new requests to the MBeanServerConnection will fail. -
getConnection
Returns the MBean server connection through which to communicate with the remote mbeans.- Returns:
- the MBean server connection
-
getStatusLoggerAdmin
public StatusLoggerAdminMBean getStatusLoggerAdmin(String contextName) throws MalformedObjectNameException, IOException Returns theStatusLoggerAdminMBeanassociated with the specified context name, ornull.- Parameters:
contextName- search key- Returns:
- StatusLoggerAdminMBean or null
- Throws:
MalformedObjectNameException- If an object name is malformedIOException- If an I/O error occurred
-
isLoggerContext
Returnstrueif the specifiedObjectNameis for aLoggerContextAdminMBean,falseotherwise.- Parameters:
mbeanName- theObjectNameto check.- Returns:
trueif the specifiedObjectNameis for aLoggerContextAdminMBean,falseotherwise
-
getStatusLoggerObjectName
Returns theObjectNameof theStatusLoggerAdminMBeanassociated with the specifiedLoggerContextAdminMBean.- Parameters:
loggerContextObjName- theObjectNameof aLoggerContextAdminMBean- Returns:
ObjectNameof theStatusLoggerAdminMBean
-