Package org.jolokia.client.jmxadapter
Class RemoteJmxAdapter
java.lang.Object
org.jolokia.client.jmxadapter.RemoteJmxAdapter
- All Implemented Interfaces:
MBeanServerConnection
I emulate a subset of the functionality of a native MBeanServerConnector but over a Jolokia
connection to the VM , the response types and thrown exceptions attempts to mimic as close as
possible the ones from a native Java MBeanServerConnection
Operations that are not supported will throw an #UnsupportedOperationException
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRemoteJmxAdapter(String url) RemoteJmxAdapter(org.jolokia.client.J4pClient connector) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) voidaddNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) createMBean(String className, ObjectName name) createMBean(String className, ObjectName name, Object[] params, String[] signature) createMBean(String className, ObjectName name, ObjectName loaderName) createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) booleangetAttribute(ObjectName name, String attribute) getAttributes(ObjectName name, String[] attributes) String[]getMBeanInfo(ObjectName name) getObjectInstance(ObjectName name) inthashCode()invoke(ObjectName name, String operationName, Object[] params, String[] signature) booleanisInstanceOf(ObjectName name, String className) booleanisRegistered(ObjectName name) queryMBeans(ObjectName name, QueryExp query) queryNames(ObjectName name, QueryExp query) voidremoveNotificationListener(ObjectName name, NotificationListener listener) voidremoveNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) voidremoveNotificationListener(ObjectName name, ObjectName listener) voidremoveNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) voidsetAttribute(ObjectName name, Attribute attribute) setAttributes(ObjectName name, AttributeList attributes) voidunregisterMBean(ObjectName name) protected org.jolokia.client.request.J4pResponseunwrapException(org.jolokia.client.exception.J4pException e)
-
Field Details
-
mbeanInfoCache
-
-
Constructor Details
-
RemoteJmxAdapter
- Throws:
IOException
-
RemoteJmxAdapter
- Throws:
IOException
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
createMBean
- Specified by:
createMBeanin interfaceMBeanServerConnection
-
createMBean
- Specified by:
createMBeanin interfaceMBeanServerConnection
-
createMBean
public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) - Specified by:
createMBeanin interfaceMBeanServerConnection
-
createMBean
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) - Specified by:
createMBeanin interfaceMBeanServerConnection
-
unregisterMBean
- Specified by:
unregisterMBeanin interfaceMBeanServerConnection
-
getObjectInstance
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException, IOException - Specified by:
getObjectInstancein interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionIOException
-
queryMBeans
- Specified by:
queryMBeansin interfaceMBeanServerConnection- Throws:
IOException
-
queryNames
- Specified by:
queryNamesin interfaceMBeanServerConnection- Throws:
IOException
-
unwrapException
protected org.jolokia.client.request.J4pResponse unwrapException(org.jolokia.client.exception.J4pException e) throws IOException, InstanceNotFoundException - Throws:
IOExceptionInstanceNotFoundException
-
isRegistered
- Specified by:
isRegisteredin interfaceMBeanServerConnection- Throws:
IOException
-
getMBeanCount
- Specified by:
getMBeanCountin interfaceMBeanServerConnection- Throws:
IOException
-
getAttribute
public Object getAttribute(ObjectName name, String attribute) throws AttributeNotFoundException, InstanceNotFoundException, IOException - Specified by:
getAttributein interfaceMBeanServerConnection- Throws:
AttributeNotFoundExceptionInstanceNotFoundExceptionIOException
-
getAttributes
public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, IOException - Specified by:
getAttributesin interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionIOException
-
setAttribute
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, IOException - Specified by:
setAttributein interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionAttributeNotFoundExceptionInvalidAttributeValueExceptionIOException
-
setAttributes
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, IOException - Specified by:
setAttributesin interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionIOException
-
invoke
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, IOException - Specified by:
invokein interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionMBeanExceptionIOException
-
getDefaultDomain
- Specified by:
getDefaultDomainin interfaceMBeanServerConnection
-
getDomains
- Specified by:
getDomainsin interfaceMBeanServerConnection- Throws:
IOException
-
addNotificationListener
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) - Specified by:
addNotificationListenerin interfaceMBeanServerConnection
-
addNotificationListener
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) - Specified by:
addNotificationListenerin interfaceMBeanServerConnection
-
removeNotificationListener
- Specified by:
removeNotificationListenerin interfaceMBeanServerConnection
-
removeNotificationListener
public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) - Specified by:
removeNotificationListenerin interfaceMBeanServerConnection
-
removeNotificationListener
- Specified by:
removeNotificationListenerin interfaceMBeanServerConnection
-
removeNotificationListener
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) - Specified by:
removeNotificationListenerin interfaceMBeanServerConnection
-
getMBeanInfo
- Specified by:
getMBeanInfoin interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionIOException
-
isInstanceOf
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException, IOException - Specified by:
isInstanceOfin interfaceMBeanServerConnection- Throws:
InstanceNotFoundExceptionIOException
-