mx4j.server
Class MX4JMBeanServer
public
class
MX4JMBeanServer
extends Object
implements MBeanServer
The MX4J MBeanServer implementation.
The MBeanServer accomplishes these roles:
- Returns information about the Agent
- Acts as a repository for MBeans
- Acts as an invoker, on behalf of the user, on MBeans
The repository function is delegated to instances of
MBeanRepository classes.
This class acts as a factory for MBeanRepository instances, that can be controlled via the system property
MX4J_MBEANSERVER_REPOSITORY to the qualified name of the implementation class.
This class also acts as an invoker on MBeans. The architecture is interceptor-based, that is whenever you call
from a client an MBeanServer method that will end up to call the MBean instance, the call is dispatched to
the interceptor chain and eventually to the MBean.
The interceptors are configurable via the MBean
MBeanServerInterceptorConfigurator.
When the call is about to arrive to the MBean instance, the last interceptor dispatches the call depending on
the MBean type: if the MBean is a dynamic MBean, the call is dispatched directly; if the MBean is a standard
MBean an
MBeanInvoker is delegated to invoke on the MBean instance.
Version: $Revision: 1.31 $
Constructor Summary |
| MX4JMBeanServer(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate)
Create a new MBeanServer implementation with the specified default domain.
|
Method Summary |
void | addNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback) |
void | addNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback) |
ObjectInstance | createMBean(String className, ObjectName objectName) |
ObjectInstance | createMBean(String className, ObjectName objectName, Object[] args, String[] parameters) |
ObjectInstance | createMBean(String className, ObjectName objectName, ObjectName loaderName) |
ObjectInstance | createMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] args, String[] parameters) |
ObjectInputStream | deserialize(String className, ObjectName loaderName, byte[] bytes) |
ObjectInputStream | deserialize(String className, byte[] bytes) |
ObjectInputStream | deserialize(ObjectName objectName, byte[] bytes) |
Object | getAttribute(ObjectName objectName, String attribute) |
AttributeList | getAttributes(ObjectName objectName, String[] attributes) |
ClassLoader | getClassLoader(ObjectName name) |
ClassLoader | getClassLoaderFor(ObjectName name) |
ClassLoaderRepository | getClassLoaderRepository()
Returns the ClassLoaderRepository for this MBeanServer.
|
String | getDefaultDomain() |
String[] | getDomains() |
Integer | getMBeanCount() |
MBeanInfo | getMBeanInfo(ObjectName objectName) |
ObjectInstance | getObjectInstance(ObjectName objectName) |
Object | instantiate(String className) |
Object | instantiate(String className, Object[] args, String[] parameters) |
Object | instantiate(String className, ObjectName loaderName) |
Object | instantiate(String className, ObjectName loaderName, Object[] args, String[] parameters) |
Object | invoke(ObjectName objectName, String methodName, Object[] args, String[] parameters) |
boolean | isInstanceOf(ObjectName objectName, String className) |
boolean | isRegistered(ObjectName objectName) |
Set | queryMBeans(ObjectName patternName, QueryExp filter) |
Set | queryNames(ObjectName patternName, QueryExp filter) |
ObjectInstance | registerMBean(Object mbean, ObjectName objectName) |
void | removeNotificationListener(ObjectName observed, ObjectName listener) |
void | removeNotificationListener(ObjectName observed, NotificationListener listener) |
void | removeNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback) |
void | removeNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback) |
void | setAttribute(ObjectName objectName, Attribute attribute) |
AttributeList | setAttributes(ObjectName objectName, AttributeList attributes) |
void | unregisterMBean(ObjectName objectName) |
public MX4JMBeanServer(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate)
Create a new MBeanServer implementation with the specified default domain.
If the default domain is null, then the empty string is assumed.
Parameters: defaultDomain The default domain to be used
Throws: SecurityException if access is not granted to create an MBeanServer instance
public void addNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback)
public void addNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)
public ObjectInstance createMBean(String className, ObjectName objectName)
public ObjectInstance createMBean(String className, ObjectName objectName, Object[] args, String[] parameters)
public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName)
public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] args, String[] parameters)
public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] bytes)
public ObjectInputStream deserialize(String className, byte[] bytes)
public ObjectInputStream deserialize(ObjectName objectName, byte[] bytes)
public Object getAttribute(ObjectName objectName, String attribute)
public AttributeList getAttributes(ObjectName objectName, String[] attributes)
public ClassLoader getClassLoader(ObjectName name)
public ClassLoader getClassLoaderFor(ObjectName name)
public ClassLoaderRepository getClassLoaderRepository()
public String getDefaultDomain()
public String[] getDomains()
public Integer getMBeanCount()
public MBeanInfo getMBeanInfo(ObjectName objectName)
public ObjectInstance getObjectInstance(ObjectName objectName)
public Object instantiate(String className)
public Object instantiate(String className, Object[] args, String[] parameters)
public Object instantiate(String className, ObjectName loaderName)
public Object instantiate(String className, ObjectName loaderName, Object[] args, String[] parameters)
public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] parameters)
public boolean isInstanceOf(ObjectName objectName, String className)
public boolean isRegistered(ObjectName objectName)
public Set queryMBeans(ObjectName patternName, QueryExp filter)
public Set queryNames(ObjectName patternName, QueryExp filter)
public ObjectInstance registerMBean(Object mbean, ObjectName objectName)
public void removeNotificationListener(ObjectName observed, ObjectName listener)
public void removeNotificationListener(ObjectName observed, NotificationListener listener)
public void removeNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback)
public void removeNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)
public void setAttribute(ObjectName objectName, Attribute attribute)
public AttributeList setAttributes(ObjectName objectName, AttributeList attributes)
public void unregisterMBean(ObjectName objectName)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.