cz.cuni.amis.pogamut.base.utils.jmx
Class PogamutMBeanServer

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.utils.jmx.PogamutMBeanServer
All Implemented Interfaces:
javax.management.MBeanServer, javax.management.MBeanServerConnection

public class PogamutMBeanServer
extends java.lang.Object
implements javax.management.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().


Constructor Summary
PogamutMBeanServer()
           
PogamutMBeanServer(javax.management.MBeanServer mBeanServer)
           
 
Method Summary
 void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
 void addNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
 void clearSaved()
           
 javax.management.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name)
           
 javax.management.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name, java.lang.Object[] params, java.lang.String[] signature)
           
 javax.management.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name, javax.management.ObjectName loaderName)
           
 javax.management.ObjectInstance createMBean(java.lang.String className, javax.management.ObjectName name, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
           
 java.io.ObjectInputStream deserialize(javax.management.ObjectName name, byte[] data)
          Deprecated. 
 java.io.ObjectInputStream deserialize(java.lang.String className, byte[] data)
          Deprecated. 
 java.io.ObjectInputStream deserialize(java.lang.String className, javax.management.ObjectName loaderName, byte[] data)
          Deprecated. 
 java.lang.Object getAttribute(javax.management.ObjectName name, java.lang.String attribute)
           
 javax.management.AttributeList getAttributes(javax.management.ObjectName name, java.lang.String[] attributes)
           
 java.lang.ClassLoader getClassLoader(javax.management.ObjectName loaderName)
           
 java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName mbeanName)
           
 javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
           
 java.lang.String getDefaultDomain()
           
 java.lang.String[] getDomains()
           
 java.lang.Integer getMBeanCount()
           
 javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
           
 javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name)
           
 java.lang.Object instantiate(java.lang.String className)
           
 java.lang.Object instantiate(java.lang.String className, java.lang.Object[] params, java.lang.String[] signature)
           
 java.lang.Object instantiate(java.lang.String className, javax.management.ObjectName loaderName)
           
 java.lang.Object instantiate(java.lang.String className, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)
           
 java.lang.Object invoke(javax.management.ObjectName name, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
           
 boolean isInstanceOf(javax.management.ObjectName name, java.lang.String className)
           
 boolean isRegistered(javax.management.ObjectName name)
           
 java.util.Set<javax.management.ObjectInstance> queryMBeans(javax.management.ObjectName name, javax.management.QueryExp query)
           
 java.util.Set<javax.management.ObjectName> queryNames(javax.management.ObjectName name, javax.management.QueryExp query)
           
 void registerAll()
           
 javax.management.ObjectInstance registerMBean(java.lang.Object object, javax.management.ObjectName name)
           
 void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener)
           
 void removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
 void removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener)
           
 void removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.management.NotificationFilter filter, java.lang.Object handback)
           
 void setAttribute(javax.management.ObjectName name, javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes)
           
 void unregisterAll()
          Unreagister all listeners and mbeans from the server.
 void unregisterMBean(javax.management.ObjectName name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PogamutMBeanServer

public PogamutMBeanServer()

PogamutMBeanServer

public PogamutMBeanServer(javax.management.MBeanServer mBeanServer)
Method Detail

clearSaved

public void clearSaved()

unregisterAll

public void unregisterAll()
Unreagister all listeners and mbeans from the server.


registerAll

public void registerAll()
                 throws javax.management.InstanceNotFoundException,
                        javax.management.InstanceAlreadyExistsException,
                        javax.management.MBeanRegistrationException,
                        javax.management.NotCompliantMBeanException
Throws:
javax.management.InstanceNotFoundException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException

addNotificationListener

public void addNotificationListener(javax.management.ObjectName name,
                                    javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws javax.management.InstanceNotFoundException
Specified by:
addNotificationListener in interface javax.management.MBeanServer
Specified by:
addNotificationListener in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException

addNotificationListener

public void addNotificationListener(javax.management.ObjectName name,
                                    javax.management.ObjectName listener,
                                    javax.management.NotificationFilter filter,
                                    java.lang.Object handback)
                             throws javax.management.InstanceNotFoundException
Specified by:
addNotificationListener in interface javax.management.MBeanServer
Specified by:
addNotificationListener in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException

createMBean

public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                   javax.management.ObjectName name)
                                            throws javax.management.ReflectionException,
                                                   javax.management.InstanceAlreadyExistsException,
                                                   javax.management.MBeanRegistrationException,
                                                   javax.management.MBeanException,
                                                   javax.management.NotCompliantMBeanException
Specified by:
createMBean in interface javax.management.MBeanServer
Specified by:
createMBean in interface javax.management.MBeanServerConnection
Throws:
javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MBeanException
javax.management.NotCompliantMBeanException

createMBean

public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                   javax.management.ObjectName name,
                                                   javax.management.ObjectName loaderName)
                                            throws javax.management.ReflectionException,
                                                   javax.management.InstanceAlreadyExistsException,
                                                   javax.management.MBeanRegistrationException,
                                                   javax.management.MBeanException,
                                                   javax.management.NotCompliantMBeanException,
                                                   javax.management.InstanceNotFoundException
