mx4j.server

Class MX4JMBeanServer

public class MX4JMBeanServer extends Object implements MBeanServer

The MX4J MBeanServer implementation.
The MBeanServer accomplishes these roles:
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
voidaddNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback)
voidaddNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)
ObjectInstancecreateMBean(String className, ObjectName objectName)
ObjectInstancecreateMBean(String className, ObjectName objectName, Object[] args, String[] parameters)
ObjectInstancecreateMBean(String className, ObjectName objectName, ObjectName loaderName)
ObjectInstancecreateMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] args, String[] parameters)
ObjectInputStreamdeserialize(String className, ObjectName loaderName, byte[] bytes)
ObjectInputStreamdeserialize(String className, byte[] bytes)
ObjectInputStreamdeserialize(ObjectName objectName, byte[] bytes)
ObjectgetAttribute(ObjectName objectName, String attribute)
AttributeListgetAttributes(ObjectName objectName, String[] attributes)
ClassLoadergetClassLoader(ObjectName name)
ClassLoadergetClassLoaderFor(ObjectName name)
ClassLoaderRepositorygetClassLoaderRepository()
Returns the ClassLoaderRepository for this MBeanServer.
StringgetDefaultDomain()
String[]getDomains()
IntegergetMBeanCount()
MBeanInfogetMBeanInfo(ObjectName objectName)
ObjectInstancegetObjectInstance(ObjectName objectName)
Objectinstantiate(String className)
Objectinstantiate(String className, Object[] args, String[] parameters)
Objectinstantiate(String className, ObjectName loaderName)
Objectinstantiate(String className, ObjectName loaderName, Object[] args, String[] parameters)
Objectinvoke(ObjectName objectName, String methodName, Object[] args, String[] parameters)
booleanisInstanceOf(ObjectName objectName, String className)
booleanisRegistered(ObjectName objectName)
SetqueryMBeans(ObjectName patternName, QueryExp filter)
SetqueryNames(ObjectName patternName, QueryExp filter)
ObjectInstanceregisterMBean(Object mbean, ObjectName objectName)
voidremoveNotificationListener(ObjectName observed, ObjectName listener)
voidremoveNotificationListener(ObjectName observed, NotificationListener listener)
voidremoveNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback)
voidremoveNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)
voidsetAttribute(ObjectName objectName, Attribute attribute)
AttributeListsetAttributes(ObjectName objectName, AttributeList attributes)
voidunregisterMBean(ObjectName objectName)

Constructor Detail

MX4JMBeanServer

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

Method Detail

addNotificationListener

public void addNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback)

addNotificationListener

public void addNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)

createMBean

public ObjectInstance createMBean(String className, ObjectName objectName)

createMBean

public ObjectInstance createMBean(String className, ObjectName objectName, Object[] args, String[] parameters)

createMBean

public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName)

createMBean

public ObjectInstance createMBean(String className, ObjectName objectName, ObjectName loaderName, Object[] args, String[] parameters)

deserialize

public ObjectInputStream deserialize(String className, ObjectName loaderName, byte[] bytes)

deserialize

public ObjectInputStream deserialize(String className, byte[] bytes)

deserialize

public ObjectInputStream deserialize(ObjectName objectName, byte[] bytes)

getAttribute

public Object getAttribute(ObjectName objectName, String attribute)

getAttributes

public AttributeList getAttributes(ObjectName objectName, String[] attributes)

getClassLoader

public ClassLoader getClassLoader(ObjectName name)

getClassLoaderFor

public ClassLoader getClassLoaderFor(ObjectName name)

getClassLoaderRepository

public ClassLoaderRepository getClassLoaderRepository()
Returns the ClassLoaderRepository for this MBeanServer. When first the ClassLoaderRepository is created in the constructor, the system property MX4J_MBEANSERVER_CLASSLOADER_REPOSITORY is tested; if it is non-null and defines a subclass of ModifiableClassLoaderRepository, then that class is used instead of the default one.

getDefaultDomain

public String getDefaultDomain()

getDomains

public String[] getDomains()

getMBeanCount

public Integer getMBeanCount()

getMBeanInfo

public MBeanInfo getMBeanInfo(ObjectName objectName)

getObjectInstance

public ObjectInstance getObjectInstance(ObjectName objectName)

instantiate

public Object instantiate(String className)

instantiate

public Object instantiate(String className, Object[] args, String[] parameters)

instantiate

public Object instantiate(String className, ObjectName loaderName)

instantiate

public Object instantiate(String className, ObjectName loaderName, Object[] args, String[] parameters)

invoke

public Object invoke(ObjectName objectName, String methodName, Object[] args, String[] parameters)

isInstanceOf

public boolean isInstanceOf(ObjectName objectName, String className)

isRegistered

public boolean isRegistered(ObjectName objectName)

queryMBeans

public Set queryMBeans(ObjectName patternName, QueryExp filter)

queryNames

public Set queryNames(ObjectName patternName, QueryExp filter)

registerMBean

public ObjectInstance registerMBean(Object mbean, ObjectName objectName)

removeNotificationListener

public void removeNotificationListener(ObjectName observed, ObjectName listener)

removeNotificationListener

public void removeNotificationListener(ObjectName observed, NotificationListener listener)

removeNotificationListener

public void removeNotificationListener(ObjectName observed, ObjectName listener, NotificationFilter filter, Object handback)

removeNotificationListener

public void removeNotificationListener(ObjectName observed, NotificationListener listener, NotificationFilter filter, Object handback)

setAttribute

public void setAttribute(ObjectName objectName, Attribute attribute)

setAttributes

public AttributeList setAttributes(ObjectName objectName, AttributeList attributes)

unregisterMBean

public void unregisterMBean(ObjectName objectName)
Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.