public class JMXRequester extends java.lang.Object implements Requester
Modifier and Type | Field and Description |
---|---|
protected boolean |
isConnected |
protected javax.management.remote.JMXConnector |
jmxc |
protected java.lang.String |
uri |
Constructor and Description |
---|
JMXRequester()
Creates new JMXRequester
|
JMXRequester(java.util.Map props) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
connect() |
java.lang.String[] |
getAllAttributes(java.lang.String target)
returns names of all attributes for the target
|
static java.lang.String |
getAttributes(java.lang.String cmd)
returns the attributes for the target in the JMX command
|
java.util.Map<java.lang.String,java.util.List> |
getInfo(java.lang.String target)
returns a hashmap with MBeanInfo for the target
|
int |
getResponse(java.lang.String jmxCmd,
java.lang.StringBuffer strBuf,
boolean autoDisconn)
This takes a JMX query command and converts it into a JMX request.
|
static java.lang.String |
getTarget(java.lang.String cmd)
returns the name of the target in the JMX command
|
java.lang.String |
getURI() |
java.lang.Object |
getValue(javax.management.ObjectName objName,
java.lang.String attr)
returns the value of the attribute from the objName
|
java.lang.Object |
getValue(java.lang.String target,
java.lang.String attr)
returns the value of the attribute from the target
|
java.util.Map<java.lang.String,java.lang.Object> |
getValues(javax.management.ObjectName objName,
java.lang.String[] attrs)
returns the key-value map for the attributes from the objName
|
java.util.Map<java.lang.String,java.lang.Object> |
getValues(java.lang.String target,
java.lang.String[] attrs)
returns the key-value map for the attributes from the target
|
boolean |
isConnected() |
java.lang.String[] |
list(java.lang.String target)
returns names of the all MBeans for the given pattern on the server
|
static void |
main(java.lang.String[] args) |
java.lang.String |
reconnect()
returns null if reconnected or error msg otherwise
|
protected java.lang.String uri
protected javax.management.remote.JMXConnector jmxc
protected boolean isConnected
public JMXRequester()
public JMXRequester(java.util.Map props)
public java.lang.String[] list(java.lang.String target) throws javax.management.JMException
javax.management.JMException
public java.util.Map<java.lang.String,java.util.List> getInfo(java.lang.String target) throws javax.management.JMException
javax.management.JMException
public java.lang.Object getValue(java.lang.String target, java.lang.String attr) throws javax.management.JMException
javax.management.JMException
public java.lang.Object getValue(javax.management.ObjectName objName, java.lang.String attr) throws javax.management.JMException
javax.management.JMException
public java.util.Map<java.lang.String,java.lang.Object> getValues(java.lang.String target, java.lang.String[] attrs) throws javax.management.JMException
javax.management.JMException
public java.util.Map<java.lang.String,java.lang.Object> getValues(javax.management.ObjectName objName, java.lang.String[] attrs) throws javax.management.JMException
javax.management.JMException
public int getResponse(java.lang.String jmxCmd, java.lang.StringBuffer strBuf, boolean autoDisconn) throws WrapperException
getResponse
in interface Requester
WrapperException
protected void connect() throws java.io.IOException
java.io.IOException
public boolean isConnected()
isConnected
in interface Connector
public java.lang.String reconnect()
public static java.lang.String getTarget(java.lang.String cmd)
public static java.lang.String getAttributes(java.lang.String cmd)
public java.lang.String[] getAllAttributes(java.lang.String target) throws javax.management.JMException
javax.management.JMException
public static void main(java.lang.String[] args)