Methods Summary |
---|
public void | addNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)Enables to add a listener to a registered MBean.
/*
Object svr = findServer(name);
if (svr instanceof MBeanServer) {
if (listener instanceof RemoteListenerConnector) {
((RemoteListenerConnector)listener).setMBeanServer((MBeanServer)svr);
}
((MBeanServer)svr).addNotificationListener(name, listener, filter, handback);;
return;
}
//not yet supported, need to add to IIOPMBeanServer interface/impl
//((IIOPMBeanServer)svr).addNotificationListener(name, listener, filter, handback);
*/
server.addNotificationListener(name, listener, filter, handback);
|
public void | addNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener, javax.management.NotificationFilter filter, java.lang.Object handback)Enables to add a listener to a registered MBean.
server.addNotificationListener(name, listener, filter, handback);
|
public javax.management.ObjectInstance | createMBean(java.lang.String className, javax.management.ObjectName name)Instantiates and registers an MBean in the MBean server. The MBean server will use the {@link
javax.management.loading.DefaultLoaderRepository 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 {@link javax.management.MBeanRegistration MBeanRegistration} interface. The call returns
an ObjectInstance object representing the newly created MBean.
return server.createMBean(className, name);
|
public javax.management.ObjectInstance | createMBean(java.lang.String className, javax.management.ObjectName name, javax.management.ObjectName loaderName)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 {@link javax.management.MBeanRegistration MBeanRegistration} interface. The call returns
an ObjectInstance object representing the newly created MBean.
return server.createMBean(className, name, loaderName);
|
public javax.management.ObjectInstance | createMBean(java.lang.String className, javax.management.ObjectName name, java.lang.Object[] params, java.lang.String[] signature)Instantiates and registers an MBean in the MBean server.
The MBean server will use the {@link javax.management.loading.DefaultLoaderRepository 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 {@link javax.management.MBeanRegistration MBeanRegistration}
interface. The call returns an ObjectInstance object representing the newly created MBean.
return server.createMBean(className, name, params, signature);
|
public javax.management.ObjectInstance | createMBean(java.lang.String className, javax.management.ObjectName name, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] 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 {@link javax.management.MBeanRegistration MBeanRegistration} interface. The call returns
an ObjectInstance object representing the newly created MBean.
return server.createMBean(className, name, loaderName, params, signature);
|
public java.lang.Object | getAttribute(javax.management.ObjectName name, java.lang.String attribute)Gets the value of a specific attribute of a named MBean. The MBean is identified by its object name.
/*
Object svr = findServer(name);
if (svr instanceof MBeanServer) {
return ((MBeanServer)svr).getAttribute(name, attribute);
}
return ((IIOPMBeanServer)svr).getAttribute(name, attribute);
*/
return server.getAttribute(name, attribute);
|
public javax.management.AttributeList | getAttributes(javax.management.ObjectName name, java.lang.String[] attributes)Enables the values of several attributes of a named MBean. The MBean is identified by its object name.
/*Object svr = findServer(name);
if (svr instanceof MBeanServer) {
return ((MBeanServer)svr).getAttributes(name, attributes);
}
return ((IIOPMBeanServer)svr).getAttributes(name, attributes);
// return server.getAttributes(name, attributes);
**/
return server.getAttributes(name, attributes);
|
public java.lang.String | getDefaultDomain()Returns the default domain used for naming the managed object.
The default domain name is used as the domain part in the ObjectName
of managed objects if no domain is specified by the user.
return server.getDefaultDomain();
|
public ListenerRegistration | getListenerRegistry()
if (listenerRegistry == null) {
try {
listenerRegistry = new ListenerRegistry(java.net.InetAddress.getLocalHost().getHostAddress());
} catch (java.net.UnknownHostException e) {
listenerRegistry = new ListenerRegistry(J2EEModuleUtil.getDomainName());
}
}
return listenerRegistry;
|
public java.lang.Integer | getMBeanCount()Returns the number of MBeans registered in the MBean server.
/*int i = 0;
Iterator servers = getRemoteMBeanServers().iterator();
while (servers.hasNext()) {
IIOPMBeanServer iiopserver = (IIOPMBeanServer)servers.next();
i = i + iiopserver.getMBeanCount().intValue();
}
//check local server
i = i + server.getMBeanCount().intValue();
return new Integer(i);
*/
return server.getMBeanCount();
|
public javax.management.MBeanInfo | getMBeanInfo(javax.management.ObjectName name)This method discovers the attributes and operations that an MBean exposes for management.
/* MBeanInfo mbi = null;
Object svr = findServer(name);
if (svr instanceof MBeanServer) {
mbi = ((MBeanServer)svr).getMBeanInfo(name);
} else {
mbi = ((IIOPMBeanServer)svr).getMBeanInfo(name);
}
return mbi;
**/
return server.getMBeanInfo(name);
|
public static synchronized com.sun.enterprise.management.agent.MEJBUtility | getMEJBUtility()
if(mejbUtility == null){
mejbUtility = new MEJBUtility();
}
return mejbUtility;
|
public javax.management.ObjectInstance | getObjectInstance(javax.management.ObjectName name)Gets the ObjectInstance for a given MBean registered with the MBean server.
return server.getObjectInstance(name);
|
public java.lang.Object | instantiate(java.lang.String className)Instantiates an object using the list of all class loaders registered
in the MBean server ({@link javax.management.loading.DefaultLoaderRepository 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.
return server.instantiate(className);
|
public java.lang.Object | instantiate(java.lang.String className, javax.management.ObjectName loaderName)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.
return server.instantiate(className, loaderName);
|
public java.lang.Object | instantiate(java.lang.String className, java.lang.Object[] params, java.lang.String[] signature)Instantiates an object using the list of all class loaders registered
in the MBean server ({@link javax.management.loading.DefaultLoaderRepository 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.
return server.instantiate(className, params, signature);
|
public java.lang.Object | instantiate(java.lang.String className, javax.management.ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature)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.
return server.instantiate(className, loaderName, params, signature);
|
public java.lang.Object | invoke(javax.management.ObjectName name, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)Invokes an operation on an MBean.
return server.invoke(name, operationName, params, signature);
/*Object svr = findServer(name);
if (svr instanceof MBeanServer) {
return ((MBeanServer)svr).invoke(name, operationName, params, signature);
}
return ((IIOPMBeanServer)svr).invoke(name, operationName, params, signature);
*/
|
public boolean | isInstanceOf(javax.management.ObjectName name, java.lang.String className)Returns true if the MBean specified is an instance of the specified class, false otherwise.
return server.isInstanceOf(name, className);
|
public boolean | isRegistered(javax.management.ObjectName name)Checks whether an MBean, identified by its object name, is already registered with the MBean server.
//check remote servers
//DON'T EVER call findServer from here!!
/*Iterator servers = getRemoteMBeanServers().iterator();
while (servers.hasNext()) {
IIOPMBeanServer iiopserver = (IIOPMBeanServer)servers.next();
if (iiopserver.isRegistered(name)) {
return true;
}
}*/
//check local server
return server.isRegistered(name);
|
public java.util.Set | queryMBeans(javax.management.ObjectName name, javax.management.QueryExp 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.
return server.queryMBeans(name, query);
|
public java.util.Set | queryNames(javax.management.ObjectName name, javax.management.QueryExp query)Find the MBean server a managed object is registered with.
/*
HashSet names = new HashSet();
Iterator servers = getRemoteMBeanServers().iterator();
if ((name == null) || (name.isPattern())) {
//check remote servers
while (servers.hasNext()) {
IIOPMBeanServer iiopserver = (IIOPMBeanServer)servers.next();
try {
names.addAll(iiopserver.queryNames(name, query));
} catch (Exception e) {
System.out.println(this + ": "+ e);
}
}
//check local server
names.addAll(server.queryNames(name, query));
} else {
try {
Object svr = findServer(name);
if (svr instanceof MBeanServer) {
names.addAll(((MBeanServer)svr).queryNames(name, query));
} else {
names.addAll(((IIOPMBeanServer)svr).queryNames(name, query));
}
} catch (InstanceNotFoundException e) {
//System.out.println(this + ": "+ e);
} catch (Exception e) {
throw e;
//throw new RemoteException(this.toString() +"::queryNames", e);
}
}
return names;
*/
return server.queryNames(name, query);
|
public javax.management.ObjectInstance | registerMBean(java.lang.Object object, javax.management.ObjectName 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
{@link javax.management.MBeanRegistration MBeanRegistration} interface.
The call returns an ObjectInstance object representing the registered MBean.
return server.registerMBean(object, name);
|
public void | removeNotificationListener(javax.management.ObjectName name, javax.management.NotificationListener listener)Enables to remove a listener from a registered MBean.
/*
Object svr = findServer(name);
if (svr instanceof MBeanServer) {
((MBeanServer)svr).removeNotificationListener(name, listener);
return;
}
//not yet supported, need to add to IIOPMBeanServer interface/impl
//((IIOPMBeanServer)svr).removeNotificationListener(name, listener);
//server.removeNotificationListener(name, listener);
*/
server.removeNotificationListener(name, listener);
|
public void | removeNotificationListener(javax.management.ObjectName name, javax.management.ObjectName listener)Enables to remove a listener from a registered MBean.
server.removeNotificationListener(name, listener);
|
public void | setAttribute(javax.management.ObjectName name, javax.management.Attribute attribute)Sets the value of a specific attribute of a named MBean. The MBean is identified by its object name.
server.setAttribute(name, attribute);
/*Object svr = findServer(name);
if (svr instanceof MBeanServer) {
((MBeanServer)svr).setAttribute(name, attribute);
}else {
((IIOPMBeanServer)svr).setAttribute(name, attribute);
}*/
|
public javax.management.AttributeList | setAttributes(javax.management.ObjectName name, javax.management.AttributeList attributes)Sets the values of several attributes of a named MBean. The MBean is identified by its object name.
return server.setAttributes(name, attributes);
/*Object svr = findServer(name);
if (svr instanceof MBeanServer) {
return ((MBeanServer)svr).setAttributes(name, attributes);
}
return ((IIOPMBeanServer)svr).setAttributes(name, attributes);
**/
|
public void | unregisterMBean(javax.management.ObjectName 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.
/*Object svr = findServer(name);
if (svr instanceof MBeanServer) {
((MBeanServer)svr).unregisterMBean(name);
return;
}
((IIOPMBeanServer)svr).unregisterMBean(name);*/
server.unregisterMBean(name);
|