Specified by:
createMBean in interface javax.management.MBeanServer
Specified by:
createMBean in interface javax.management.MBeanServerConnection
Throws:
javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
javax.management.InstanceNotFoundException

createMBean

public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                   javax.management.ObjectName name,
                                                   java.lang.Object[] params,
                                                   java.lang.String[] signature)
                                            throws javax.management.ReflectionException,
                                                   javax.management.InstanceAlreadyExistsException,
                                                   javax.management.MBeanRegistrationException,
                                                   javax.management.MBeanException,
                                                   javax.management.NotCompliantMBeanException
Specified by:
createMBean in interface javax.management.MBeanServer
Specified by:
createMBean in interface javax.management.MBeanServerConnection
Throws:
javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MBeanException
javax.management.NotCompliantMBeanException

createMBean

public javax.management.ObjectInstance createMBean(java.lang.String className,
                                                   javax.management.ObjectName name,
                                                   javax.management.ObjectName loaderName,
                                                   java.lang.Object[] params,
                                                   java.lang.String[] signature)
                                            throws javax.management.ReflectionException,
                                                   javax.management.InstanceAlreadyExistsException,
                                                   javax.management.MBeanRegistrationException,
                                                   javax.management.MBeanException,
                                                   javax.management.NotCompliantMBeanException,
                                                   javax.management.InstanceNotFoundException
Specified by:
createMBean in interface javax.management.MBeanServer
Specified by:
createMBean in interface javax.management.MBeanServerConnection
Throws:
javax.management.ReflectionException
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.MBeanException
javax.management.NotCompliantMBeanException
javax.management.InstanceNotFoundException

deserialize

@Deprecated
public java.io.ObjectInputStream deserialize(javax.management.ObjectName name,
                                                        byte[] data)
                                      throws javax.management.InstanceNotFoundException,
                                             javax.management.OperationsException
Deprecated. 

Specified by:
deserialize in interface javax.management.MBeanServer
Throws:
javax.management.InstanceNotFoundException
javax.management.OperationsException

deserialize

@Deprecated
public java.io.ObjectInputStream deserialize(java.lang.String className,
                                                        byte[] data)
                                      throws javax.management.OperationsException,
                                             javax.management.ReflectionException
Deprecated. 

Specified by:
deserialize in interface javax.management.MBeanServer
Throws:
javax.management.OperationsException
javax.management.ReflectionException

deserialize

@Deprecated
public java.io.ObjectInputStream deserialize(java.lang.String className,
                                                        javax.management.ObjectName loaderName,
                                                        byte[] data)
                                      throws javax.management.InstanceNotFoundException,
                                             javax.management.OperationsException,
                                             javax.management.ReflectionException
Deprecated. 

Specified by:
deserialize in interface javax.management.MBeanServer
Throws:
javax.management.InstanceNotFoundException
javax.management.OperationsException
javax.management.ReflectionException

getAttribute

public java.lang.Object getAttribute(javax.management.ObjectName name,
                                     java.lang.String attribute)
                              throws javax.management.MBeanException,
                                     javax.management.AttributeNotFoundException,
                                     javax.management.InstanceNotFoundException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.MBeanServer
Specified by:
getAttribute in interface javax.management.MBeanServerConnection
Throws:
javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.InstanceNotFoundException
javax.management.ReflectionException

getAttributes

public javax.management.AttributeList getAttributes(javax.management.ObjectName name,
                                                    java.lang.String[] attributes)
                                             throws javax.management.InstanceNotFoundException,
                                                    javax.management.ReflectionException
Specified by:
getAttributes in interface javax.management.MBeanServer
Specified by:
getAttributes in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.ReflectionException

getClassLoader

public java.lang.ClassLoader getClassLoader(javax.management.ObjectName loaderName)
                                     throws javax.management.InstanceNotFoundException
Specified by:
getClassLoader in interface javax.management.MBeanServer
Throws:
javax.management.InstanceNotFoundException

getClassLoaderFor

public java.lang.ClassLoader getClassLoaderFor(javax.management.ObjectName mbeanName)
                                        throws javax.management.InstanceNotFoundException
Specified by:
getClassLoaderFor in interface javax.management.MBeanServer
Throws:
javax.management.InstanceNotFoundException

getClassLoaderRepository

public javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
Specified by:
getClassLoaderRepository in interface javax.management.MBeanServer

getDefaultDomain

public java.lang.String getDefaultDomain()
Specified by:
getDefaultDomain in interface javax.management.MBeanServer
Specified by:
getDefaultDomain in interface javax.management.MBeanServerConnection

getDomains

public java.lang.String[] getDomains()
Specified by:
getDomains in interface javax.management.MBeanServer
Specified by:
getDomains in interface javax.management.MBeanServerConnection

getMBeanCount

public java.lang.Integer getMBeanCount()
Specified by:
getMBeanCount in interface javax.management.MBeanServer
Specified by:
getMBeanCount in interface javax.management.MBeanServerConnection

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
                                        throws javax.management.InstanceNotFoundException,
                                               javax.management.IntrospectionException,
                                               javax.management.ReflectionException
