org.jboss.system.server.jmx
Class LazyMBeanServer

java.lang.Object
  extended by org.jboss.system.server.jmx.LazyMBeanServer
All Implemented Interfaces:
javax.management.MBeanServer, javax.management.MBeanServerConnection

public class LazyMBeanServer
extends Object
implements javax.management.MBeanServer

An MBeanServer implementation that bridges between the platform MBeanServer and the jboss implementation. This is used by the @{link MBeanServerBuilderImpl} to bridge the period from the vm startup until the jboss server is loaded and the jboss MBeanServer is available.

Version:
$Revision: 1.1.2.4 $
Author:
Scott.Stark@jboss.org

Method Summary
 void addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback)
           
 void addNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.management.NotificationFilter filter, Object handback)
           
 javax.management.ObjectInstance createMBean(String className, javax.management.ObjectName name)
           
 javax.management.ObjectInstance createMBean(String className, javax.management.ObjectName name, Object[] params, String[] signature)
           
 javax.management.ObjectInstance createMBean(String className, javax.management.ObjectName name, javax.management.ObjectName loaderName)
           
 javax.management.ObjectInstance createMBean(String className, javax.management.ObjectName name, javax.management.ObjectName loaderName, Object[] params, String[] signature)
           
 ObjectInputStream deserialize(javax.management.ObjectName name, byte[] data)
           
 ObjectInputStream deserialize(String className, byte[] data)
           
 ObjectInputStream deserialize(String className, javax.management.ObjectName loaderName, byte[] data)
           
 Object getAttribute(javax.management.ObjectName name, String attribute)
           
 javax.management.AttributeList getAttributes(javax.management.ObjectName name, String[] attributes)
           
 ClassLoader getClassLoader(javax.management.ObjectName loaderName)
           
 ClassLoader getClassLoaderFor(javax.management.ObjectName mbeanName)
           
 javax.management.loading.ClassLoaderRepository getClassLoaderRepository()
           
 String getDefaultDomain()
           
 String[] getDomains()
           
 Integer getMBeanCount()
           
 javax.management.MBeanInfo getMBeanInfo(javax.management.ObjectName name)
           
 javax.management.ObjectInstance getObjectInstance(javax.management.ObjectName name)
           
static javax.management.MBeanServer getRegisteredMBeanServer(javax.management.MBeanServer server)
          Provide access to the original MBeanServer that was registered so that it can be removed on shutdown for example.
 Object instantiate(String className)
           
 Object instantiate(String className, Object[] params, String[] signature)
           
 Object instantiate(String className, javax.management.ObjectName loaderName)
           
 Object instantiate(String className, javax.management.ObjectName loaderName, Object[] params, String[] signature)
           
 Object invoke(javax.management.ObjectName name, String operationName, Object[] params, String[] signature)
           
 boolean isInstanceOf(javax.management.ObjectName name, String className)
           
 boolean isRegistered(javax.management.ObjectName name)
           
 Set queryMBeans(javax.management.ObjectName name, javax.management.QueryExp query)
           
 Set queryNames(javax.management.ObjectName name, javax.management.QueryExp query)
           
 javax.management.ObjectInstance registerMBean(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, 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, Object handback)
           
static javax.management.MBeanServer resetToJBossServer(javax.management.MBeanServer server)
          Called by the ServerImpl to reset theServer implementation to the jboss version so that our xmbean and the like function correctly.
 void setAttribute(javax.management.ObjectName name, javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes)
           
 void unregisterMBean(javax.management.ObjectName name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

resetToJBossServer

public static javax.management.MBeanServer resetToJBossServer(javax.management.MBeanServer server)
                                                       throws Exception
Called by the ServerImpl to reset theServer implementation to the jboss version so that our xmbean and the like function correctly.

Parameters:
server - - the existing MBeanServer
Returns:
org.jboss.mx.server.MBeanServerImp
Throws:
Exception

getRegisteredMBeanServer

public static javax.management.MBeanServer getRegisteredMBeanServer(javax.management.MBeanServer server)
Provide access to the original MBeanServer that was registered so that it can be removed on shutdown for example.

Parameters:
server - - the ServerImple MBeanServer
Returns:
either the argument, or the last LazyMBeanServer created

createMBean

public javax.management.ObjectInstance createMBean(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(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(String className,
                                                   javax.management.ObjectName name,
                                                   Object[] params,
                                                   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(String className,
                                                   javax.management.ObjectName name,
                                                   javax.management.ObjectName loaderName,
                                                   Object[] params,
                                                   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

registerMBean

public javax.management.ObjectInstance registerMBean(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

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

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

queryMBeans

public Set 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 Set 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

isRegistered

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

getMBeanCount

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

getAttribute

public Object getAttribute(javax.management.ObjectName name,
                           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,
                                                    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

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

invoke

public Object invoke(javax.management.ObjectName name,
                     String operationName,
                     Object[] params,
                     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

getDefaultDomain

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

getDomains

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

addNotificationListener

public void addNotificationListener(javax.management.ObjectName name,
                                    javax.management.NotificationListener listener,
                                    javax.management.NotificationFilter filter,
                                    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,
                                    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

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.ObjectName listener,
                                       javax.management.NotificationFilter filter,
                                       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)
                                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,
                                       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

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

isInstanceOf

public boolean isInstanceOf(javax.management.ObjectName name,
                            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

instantiate

public Object instantiate(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 Object instantiate(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 Object instantiate(String className,
                          Object[] params,
                          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 Object instantiate(String className,
                          javax.management.ObjectName loaderName,
                          Object[] params,
                          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

deserialize

public ObjectInputStream deserialize(javax.management.ObjectName name,
                                     byte[] data)
                              throws javax.management.InstanceNotFoundException,
                                     javax.management.OperationsException
Specified by:
deserialize in interface javax.management.MBeanServer
Throws:
javax.management.InstanceNotFoundException
javax.management.OperationsException

deserialize

public ObjectInputStream deserialize(String className,
                                     byte[] data)
                              throws javax.management.OperationsException,
                                     javax.management.ReflectionException
Specified by:
deserialize in interface javax.management.MBeanServer
Throws:
javax.management.OperationsException
javax.management.ReflectionException

deserialize

public ObjectInputStream deserialize(String className,
                                     javax.management.ObjectName loaderName,
                                     byte[] data)
                              throws javax.management.InstanceNotFoundException,
                                     javax.management.OperationsException,
                                     javax.management.ReflectionException
Specified by:
deserialize in interface javax.management.MBeanServer
Throws:
javax.management.InstanceNotFoundException
javax.management.OperationsException
javax.management.ReflectionException

getClassLoaderFor

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

getClassLoader

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

getClassLoaderRepository

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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.