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 newClient
object and creates proxies for all known remote MBeans.Client
(JMXConnector connector) Constructs a newClient
object and creates proxies for all known remote MBeans. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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 remoteLoggerContextAdminMBean
s.getStatusLoggerAdmin
(String contextName) Returns theStatusLoggerAdminMBean
associated with the specified context name, ornull
.getStatusLoggerObjectName
(ObjectName loggerContextObjName) Returns theObjectName
of theStatusLoggerAdminMBean
associated with the specifiedLoggerContextAdminMBean
.private void
init()
boolean
isLoggerContext
(ObjectName mbeanName) Returnstrue
if the specifiedObjectName
is for aLoggerContextAdminMBean
,false
otherwise.
-
Field Details
-
connector
-
connection
-
-
Constructor Details
-
Client
Constructs a newClient
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:
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 newClient
object 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:
JMException
IOException
-
getLoggerContextAdmins
Returns a list of proxies that allow operations to be performed on the remoteLoggerContextAdminMBean
s.- Returns:
- a list of proxies to the remote
LoggerContextAdminMBean
s - 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 theStatusLoggerAdminMBean
associated 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
Returnstrue
if the specifiedObjectName
is for aLoggerContextAdminMBean
,false
otherwise.- Parameters:
mbeanName
- theObjectName
to check.- Returns:
true
if the specifiedObjectName
is for aLoggerContextAdminMBean
,false
otherwise
-
getStatusLoggerObjectName
Returns theObjectName
of theStatusLoggerAdminMBean
associated with the specifiedLoggerContextAdminMBean
.- Parameters:
loggerContextObjName
- theObjectName
of aLoggerContextAdminMBean
- Returns:
ObjectName
of theStatusLoggerAdminMBean
-