cz.cuni.amis.pogamut.base.utils.jmx
Class PogamutMBeanServer
java.lang.Object
cz.cuni.amis.pogamut.base.utils.jmx.PogamutMBeanServer
- All Implemented Interfaces:
- MBeanServer, MBeanServerConnection
public class PogamutMBeanServer
- extends Object
- implements MBeanServer
Wrapper of the MBeanServer
interface, that is using to store references of
registered mbeans and listeners allowing to unregister/register them again using
unregisterAll()
and registerAll()
.
- Author:
- Jimmy
Method Summary |
void |
addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
|
void |
clearSaved()
|
ObjectInstance |
createMBean(String className,
ObjectName name)
|
ObjectInstance |
createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
|
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName)
|
ObjectInstance |
createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature)
|
ObjectInputStream |
deserialize(ObjectName name,
byte[] data)
Deprecated. |
ObjectInputStream |
deserialize(String className,
byte[] data)
Deprecated. |
ObjectInputStream |
deserialize(String className,
ObjectName loaderName,
byte[] data)
Deprecated. |
Object |
getAttribute(ObjectName name,
String attribute)
|
AttributeList |
getAttributes(ObjectName name,
String[] attributes)
|
ClassLoader |
getClassLoader(ObjectName loaderName)
|
ClassLoader |
getClassLoaderFor(ObjectName mbeanName)
|
ClassLoaderRepository |
getClassLoaderRepository()
|
String |
getDefaultDomain()
|
String[] |
getDomains()
|
Integer |
getMBeanCount()
|
MBeanInfo |
getMBeanInfo(ObjectName name)
|
ObjectInstance |
getObjectInstance(ObjectName name)
|
Object |
instantiate(String className)
|
Object |
instantiate(String className,
Object[] params,
String[] signature)
|
Object |
instantiate(String className,
ObjectName loaderName)
|
Object |
instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature)
|
Object |
invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
|
boolean |
isInstanceOf(ObjectName name,
String className)
|
boolean |
isRegistered(ObjectName name)
|
Set<ObjectInstance> |
queryMBeans(ObjectName name,
QueryExp query)
|
Set<ObjectName> |
queryNames(ObjectName name,
QueryExp query)
|
void |
registerAll()
|
ObjectInstance |
registerMBean(Object object,
ObjectName name)
|
void |
removeNotificationListener(ObjectName name,
NotificationListener listener)
|
void |
removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
removeNotificationListener(ObjectName name,
ObjectName listener)
|
void |
removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
|
void |
setAttribute(ObjectName name,
Attribute attribute)
|
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes)
|
void |
unregisterAll()
Unreagister all listeners and mbeans from the server. |
void |
unregisterMBean(ObjectName name)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PogamutMBeanServer
public PogamutMBeanServer()
PogamutMBeanServer
public PogamutMBeanServer(MBeanServer mBeanServer)
clearSaved
public void clearSaved()
unregisterAll
public void unregisterAll()
- Unreagister all listeners and mbeans from the server.
registerAll
public void registerAll()
throws InstanceNotFoundException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException
- Throws:
InstanceNotFoundException
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
addNotificationListener
public void addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException
- Specified by:
addNotificationListener
in interface MBeanServer
- Specified by:
addNotificationListener
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
addNotificationListener
public void addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException
- Specified by:
addNotificationListener
in interface MBeanServer
- Specified by:
addNotificationListener
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
createMBean
public ObjectInstance createMBean(String className,
ObjectName name)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException
- Specified by:
createMBean
in interface MBeanServer
- Specified by:
createMBean
in interface MBeanServerConnection
- Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
createMBean
public ObjectInstance createMBean(String className,
ObjectName name,
ObjectName loaderName)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException,
InstanceNotFoundException
- Specified by:
createMBean
in interface MBeanServer
- Specified by:
createMBean
in interface MBeanServerConnection
- Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
createMBean
public ObjectInstance createMBean(String className,
ObjectName name,
Object[] params,
String[] signature)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException
- Specified by:
createMBean
in interface MBeanServer
- Specified by:
createMBean
in interface MBeanServerConnection
- Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
createMBean
public ObjectInstance createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature)
throws ReflectionException,
InstanceAlreadyExistsException,
MBeanRegistrationException,
MBeanException,
NotCompliantMBeanException,
InstanceNotFoundException
- Specified by:
createMBean
in interface MBeanServer
- Specified by:
createMBean
in interface MBeanServerConnection
- Throws:
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
deserialize
@Deprecated
public ObjectInputStream deserialize(ObjectName name,
byte[] data)
throws InstanceNotFoundException,
OperationsException
- Deprecated.
- Specified by:
deserialize
in interface MBeanServer
- Throws:
InstanceNotFoundException
OperationsException
deserialize
@Deprecated
public ObjectInputStream deserialize(String className,
byte[] data)
throws OperationsException,
ReflectionException
- Deprecated.
- Specified by:
deserialize
in interface MBeanServer
- Throws:
OperationsException
ReflectionException
deserialize
@Deprecated
public ObjectInputStream deserialize(String className,
ObjectName loaderName,
byte[] data)
throws InstanceNotFoundException,
OperationsException,
ReflectionException
- Deprecated.
- Specified by:
deserialize
in interface MBeanServer
- Throws:
InstanceNotFoundException
OperationsException
ReflectionException
getAttribute
public Object getAttribute(ObjectName name,
String attribute)
throws MBeanException,
AttributeNotFoundException,
InstanceNotFoundException,
ReflectionException
- Specified by:
getAttribute
in interface MBeanServer
- Specified by:
getAttribute
in interface MBeanServerConnection
- Throws:
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
getAttributes
public AttributeList getAttributes(ObjectName name,
String[] attributes)
throws InstanceNotFoundException,
ReflectionException
- Specified by:
getAttributes
in interface MBeanServer
- Specified by:
getAttributes
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
ReflectionException
getClassLoader
public ClassLoader getClassLoader(ObjectName loaderName)
throws InstanceNotFoundException
- Specified by:
getClassLoader
in interface MBeanServer
- Throws:
InstanceNotFoundException
getClassLoaderFor
public ClassLoader getClassLoaderFor(ObjectName mbeanName)
throws InstanceNotFoundException
- Specified by:
getClassLoaderFor
in interface MBeanServer
- Throws:
InstanceNotFoundException
getClassLoaderRepository
public ClassLoaderRepository getClassLoaderRepository()
- Specified by:
getClassLoaderRepository
in interface MBeanServer
getDefaultDomain
public String getDefaultDomain()
- Specified by:
getDefaultDomain
in interface MBeanServer
- Specified by:
getDefaultDomain
in interface MBeanServerConnection
getDomains
public String[] getDomains()
- Specified by:
getDomains
in interface MBeanServer
- Specified by:
getDomains
in interface MBeanServerConnection
getMBeanCount
public Integer getMBeanCount()
- Specified by:
getMBeanCount
in interface MBeanServer
- Specified by:
getMBeanCount
in interface MBeanServerConnection
getMBeanInfo
public MBeanInfo getMBeanInfo(ObjectName name)
throws InstanceNotFoundException,
IntrospectionException,
ReflectionException
- Specified by:
getMBeanInfo
in interface MBeanServer
- Specified by:
getMBeanInfo
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
IntrospectionException
ReflectionException
getObjectInstance
public ObjectInstance getObjectInstance(ObjectName name)
throws InstanceNotFoundException
- Specified by:
getObjectInstance
in interface MBeanServer
- Specified by:
getObjectInstance
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
instantiate
public Object instantiate(String className)
throws ReflectionException,
MBeanException
- Specified by:
instantiate
in interface MBeanServer
- Throws:
ReflectionException
MBeanException
instantiate
public Object instantiate(String className,
ObjectName loaderName)
throws ReflectionException,
MBeanException,
InstanceNotFoundException
- Specified by:
instantiate
in interface MBeanServer
- Throws:
ReflectionException
MBeanException
InstanceNotFoundException
instantiate
public Object instantiate(String className,
Object[] params,
String[] signature)
throws ReflectionException,
MBeanException
- Specified by:
instantiate
in interface MBeanServer
- Throws:
ReflectionException
MBeanException
instantiate
public Object instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature)
throws ReflectionException,
MBeanException,
InstanceNotFoundException
- Specified by:
instantiate
in interface MBeanServer
- Throws:
ReflectionException
MBeanException
InstanceNotFoundException
invoke
public Object invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature)
throws InstanceNotFoundException,
MBeanException,
ReflectionException
- Specified by:
invoke
in interface MBeanServer
- Specified by:
invoke
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
MBeanException
ReflectionException
isInstanceOf
public boolean isInstanceOf(ObjectName name,
String className)
throws InstanceNotFoundException
- Specified by:
isInstanceOf
in interface MBeanServer
- Specified by:
isInstanceOf
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
isRegistered
public boolean isRegistered(ObjectName name)
- Specified by:
isRegistered
in interface MBeanServer
- Specified by:
isRegistered
in interface MBeanServerConnection
queryMBeans
public Set<ObjectInstance> queryMBeans(ObjectName name,
QueryExp query)
- Specified by:
queryMBeans
in interface MBeanServer
- Specified by:
queryMBeans
in interface MBeanServerConnection
queryNames
public Set<ObjectName> queryNames(ObjectName name,
QueryExp query)
- Specified by:
queryNames
in interface MBeanServer
- Specified by:
queryNames
in interface MBeanServerConnection
registerMBean
public ObjectInstance registerMBean(Object object,
ObjectName name)
throws InstanceAlreadyExistsException,
MBeanRegistrationException,
NotCompliantMBeanException
- Specified by:
registerMBean
in interface MBeanServer
- Throws:
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
removeNotificationListener
public void removeNotificationListener(ObjectName name,
ObjectName listener)
throws InstanceNotFoundException,
ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface MBeanServer
- Specified by:
removeNotificationListener
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
ListenerNotFoundException
removeNotificationListener
public void removeNotificationListener(ObjectName name,
NotificationListener listener)
throws InstanceNotFoundException,
ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface MBeanServer
- Specified by:
removeNotificationListener
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
ListenerNotFoundException
removeNotificationListener
public void removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException,
ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface MBeanServer
- Specified by:
removeNotificationListener
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
ListenerNotFoundException
removeNotificationListener
public void removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
throws InstanceNotFoundException,
ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface MBeanServer
- Specified by:
removeNotificationListener
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
ListenerNotFoundException
setAttribute
public void setAttribute(ObjectName name,
Attribute attribute)
throws InstanceNotFoundException,
AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
- Specified by:
setAttribute
in interface MBeanServer
- Specified by:
setAttribute
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
setAttributes
public AttributeList setAttributes(ObjectName name,
AttributeList attributes)
throws InstanceNotFoundException,
ReflectionException
- Specified by:
setAttributes
in interface MBeanServer
- Specified by:
setAttributes
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
ReflectionException
unregisterMBean
public void unregisterMBean(ObjectName name)
throws InstanceNotFoundException,
MBeanRegistrationException
- Specified by:
unregisterMBean
in interface MBeanServer
- Specified by:
unregisterMBean
in interface MBeanServerConnection
- Throws:
InstanceNotFoundException
MBeanRegistrationException
Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.