Specified by:
getMBeanInfo in interface javax.management.MBeanServer
Specified by:
getMBeanInfo in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.IntrospectionException
javax.management.ReflectionException

getObjectInstance

public javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name)
                                                  throws javax.management.InstanceNotFoundException
Specified by:
getObjectInstance in interface javax.management.MBeanServer
Specified by:
getObjectInstance in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException

instantiate

public java.lang.Object instantiate(java.lang.String className)
                             throws javax.management.ReflectionException,
                                    javax.management.MBeanException
Specified by:
instantiate in interface javax.management.MBeanServer
Throws:
javax.management.ReflectionException
javax.management.MBeanException

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    javax.management.ObjectName loaderName)
                             throws javax.management.ReflectionException,
                                    javax.management.MBeanException,
                                    javax.management.InstanceNotFoundException
Specified by:
instantiate in interface javax.management.MBeanServer
Throws:
javax.management.ReflectionException
javax.management.MBeanException
javax.management.InstanceNotFoundException

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    java.lang.Object[] params,
                                    java.lang.String[] signature)
                             throws javax.management.ReflectionException,
                                    javax.management.MBeanException
Specified by:
instantiate in interface javax.management.MBeanServer
Throws:
javax.management.ReflectionException
javax.management.MBeanException

instantiate

public java.lang.Object instantiate(java.lang.String className,
                                    javax.management.ObjectName loaderName,
                                    java.lang.Object[] params,
                                    java.lang.String[] signature)
                             throws javax.management.ReflectionException,
                                    javax.management.MBeanException,
                                    javax.management.InstanceNotFoundException
Specified by:
instantiate in interface javax.management.MBeanServer
Throws:
javax.management.ReflectionException
javax.management.MBeanException
javax.management.InstanceNotFoundException

invoke

public java.lang.Object invoke(javax.management.ObjectName name,
                               java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.InstanceNotFoundException,
                               javax.management.MBeanException,
                               javax.management.ReflectionException
Specified by:
invoke in interface javax.management.MBeanServer
Specified by:
invoke in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

isInstanceOf

public boolean isInstanceOf(javax.management.ObjectName name,
                            java.lang.String className)
                     throws javax.management.InstanceNotFoundException
Specified by:
isInstanceOf in interface javax.management.MBeanServer
Specified by:
isInstanceOf in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException

isRegistered

public boolean isRegistered(javax.management.ObjectName name)
Specified by:
isRegistered in interface javax.management.MBeanServer
Specified by:
isRegistered in interface javax.management.MBeanServerConnection

queryMBeans

public java.util.Set<javax.management.ObjectInstance> queryMBeans(javax.management.ObjectName name,
                                                                  javax.management.QueryExp query)
Specified by:
queryMBeans in interface javax.management.MBeanServer
Specified by:
queryMBeans in interface javax.management.MBeanServerConnection

queryNames

public java.util.Set<javax.management.ObjectName> queryNames(javax.management.ObjectName name,
                                                             javax.management.QueryExp query)
Specified by:
queryNames in interface javax.management.MBeanServer
Specified by:
queryNames in interface javax.management.MBeanServerConnection

registerMBean

public javax.management.ObjectInstance registerMBean(java.lang.Object object,
                                                     javax.management.ObjectName name)
                                              throws javax.management.InstanceAlreadyExistsException,
                                                     javax.management.MBeanRegistrationException,
                                                     javax.management.NotCompliantMBeanException
Specified by:
registerMBean in interface javax.management.MBeanServer
Throws:
javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.ObjectName listener)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.NotificationListener listener)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.ObjectName listener,
                                       javax.management.NotificationFilter filter,
                                       java.lang.Object handback)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(javax.management.ObjectName name,
                                       javax.management.NotificationListener listener,
                                       javax.management.NotificationFilter filter,
                                       java.lang.Object handback)
                                throws javax.management.InstanceNotFoundException,
                                       javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface javax.management.MBeanServer
Specified by:
removeNotificationListener in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.ListenerNotFoundException

setAttribute

public void setAttribute(javax.management.ObjectName name,
                         javax.management.Attribute attribute)
                  throws javax.management.InstanceNotFoundException,
                         javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.MBeanServer
Specified by:
setAttribute in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

setAttributes

public javax.management.AttributeList setAttributes(javax.management.ObjectName name,
                                                    javax.management.AttributeList attributes)
                                             throws javax.management.InstanceNotFoundException,
                                                    javax.management.ReflectionException
Specified by:
setAttributes in interface javax.management.MBeanServer
Specified by:
setAttributes in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.ReflectionException

unregisterMBean

public void unregisterMBean(javax.management.ObjectName name)
                     throws javax.management.InstanceNotFoundException,
                            javax.management.MBeanRegistrationException
Specified by:
unregisterMBean in interface javax.management.MBeanServer
Specified by:
unregisterMBean in interface javax.management.MBeanServerConnection
Throws:
javax.management.InstanceNotFoundException
javax.management.MBeanRegistrationException