| Method from com.sun.jmx.mbeanserver.JmxMBeanServer Detail: |
public void addNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback) throws InstanceNotFoundException {
mbsInterceptor.addNotificationListener(cloneObjectName(name), listener,
filter, handback);
}
Adds a listener to a registered MBean. |
public void addNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback) throws InstanceNotFoundException {
mbsInterceptor.addNotificationListener(cloneObjectName(name), listener,
filter, handback);
}
Adds a listener to a registered MBean. |
public ObjectInstance createMBean(String className,
ObjectName name) throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, ReflectionException, MBeanException {
return mbsInterceptor.createMBean(className,
cloneObjectName(name),
(Object[]) null,
(String[]) null);
}
Instantiates and registers an MBean in the MBean server.
The MBean server will use its
Default Loader Repository
to load the class of the MBean.
An object name is associated to the MBean.
If the object name given is null, the MBean can automatically
provide its own name by implementing the
MBeanRegistration interface.
The call returns an ObjectInstance object representing
the newly created MBean. |
public ObjectInstance createMBean(String className,
ObjectName name,
ObjectName loaderName) throws InstanceNotFoundException, MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, ReflectionException, MBeanException {
return mbsInterceptor.createMBean(className,
cloneObjectName(name),
loaderName,
(Object[]) null,
(String[]) null);
}
Instantiates and registers an MBean in the MBean server.
The class loader to be used is identified by its object name.
An object name is associated to the MBean.
If the object name of the loader is null, the ClassLoader that
loaded the MBean server will be used.
If the MBean's object name given is null, the MBean can
automatically provide its own name by implementing the
MBeanRegistration interface.
The call returns an ObjectInstance object representing
the newly created MBean. |
public ObjectInstance createMBean(String className,
ObjectName name,
Object[] params,
String[] signature) throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, ReflectionException, MBeanException {
return mbsInterceptor.createMBean(className, cloneObjectName(name),
params, signature);
}
Instantiates and registers an MBean in the MBean server.
The MBean server will use its
Default Loader Repository
to load the class of the MBean.
An object name is associated to the MBean.
If the object name given is null, the MBean can automatically
provide its own name by implementing the
MBeanRegistration interface.
The call returns an ObjectInstance object representing
the newly created MBean. |
public ObjectInstance createMBean(String className,
ObjectName name,
ObjectName loaderName,
Object[] params,
String[] signature) throws InstanceNotFoundException, MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, ReflectionException, MBeanException {
return mbsInterceptor.createMBean(className, cloneObjectName(name),
loaderName, params, signature);
}
Instantiates and registers an MBean in the MBean server.
The class loader to be used is identified by its object name.
An object name is associated to the MBean. If the object name
of the loader is not specified, the ClassLoader that loaded the
MBean server will be used.
If the MBean object name given is null, the MBean can automatically
provide its own name by implementing the
MBeanRegistration interface.
The call returns an ObjectInstance object representing
the newly created MBean. |
public ObjectInputStream deserialize(ObjectName name,
byte[] data) throws InstanceNotFoundException, OperationsException {
/* Permission check */
// This call requires MBeanPermission 'getClassLoaderFor'
final ClassLoader loader = getClassLoaderFor(name);
return instantiator.deserialize(loader, data);
}
De-serializes a byte array in the context of the class loader
of an MBean. |
public ObjectInputStream deserialize(String className,
byte[] data) throws ReflectionException, OperationsException {
if (className == null) {
throw new RuntimeOperationsException(
new IllegalArgumentException(),
"Null className passed in parameter");
}
/* Permission check */
// This call requires MBeanPermission 'getClassLoaderRepository'
final ClassLoaderRepository clr = getClassLoaderRepository();
Class theClass;
try {
if (clr == null) throw new ClassNotFoundException(className);
theClass = clr.loadClass(className);
} catch (ClassNotFoundException e) {
throw new ReflectionException(e,
"The given class could not be " +
"loaded by the default loader " +
"repository");
}
return instantiator.deserialize(theClass.getClassLoader(), data);
}
De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className". |
public ObjectInputStream deserialize(String className,
ObjectName loaderName,
byte[] data) throws InstanceNotFoundException, ReflectionException, OperationsException {
// Clone ObjectName
//
loaderName = cloneObjectName(loaderName);
/* Permission check */
// Make this call just to force the 'getClassLoader'
// permission check
try {
getClassLoader(loaderName);
} catch (SecurityException e) {
throw e;
} catch (Exception e) {
}
ClassLoader myLoader = outerShell.getClass().getClassLoader();
return instantiator.deserialize(className, loaderName, data, myLoader);
}
De-serializes a byte array in the context of a given MBean class loader.
The class loader is the one that loaded the class with name "className".
The name of the class loader to be used for loading the specified
class is specified.
If null, the MBean Server's class loader will be used. |
public Object getAttribute(ObjectName name,
String attribute) throws InstanceNotFoundException, ReflectionException, AttributeNotFoundException, MBeanException {
return mbsInterceptor.getAttribute(cloneObjectName(name), attribute);
}
Gets the value of a specific attribute of a named MBean. The MBean
is identified by its object name. |
public AttributeList getAttributes(ObjectName name,
String[] attributes) throws InstanceNotFoundException, ReflectionException {
return mbsInterceptor.getAttributes(cloneObjectName(name), attributes);
}
Enables the values of several attributes of a named MBean. The MBean
is identified by its object name. |
public ClassLoader getClassLoader(ObjectName loaderName) throws InstanceNotFoundException {
return mbsInterceptor.getClassLoader(cloneObjectName(loaderName));
}
|
public ClassLoader getClassLoaderFor(ObjectName mbeanName) throws InstanceNotFoundException {
return mbsInterceptor.getClassLoaderFor(cloneObjectName(mbeanName));
}
|
public ClassLoaderRepository getClassLoaderRepository() {
/* Permission check */
checkMBeanPermission(null, null, null, "getClassLoaderRepository");
return secureClr;
}
|
public String getDefaultDomain() {
return mbsInterceptor.getDefaultDomain();
}
Returns the default domain used for naming the MBean.
The default domain name is used as the domain part in the ObjectName
of MBeans if no domain is specified by the user. |
public String[] getDomains() {
return mbsInterceptor.getDomains();
}
|
public Integer getMBeanCount() {
return mbsInterceptor.getMBeanCount();
}
Returns the number of MBeans registered in the MBean server. |
public MBeanInfo getMBeanInfo(ObjectName name) throws IntrospectionException, InstanceNotFoundException, ReflectionException {
return mbsInterceptor.getMBeanInfo(cloneObjectName(name));
}
This method discovers the attributes and operations that an MBean exposes
for management. |
public MBeanInstantiator getMBeanInstantiator() {
if (interceptorsEnabled) return instantiator;
else throw new UnsupportedOperationException(
"MBeanServerInterceptors are disabled.");
}
Return the MBeanInstantiator associated to this MBeanServer. |
public MBeanServerDelegate getMBeanServerDelegate() {
if (!interceptorsEnabled) throw new UnsupportedOperationException(
"MBeanServerInterceptors are disabled.");
return mBeanServerDelegateObject;
}
|
public synchronized MBeanServerInterceptor getMBeanServerInterceptor() {
if (interceptorsEnabled) return mbsInterceptor;
else throw new UnsupportedOperationException(
"MBeanServerInterceptors are disabled.");
}
Return the MBeanServerInterceptor. |
public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException {
return mbsInterceptor.getObjectInstance(cloneObjectName(name));
}
Gets the ObjectInstance for a given MBean registered
with the MBean server. |
public Object instantiate(String className) throws ReflectionException, MBeanException {
/* Permission check */
checkMBeanPermission(className, null, null, "instantiate");
return instantiator.instantiate(className);
}
Instantiates an object using the list of all class loaders registered
in the MBean server (using its
Default Loader Repository ).
The object's class should have a public constructor.
It returns a reference to the newly created object.
The newly created object is not registered in the MBean server. |
public Object instantiate(String className,
ObjectName loaderName) throws InstanceNotFoundException, ReflectionException, MBeanException {
/* Permission check */
checkMBeanPermission(className, null, null, "instantiate");
ClassLoader myLoader = outerShell.getClass().getClassLoader();
return instantiator.instantiate(className, loaderName, myLoader);
}
Instantiates an object using the class Loader specified by its
ObjectName.
If the loader name is null, the ClassLoader that loaded the
MBean Server will be used.
The object's class should have a public constructor.
It returns a reference to the newly created object.
The newly created object is not registered in the MBean server. |
public Object instantiate(String className,
Object[] params,
String[] signature) throws ReflectionException, MBeanException {
/* Permission check */
checkMBeanPermission(className, null, null, "instantiate");
ClassLoader myLoader = outerShell.getClass().getClassLoader();
return instantiator.instantiate(className, params, signature,
myLoader);
}
Instantiates an object using the list of all class loaders registered
in the MBean server (using its
Default Loader Repository ).
The object's class should have a public constructor.
The call returns a reference to the newly created object.
The newly created object is not registered in the MBean server. |
public Object instantiate(String className,
ObjectName loaderName,
Object[] params,
String[] signature) throws InstanceNotFoundException, ReflectionException, MBeanException {
/* Permission check */
checkMBeanPermission(className, null, null, "instantiate");
ClassLoader myLoader = outerShell.getClass().getClassLoader();
return instantiator.instantiate(className,loaderName,params,signature,
myLoader);
}
Instantiates an object. The class loader to be used is identified
by its object name. If the object name of the loader is null,
the ClassLoader that loaded the MBean server will be used.
The object's class should have a public constructor.
The call returns a reference to the newly created object.
The newly created object is not registered in the MBean server. |
public boolean interceptorsEnabled() {
return interceptorsEnabled;
}
|
public Object invoke(ObjectName name,
String operationName,
Object[] params,
String[] signature) throws InstanceNotFoundException, ReflectionException, MBeanException {
return mbsInterceptor.invoke(cloneObjectName(name), operationName,
params, signature);
}
Invokes an operation on an MBean. |
public boolean isInstanceOf(ObjectName name,
String className) throws InstanceNotFoundException {
return mbsInterceptor.isInstanceOf(cloneObjectName(name), className);
}
Returns true if the MBean specified is an instance of the specified
class, false otherwise. |
public boolean isRegistered(ObjectName name) {
return mbsInterceptor.isRegistered(name);
}
Checks whether an MBean, identified by its object name, is already
registered with the MBean server. |
public static MBeanServer newMBeanServer(String defaultDomain,
MBeanServer outer,
MBeanServerDelegate delegate,
boolean interceptors) {
// Determine whether to use fair locking for the repository.
// Default is true.
final boolean fairLock = DEFAULT_FAIR_LOCK_POLICY;
// This constructor happens to disregard the value of the interceptors
// flag - that is, it always uses the default value - false.
// This is admitedly a bug, but we chose not to fix it for now
// since we would rather not have anybody depending on the Sun private
// interceptor APIs - which is most probably going to be removed and
// replaced by a public (javax) feature in the future.
//
return new JmxMBeanServer(defaultDomain,outer,delegate,null,
interceptors,fairLock);
}
This method creates a new MBeanServer implementation object.
When creating a new MBeanServer the
javax.management.MBeanServerBuilder first calls
newMBeanServerDelegate() in order to obtain a new
javax.management.MBeanServerDelegate for the new
MBeanServer. Then it calls
newMBeanServer(defaultDomain,outer,delegate)
passing the delegate that should be used by the
MBeanServer implementation.
Note that the passed delegate might not be directly the
MBeanServerDelegate that was returned by this implementation. It could
be, for instance, a new object wrapping the previously
returned delegate.
The outer parameter is a pointer to the MBeanServer that
should be passed to the javax.management.MBeanRegistration
interface when registering MBeans inside the MBeanServer.
If outer is null, then the MBeanServer
implementation is free to use its own this pointer when
invoking the javax.management.MBeanRegistration interface.
This makes it possible for a MBeanServer implementation to wrap
another MBeanServer implementation, in order to implement, e.g,
security checks, or to prevent access to the actual MBeanServer
implementation by returning a pointer to a wrapping object. |
public static MBeanServerDelegate newMBeanServerDelegate() {
return new MBeanServerDelegateImpl();
}
This method creates a new MBeanServerDelegate for a new MBeanServer.
When creating a new MBeanServer the
javax.management.MBeanServerBuilder first calls this method
in order to create a new MBeanServerDelegate.
Then it calls
newMBeanServer(defaultDomain,outer,delegate,interceptors)
passing the delegate that should be used by the MBeanServer
implementation.
Note that the passed delegate might not be directly the
MBeanServerDelegate that was returned by this method. It could
be, for instance, a new object wrapping the previously
returned object. |
public Set queryMBeans(ObjectName name,
QueryExp query) {
return mbsInterceptor.queryMBeans(cloneObjectName(name), query);
}
Gets MBeans controlled by the MBean server. This method allows any
of the following to be obtained: All MBeans, a set of MBeans specified
by pattern matching on the ObjectName and/or a Query
expression, a specific MBean. When the object name is null or no
domain and key properties are specified, all objects are to be
selected (and filtered if a query is specified). It returns the
set of ObjectInstance objects (containing the
ObjectName and the Java Class name) for
the selected MBeans. |
public Set queryNames(ObjectName name,
QueryExp query) {
return mbsInterceptor.queryNames(cloneObjectName(name), query);
}
Gets the names of MBeans controlled by the MBean server. This method
enables any of the following to be obtained: The names of all MBeans,
the names of a set of MBeans specified by pattern matching on the
ObjectName and/or a Query expression, a specific
MBean name (equivalent to testing whether an MBean is registered).
When the object name is null or or no domain and key properties are
specified, all objects are selected (and filtered if a query is
specified). It returns the set of ObjectNames for the MBeans
selected. |
public ObjectInstance registerMBean(Object object,
ObjectName name) throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException {
return mbsInterceptor.registerMBean(object, cloneObjectName(name));
}
Registers a pre-existing object as an MBean with the MBean server.
If the object name given is null, the MBean may automatically
provide its own name by implementing the
MBeanRegistration interface.
The call returns an ObjectInstance object representing
the registered MBean. |
public void removeNotificationListener(ObjectName name,
NotificationListener listener) throws ListenerNotFoundException, InstanceNotFoundException {
mbsInterceptor.removeNotificationListener(cloneObjectName(name),
listener);
}
|
public void removeNotificationListener(ObjectName name,
ObjectName listener) throws ListenerNotFoundException, InstanceNotFoundException {
mbsInterceptor.removeNotificationListener(cloneObjectName(name),
listener);
}
|
public void removeNotificationListener(ObjectName name,
NotificationListener listener,
NotificationFilter filter,
Object handback) throws ListenerNotFoundException, InstanceNotFoundException {
mbsInterceptor.removeNotificationListener(cloneObjectName(name),
listener, filter, handback);
}
|
public void removeNotificationListener(ObjectName name,
ObjectName listener,
NotificationFilter filter,
Object handback) throws ListenerNotFoundException, InstanceNotFoundException {
mbsInterceptor.removeNotificationListener(cloneObjectName(name),
listener, filter, handback);
}
|
public void setAttribute(ObjectName name,
Attribute attribute) throws InstanceNotFoundException, InvalidAttributeValueException, ReflectionException, AttributeNotFoundException, MBeanException {
mbsInterceptor.setAttribute(cloneObjectName(name),
cloneAttribute(attribute));
}
Sets the value of a specific attribute of a named MBean. The MBean
is identified by its object name. |
public AttributeList setAttributes(ObjectName name,
AttributeList attributes) throws InstanceNotFoundException, ReflectionException {
return mbsInterceptor.setAttributes(cloneObjectName(name),
cloneAttributeList(attributes));
}
Sets the values of several attributes of a named MBean. The MBean is
identified by its object name. |
public synchronized void setMBeanServerInterceptor(MBeanServerInterceptor interceptor) {
if (!interceptorsEnabled) throw new UnsupportedOperationException(
"MBeanServerInterceptors are disabled.");
if (interceptor == null) throw new
IllegalArgumentException("MBeanServerInterceptor is null");
mbsInterceptor = interceptor;
}
Set the MBeanServerInterceptor. |
public void unregisterMBean(ObjectName name) throws InstanceNotFoundException, MBeanRegistrationException {
mbsInterceptor.unregisterMBean(cloneObjectName(name));
}
De-registers an MBean from the MBean server. The MBean is identified by
its object name. Once the method has been invoked, the MBean may
no longer be accessed by its object name. |