|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.server.MBeanServerImpl
public class MBeanServerImpl
MBean server implementation. The MBean server behaviour can be configured by setting the following system properties:
LOADER_REPOSITORY_CLASS_PROPERTY
)MBEAN_REGISTRY_CLASS_PROPERTY
)REQUIRED_MODELMBEAN_CLASS_PROPERTY
)DEFAULT_LOADER_REPOSITORY_CLASS
).
The default registry is
(DEFAULT_MBEAN_REGISTRY_CLASS
).
The RequiredModelMBean uses XMBean implementation by default
(DEFAULT_REQUIRED_MODELMBEAN_CLASS
).
MBeanServer
,
RequiredModelMBean
,
ServerConstants
,
LoaderRepository
,
UnifiedLoaderRepository3
,
XMBean
Field Summary | |
---|---|
protected MBeanServer |
outer
The wrapping MBeanServer |
protected MBeanRegistry |
registry
Registry used by this server to map MBean object names to resource references. |
Fields inherited from interface org.jboss.mx.service.ServiceConstants |
---|
JBOSSMX_DOMAIN, JBOSSMX_XMBEAN_DTD_1_0, JBOSSMX_XMBEAN_DTD_1_1, JBOSSMX_XMBEAN_DTD_1_2, MBEAN_LOADER_DTD_1_0, PERSISTENCE_TIMER, PUBLIC_JBOSSMX_XMBEAN_DTD_1_0, PUBLIC_JBOSSMX_XMBEAN_DTD_1_1, PUBLIC_JBOSSMX_XMBEAN_DTD_1_2 |
Constructor Summary | |
---|---|
MBeanServerImpl(String defaultDomain,
MBeanServer outer,
MBeanServerDelegate delegate)
Creates an MBean server implementation with a given default domain name and registers the mandatory server delegate MBean to the server ( MBEAN_SERVER_DELEGATE ). |
Method Summary | |
---|---|
void |
addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Adds a listener to a registered MBean. |
void |
addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Adds a listener to a registered MBean. |
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)
|
protected MBeanRegistry |
createRegistry(String defaultDomain)
|
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 name)
|
ClassLoader |
getClassLoaderFor(ObjectName name)
|
ClassLoaderRepository |
getClassLoaderRepository()
Retrieve the classloader repository for this mbean server |
String |
getDefaultDomain()
|
String[] |
getDomains()
|
Integer |
getMBeanCount()
|
MBeanInfo |
getMBeanInfo(ObjectName name)
|
ObjectInstance |
getObjectInstance(ObjectName name)
|
protected void |
handleInstantiateExceptions(Throwable t,
String className)
Handles errors thrown during class instantiation |
Object |
instantiate(String className)
|
protected Object |
instantiate(String className,
ClassLoader cl,
Object[] params,
String[] signature)
Instantiate an object, the passed classloader is set as the thread's context classloader for the duration of this method. |
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)
|
protected boolean |
queryMBean(ObjectName objectName,
QueryExp queryExp)
Query an MBean against the query |
Set |
queryMBeans(ObjectName name,
QueryExp query)
|
Set |
queryNames(ObjectName name,
QueryExp query)
|
ObjectInstance |
registerMBean(Object object,
ObjectName name)
Registers a pre-existing object as an MBean with the MBean server. |
protected ObjectInstance |
registerMBean(Object object,
ObjectName name,
ClassLoader cl)
Register an MBean |
protected ObjectInstance |
registerMBean(Object mbean,
ObjectName name,
ObjectName loaderName)
Register an MBean |
void |
releaseServer()
|
void |
removeNotificationListener(ObjectName name,
NotificationListener listener)
Removes a listener from a registered MBean. |
void |
removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback)
Removes a listener from a registered MBean. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener)
Removes a listener from a registered MBean. |
void |
removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback)
Removes a listener from a registered MBean. |
void |
setAttribute(ObjectName name,
Attribute attribute)
|
AttributeList |
setAttributes(ObjectName name,
AttributeList attributes)
|
String |
toString()
Simple toString() revealing default domain |
void |
unregisterMBean(ObjectName name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected MBeanServer outer
protected MBeanRegistry registry
Constructor Detail |
---|
public MBeanServerImpl(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate)
MBEAN_SERVER_DELEGATE
).
defaultDomain
- default domain nameouter
- the wrapping MBeanServer, passed to MBeans
at registration.delegate
- the delegate to use
for Notifications.Method Detail |
---|
public Object instantiate(String className) throws ReflectionException, MBeanException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public Object instantiate(String className, Object[] params, String[] signature) throws ReflectionException, MBeanException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
public Object instantiate(String className, ObjectName loaderName) throws ReflectionException, MBeanException, InstanceNotFoundException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public Object instantiate(String className, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, MBeanException, InstanceNotFoundException
instantiate
in interface MBeanServer
ReflectionException
MBeanException
InstanceNotFoundException
public ObjectInstance createMBean(String className, ObjectName name) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public ObjectInstance createMBean(String className, ObjectName name, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public ObjectInstance createMBean(String className, ObjectName name, ObjectName loaderName, Object[] params, String[] signature) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
createMBean
in interface MBeanServer
createMBean
in interface MBeanServerConnection
ReflectionException
InstanceAlreadyExistsException
MBeanRegistrationException
MBeanException
NotCompliantMBeanException
InstanceNotFoundException
public ObjectInstance registerMBean(Object object, ObjectName name) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
registerMBean
in interface MBeanServer
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException
unregisterMBean
in interface MBeanServer
unregisterMBean
in interface MBeanServerConnection
InstanceNotFoundException
MBeanRegistrationException
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException
getObjectInstance
in interface MBeanServer
getObjectInstance
in interface MBeanServerConnection
InstanceNotFoundException
public Set queryMBeans(ObjectName name, QueryExp query)
queryMBeans
in interface MBeanServer
queryMBeans
in interface MBeanServerConnection
public Set queryNames(ObjectName name, QueryExp query)
queryNames
in interface MBeanServer
queryNames
in interface MBeanServerConnection
public boolean isRegistered(ObjectName name)
isRegistered
in interface MBeanServer
isRegistered
in interface MBeanServerConnection
public Integer getMBeanCount()
getMBeanCount
in interface MBeanServer
getMBeanCount
in interface MBeanServerConnection
public Object getAttribute(ObjectName name, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
getAttribute
in interface MBeanServer
getAttribute
in interface MBeanServerConnection
MBeanException
AttributeNotFoundException
InstanceNotFoundException
ReflectionException
public AttributeList getAttributes(ObjectName name, String[] attributes) throws InstanceNotFoundException, ReflectionException
getAttributes
in interface MBeanServer
getAttributes
in interface MBeanServerConnection
InstanceNotFoundException
ReflectionException
public void setAttribute(ObjectName name, Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException
setAttribute
in interface MBeanServer
setAttribute
in interface MBeanServerConnection
InstanceNotFoundException
AttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionException
public AttributeList setAttributes(ObjectName name, AttributeList attributes) throws InstanceNotFoundException, ReflectionException
setAttributes
in interface MBeanServer
setAttributes
in interface MBeanServerConnection
InstanceNotFoundException
ReflectionException
public Object invoke(ObjectName name, String operationName, Object[] params, String[] signature) throws InstanceNotFoundException, MBeanException, ReflectionException
invoke
in interface MBeanServer
invoke
in interface MBeanServerConnection
InstanceNotFoundException
MBeanException
ReflectionException
public MBeanInfo getMBeanInfo(ObjectName name) throws InstanceNotFoundException, IntrospectionException, ReflectionException
getMBeanInfo
in interface MBeanServer
getMBeanInfo
in interface MBeanServerConnection
InstanceNotFoundException
IntrospectionException
ReflectionException
public String getDefaultDomain()
getDefaultDomain
in interface MBeanServer
getDefaultDomain
in interface MBeanServerConnection
public String[] getDomains()
getDomains
in interface MBeanServer
getDomains
in interface MBeanServerConnection
public void addNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
public void addNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException
addNotificationListener
in interface MBeanServer
addNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
public void removeNotificationListener(ObjectName name, NotificationListener listener) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, ObjectName listener) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, NotificationListener listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public void removeNotificationListener(ObjectName name, ObjectName listener, NotificationFilter filter, Object handback) throws InstanceNotFoundException, ListenerNotFoundException
removeNotificationListener
in interface MBeanServer
removeNotificationListener
in interface MBeanServerConnection
InstanceNotFoundException
ListenerNotFoundException
public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException
isInstanceOf
in interface MBeanServer
isInstanceOf
in interface MBeanServerConnection
InstanceNotFoundException
public ObjectInputStream deserialize(ObjectName name, byte[] data) throws InstanceNotFoundException, OperationsException
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
public ObjectInputStream deserialize(String className, byte[] data) throws OperationsException, ReflectionException
deserialize
in interface MBeanServer
OperationsException
ReflectionException
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] data) throws InstanceNotFoundException, OperationsException, ReflectionException
deserialize
in interface MBeanServer
InstanceNotFoundException
OperationsException
ReflectionException
public ClassLoader getClassLoaderFor(ObjectName name) throws InstanceNotFoundException
getClassLoaderFor
in interface MBeanServer
InstanceNotFoundException
public ClassLoader getClassLoader(ObjectName name) throws InstanceNotFoundException
getClassLoader
in interface MBeanServer
name
- The ObjectName of the ClassLoader. May be null, in which case
the MBean server's own ClassLoader is returned.
InstanceNotFoundException
public ClassLoaderRepository getClassLoaderRepository()
getClassLoaderRepository
in interface MBeanServer
public void releaseServer()
protected Object instantiate(String className, ClassLoader cl, Object[] params, String[] signature) throws ReflectionException, MBeanException
className
- the class name of the object to instantiatecl
- the thread classloader, pass null to use the ClassLoaderRepositoryparams
- the parameters for the constructorsignature
- the signature of the constructor
ReflectionException
- wraps a ClassCastException or
any Exception trying to invoke the constructor
MBeanException
- wraps any exception thrown by the constructor
RuntimeOperationsException
- Wraps an IllegalArgument for a
null classNameprotected void handleInstantiateExceptions(Throwable t, String className) throws ReflectionException, MBeanException
ReflectionException
MBeanException
protected ObjectInstance registerMBean(Object mbean, ObjectName name, ObjectName loaderName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException
The classloader is used as the thread context classloader during access to the mbean and it's interceptors
mbean
- the mbean to registername
- the object name to registerloaderName
- the object name of a class loader also used as
as the MBeans TCL
InstanceAlreadyExistsException
- when already registered
MBeanRegistrationException
- when
preRegister(MBeanServer, ObjectName) throws an exception
NotCompliantMBeanException
- when the object is not an MBean
ReflectionException
MBeanException
InstanceNotFoundException
protected ObjectInstance registerMBean(Object object, ObjectName name, ClassLoader cl) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException
The classloader is used as the thread context classloader during access to the mbean and it's interceptors
object
- the mbean to registername
- the object name to registercl
- the thread classloader, pass null for the current one
InstanceAlreadyExistsException
- when already registered
MBeanRegistrationException
- when
preRegister(MBeanServer, ObjectName) throws an exception
NotCompliantMBeanException
- when the object is not an MBeanprotected boolean queryMBean(ObjectName objectName, QueryExp queryExp)
objectName
- the object name of the mbean to checkqueryExp
- the query expression to test
protected MBeanRegistry createRegistry(String defaultDomain)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |