Package com.scalagent.jmx
Class JMXServer
- java.lang.Object
-
- com.scalagent.jmx.JMXServer
-
-
Field Summary
Fields Modifier and Type Field Description private MBeanServermxserverstatic booleanregisterAsServiceprivate Map<ObjectName,org.osgi.framework.ServiceRegistration>registeredServices
-
Constructor Summary
Constructors Constructor Description JMXServer()JMXServer(MBeanServer mxserver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcomputeOSGiServiceNames(Class<?> beanClass, Object bean, Set<String> registered)ObjectgetAttribute(String objectName, String attribute)List<String>getAttributeNames(String objectName)Map<String,Object>getAttributes(String objectName, String[] attributes)Retrieves the values of several attributes of a MBean identified by its object name.Set<String>queryNames(String objectName)voidregisterMBean(Object bean, String fullName)private voidregisterOSGi(Object obj, ObjectName objName)voidunregisterMBean(String fullName)
-
-
-
Field Detail
-
registerAsService
public static boolean registerAsService
-
mxserver
private MBeanServer mxserver
-
registeredServices
private Map<ObjectName,org.osgi.framework.ServiceRegistration> registeredServices
-
-
Constructor Detail
-
JMXServer
public JMXServer(MBeanServer mxserver)
-
JMXServer
public JMXServer()
-
-
Method Detail
-
registerOSGi
private void registerOSGi(Object obj, ObjectName objName)
-
computeOSGiServiceNames
private void computeOSGiServiceNames(Class<?> beanClass, Object bean, Set<String> registered)
-
registerMBean
public void registerMBean(Object bean, String fullName) throws Exception
- Specified by:
registerMBeanin interfaceMXServer- Throws:
Exception
-
unregisterMBean
public void unregisterMBean(String fullName) throws Exception
- Specified by:
unregisterMBeanin interfaceMXServer- Throws:
Exception
-
getAttribute
public Object getAttribute(String objectName, String attribute) throws Exception
- Specified by:
getAttributein interfaceMXServer- Throws:
Exception
-
getAttributes
public Map<String,Object> getAttributes(String objectName, String[] attributes) throws Exception
Retrieves the values of several attributes of a MBean identified by its object name. If one or more attributes cannot be retrieved, they will be silently omitted from the result- Specified by:
getAttributesin interfaceMXServer- Parameters:
name- The object name of the MBean from which the attributes are retrieved.attributes- A list of the attributes to be retrieved.- Returns:
- a map of the retrieved attributes (name/value pairs).
- Throws:
Exception
-
getAttributeNames
public List<String> getAttributeNames(String objectName) throws Exception
- Specified by:
getAttributeNamesin interfaceMXServer- Throws:
Exception
-
queryNames
public Set<String> queryNames(String objectName) throws MalformedObjectNameException
- Specified by:
queryNamesin interfaceMXServer- Throws:
MalformedObjectNameException
-
-