com.ibm.websphere.management
Interface AdminService
- public interface AdminService
In order to obtain a reference to the singleton AdminService instance, use the
static method getAdminService()
of the AdminServiceFactory class.
Many of the methods defined on the AdminService interface come from the JMX MBeanServer
interface. The WebSphere AdminService extends the standard JMX MBeanServer function
with distributed system support and enhanced security. The regular JMX MBeanServer
is accessible in WebSphere JVMs from the getMBeanServer()
method of the
MBeanFactory interface.
Code that runs in the same JVM as the AdminService must also have the required Java 2 Security permissions in order to successfully invoke any of the AdminService methods. In order to obtain a reference to the AdminService in the first place, code must have at least the following permission:
com.ibm.websphere.management.AdminPermission "getAdminService"
Other permissions that it may be necessary for code to be granted before it can call certain AdminService methods include:
com.ibm.websphere.management.AdminPermission "getMBeanFactory"
com.tivoli.jmx.MBeanServerPermission "MBeanServerFactory.*"
com.tivoli.jmx.MBeanServerPermission "MBeanServer.*"
MBeanServer.addNotificationListener MBeanServer.createMBean MBeanServer.deserialize MBeanServer.getAttribute MBeanServer.getDefaultDomain MBeanServer.getMBeanCount MBeanServer.getMBeanInfo MBeanServer.getObjectInstance MBeanServer.instantiate MBeanServer.invoke MBeanServer.isRegistered MBeanServer.queryMBeans MBeanServer.queryNames MBeanServer.registerMBean MBeanServer.removeNotificationListener MBeanServer.setAttribute MBeanServer.unregisterMBean MBeanServerFactory.createMBeanServer MBeanServerFactory.newMBeanServer MBeanServerFactory.findMBeanServer MBeanServerFactory.releaseMBeanServer
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addNotificationListener(javax.management.ObjectName name,javax.management.NotificationListener listener,javax.management.NotificationFilter filter,java.lang.Object handback)
Adds a listener to exactly one MBean.
|
|
addNotificationListener(javax.management.ObjectName name,javax.management.ObjectName listener,javax.management.NotificationFilter filter,java.lang.Object handback)
Adds a listener to a registered MBean.
|
|
addNotificationListenerExtended(javax.management.ObjectName name,javax.management.NotificationListener listener,javax.management.NotificationFilter filter,java.lang.Object handback)
Adds a listener to multiple MBeans.
|
|
getAttribute(javax.management.ObjectName name,java.lang.String attribute)
Gets the value of a specific attribute of a named MBean.
|
|
getAttributes(javax.management.ObjectName name,java.lang.String[] attributes)
Gets the values of several attributes of a named MBean.
|
|
getCellName()
Returns the name used to identify the current cell in which this process is configured.
|
|
getClassLoader(javax.management.ObjectName name)
|
|
getClassLoaderFor(javax.management.ObjectName name)
|
|
getDefaultDomain()
Returns the default domain used for naming the MBean.
|
getDeploymentManagerAdminClient()
Returns a reference to the AdminClient connection from this JVM to the Deployment Manager
in a Network Deployment environment.
|
|
|
getDomainName()
Returns the DomainName String for this AdminService.
|
|
getJvmType()
Returns the JVM Type attribute of the server.
|
|
getLocalServer()
Returns the ObjectName handle to the Server MBean for this server.
|
|
getMBeanCount()
Returns the number of MBeans registered in the MBeanServer.
|
getMBeanFactory()
Returns a reference to the singleton MBeanFactory instance for this JVM.
|
|
|
getMBeanInfo(javax.management.ObjectName name)
This method discovers the attributes and operations that an MBean exposes
for management.
|
|
getNodeName()
Returns the name used to identify the current node in which this process is configured.
|
|
getObjectInstance(javax.management.ObjectName name)
Gets the ObjectInstance for a given MBean registered with the MBean server.
|
|
getProcessName()
Returns the name used to identify the current process.
|
|
getProcessType()
Returns the ProcessType attribute of the server.
|
|
getServerType()
Returns the ServerType of the server.
|
|
invoke(javax.management.ObjectName name,java.lang.String operationName,java.lang.Object[] params,java.lang.String[] signature)
Invokes an operation on an MBean.
|
isAlive()
Get the Session associated with the current AdminService.
|
|
|
isInstanceOf(javax.management.ObjectName name,java.lang.String className)
Returns true if the MBean specified is an instance of the
specified class, false otherwise.
|
|
isLocalServer(java.lang.String cellname,java.lang.String nodename,java.lang.String servername)
Compares the cell, node, and server name parameters to those for the local server.
|
|
isRegistered(javax.management.ObjectName name)
Checks whether an MBean, identified by its object name,
is already registered with the MBean server.
|
|
queryMBeans(javax.management.ObjectName name,javax.management.QueryExp query)
Gets the names of MBeans controlled by the MBeanServer that match a supplied
pattern.
|
|
queryNames(javax.management.ObjectName name,javax.management.QueryExp query)
Gets the names of MBeans controlled by the MBeanServer that match a supplied
pattern.
|
|
registerMBean(java.lang.Object object,javax.management.ObjectName name)
Register the Object passed in as an MBean with the supplied JMX ObjectName.
|
|
removeNotificationListener(javax.management.ObjectName name,javax.management.NotificationListener listener)
Removes a listener from exactly one MBean.
|
|
removeNotificationListener(javax.management.ObjectName name,javax.management.NotificationListener listener,javax.management.NotificationFilter filter,java.lang.Object handback)
Removes a listener from a registered MBean.
|
|
removeNotificationListener(javax.management.ObjectName name,javax.management.ObjectName listener)
Removes a listener from a registered MBean.
|
|
removeNotificationListener(javax.management.ObjectName name,javax.management.ObjectName listener,javax.management.NotificationFilter filter,java.lang.Object handback)
Removes a listener from a registered MBean.
|
|
removeNotificationListenerExtended(javax.management.NotificationListener listener)
Deprecated. as of 5.0.1, you should use
removeNotificationListenerExtended(ObjectName,NotificationListener)
|
|
removeNotificationListenerExtended(javax.management.ObjectName name,javax.management.NotificationListener listener)
Removes a listener from multiple MBeans.
|
|
setAttribute(javax.management.ObjectName name,javax.management.Attribute attribute)
Sets the value of a specific attribute of a named MBean.
|
|
setAttributes(javax.management.ObjectName name,javax.management.AttributeList attributes)
Sets the values of several attributes of a named MBean.
|
Method Detail
getDeploymentManagerAdminClient
- AdminClient getDeploymentManagerAdminClient( )
- throws AdminException
getMBeanFactory
- MBeanFactory getMBeanFactory()
com.ibm.websphere.management.AdminPermission "getAdminService"
registerMBean
- javax.management.ObjectInstance registerMBean( java.lang.Object object,
- javax.management.ObjectName name)
- throws javax.management.InstanceAlreadyExistsException
- javax.management.MBeanRegistrationException
- javax.management.NotCompliantMBeanException
object
- the Object to be registered as an MBean. name
- the ObjectName to be associated with this MBean. javax.management.InstanceAlreadyExistsException
javax.management.MBeanRegistrationException
javax.management.NotCompliantMBeanException
javax.management.ObjectName
getProcessName
- java.lang.String getProcessName( )
process
key property in all ObjectNames
for WebSphere MBeans originating from this JVM.
This method is only accessible from code running local to the AdminService.
getNodeName
- java.lang.String getNodeName()
node
key property in all ObjectNames
for WebSphere MBeans originating from this JVM.
This method is only accessible from code running local to the AdminService.
getCellName
- java.lang.String getCellName()
cell
key property in all ObjectNames
for WebSphere MBeans originating from this JVM.
This method is only accessible from code running local to the AdminService.
getJvmType
- java.lang.String getJvmType()
getProcessType
- java.lang.String getProcessType( )
getServerType
- java.lang.String getServerType( )
isLocalServer
- boolean isLocalServer(java.lang.String cellname,
- java.lang.String nodename,
- java.lang.String servername)
true
. Otherwise this method returns false
.
This method is only accessible from code running local to the AdminService.
cellname
- a String value to compare against the name of the local cell. nodename
- a String value to compare against the name of the local node. servername
- a String value to compare against the name of the local server. getLocalServer
- javax.management.ObjectName getLocalServer( )
javax.management.ObjectName
isAlive
- Session isAlive()
queryMBeans
- java.util.Set queryMBeans(javax.management.ObjectName name,
- javax.management.QueryExp query)
It returns the set of ObjectInstance
objects (containing the
ObjectName
and the Java Class name) for the selected MBeans.
- the names of all MBeans accessible from the AdminService
- 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).
queryNames
- java.util.Set queryNames(javax.management.ObjectName name,
- javax.management.QueryExp query)
- the names of all MBeans accessible from the AdminService
- 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).
javax.management.ObjectName
,
javax.management.QueryExp
getAttribute
- java.lang.Object getAttribute(javax.management.ObjectName name,
- java.lang.String attribute)
- throws javax.management.MBeanException
- javax.management.AttributeNotFoundException
- javax.management.InstanceNotFoundException
- javax.management.ReflectionException
name
- attribute
- javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.InstanceNotFoundException
javax.management.ReflectionException
getAttributes
- javax.management.AttributeList getAttributes( javax.management.ObjectName name,
- java.lang.String[] attributes)
- throws javax.management.InstanceNotFoundException
- javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.ReflectionException
setAttribute
- void setAttribute(javax.management.ObjectName name,
- javax.management.Attribute attribute)
- throws javax.management.InstanceNotFoundException
- javax.management.AttributeNotFoundException
- javax.management.InvalidAttributeValueException
- javax.management.MBeanException
- javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException
javax.management.ObjectName
,
javax.management.Attribute
setAttributes
- javax.management.AttributeList setAttributes( javax.management.ObjectName name,
- javax.management.AttributeList attributes)
- throws javax.management.InstanceNotFoundException
- javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.ReflectionException
javax.management.ObjectName
,
javax.management.AttributeList
invoke
- java.lang.Object invoke(javax.management.ObjectName name,
- java.lang.String operationName,
- java.lang.Object[] params,
- java.lang.String[] signature)
- throws javax.management.InstanceNotFoundException
- javax.management.MBeanException
- javax.management.ReflectionException
name
- operationName
- params
- signature
- javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
getDefaultDomain
- java.lang.String getDefaultDomain( )
getDomainName
- java.lang.String getDomainName( )
getMBeanCount
- java.lang.Integer getMBeanCount( )
getMBeanInfo
- javax.management.MBeanInfo getMBeanInfo( javax.management.ObjectName name)
- throws javax.management.InstanceNotFoundException
- javax.management.IntrospectionException
- javax.management.ReflectionException
name
- the ObjectName for the MBean about which information is requested javax.management.InstanceNotFoundException
javax.management.IntrospectionException
javax.management.ReflectionException
isRegistered
- boolean isRegistered(javax.management.ObjectName name)
name
- isInstanceOf
- boolean isInstanceOf(javax.management.ObjectName name,
- java.lang.String className)
- throws javax.management.InstanceNotFoundException
name
- className
- javax.management.InstanceNotFoundException
addNotificationListener
- void addNotificationListener(javax.management.ObjectName name,
- javax.management.NotificationListener listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
- throws javax.management.InstanceNotFoundException
MBeanServer.addNotificationListener
, except that it works
in a distributed environment. This means that MBeans which are not located on
this specific process may have listeners added to it assuming routing
information is correct.
name
- the name of the MBean on which the listener should be added. listener
- the listener object which will handle the notifications emitted
by the registered MBean filter
- the filter object; if filter is null, no filtering will be
performed before handling notifications handback
- the context to be sent to the listener when a notification is
emitted javax.management.InstanceNotFoundException
- the MBean name provided does not match any
of the registered MBeans. ConnectorException
- a communication problem occured adding the
listener addNotificationListenerExtended
- void addNotificationListenerExtended( javax.management.ObjectName name,
- javax.management.NotificationListener listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
addNotificationListener(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
method, except for the following:
- The name parameter may include wildcards, and pattern matching
is performed as in the
queryMBeans
method; null is not allowed - Listeners added with this method will receive notifications by MBeans registered in the future; i.e. the MBean does not need to be active currently to listen to it.
- An InstanceNotFoundException is never thrown.
name
- a pattern matching zero or more MBeans; notifications from all these
MBeans will be routed to the listener listener
- the listener object which will handle the notifications emitted
by the registered MBean filter
- the filter object; if filter is null, no filtering will be
performed before handling notifications handback
- the context to be sent to the listener when a notification is
emitted ConnectorException
- a communication problem occured adding the
listener removeNotificationListener
- void removeNotificationListener( javax.management.ObjectName name,
- javax.management.NotificationListener listener)
- throws javax.management.InstanceNotFoundException
- javax.management.ListenerNotFoundException
MBeanServer.removeNotificationListener
, except that it works
in a distributed environment. This means that MBeans which are not located on
this specific process may have listeners added to it assuming routing
information is correct.
This method should not be used to remove listeners added with
addNotificationListenerExtended(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
; use
removeNotificationListenerExtended(ObjectName,NotificationListener)
instead.
name
- the name of the MBean on which the listener should be removed listener
- the listener object which will handle the notifications emitted
by the registered MBean javax.management.InstanceNotFoundException
- the MBean name provided does not match any
of the registered MBeans javax.management.ListenerNotFoundException
- the listener is not registered in the MBean ConnectorException
- a communication problem occured adding the
listener removeNotificationListenerExtended
- void removeNotificationListenerExtended( javax.management.NotificationListener listener)
- throws javax.management.ListenerNotFoundException
removeNotificationListenerExtended(ObjectName,NotificationListener)
addNotificationListenerExtended(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
.
Behaves similarly to the removeNotificationListener(javax.management.ObjectName, javax.management.NotificationListener)
method, except
for the following:
- All instances of the given listener are removed, even if it is added to multiple MBeans.
- An InstanceNotFoundException is never thrown.
listener
- the listener object which will handle the notifications emitted
by the registered MBean javax.management.ListenerNotFoundException
- the listener is not registered in the MBean ConnectorException
- a communication problem occured adding the
listener removeNotificationListenerExtended
- void removeNotificationListenerExtended( javax.management.ObjectName name,
- javax.management.NotificationListener listener)
- throws javax.management.ListenerNotFoundException
addNotificationListenerExtended(javax.management.ObjectName, javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
.
Behaves similarly to the removeNotificationListener(javax.management.ObjectName, javax.management.NotificationListener)
method, except
for the following:
- An InstanceNotFoundException is never thrown.
name
- the name of the MBean on which the listener should be removed; this
must be the same name as that given during
addNotificationListenerExtended (cannot remove listener from subset
of MBeans) listener
- the listener object which will handle the notifications emitted
by the registered MBean javax.management.ListenerNotFoundException
- the listener is not registered in the MBean ConnectorException
- a communication problem occured adding the
listener getObjectInstance
- javax.management.ObjectInstance getObjectInstance( javax.management.ObjectName name)
- throws javax.management.InstanceNotFoundException
name
- the object name of the MBean. javax.management.InstanceNotFoundException
addNotificationListener
- void addNotificationListener(javax.management.ObjectName name,
- javax.management.ObjectName listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
- throws javax.management.InstanceNotFoundException
The listener object that receives notifications is the one that is registered with the given name at the time this method is called. Even if it is subsequently unregistered, it will continue to receive notifications.
name
- the name of the MBean on which the listener should be added. listener
- the listener object which will handle the notifications emitted by the registered MBean. filter
- the filter object; if filter is null, no filtering will be
performed before handling notifications. handback
- the context to be sent to the listener when a notification is emitted. javax.management.InstanceNotFoundException
- the MBean name provided does not match any of the registered MBeans. removeNotificationListener
- void removeNotificationListener( javax.management.ObjectName name,
- javax.management.NotificationListener listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
- throws javax.management.InstanceNotFoundException
- javax.management.ListenerNotFoundException
The filter and handback parameters may be null if and only if they are null in a listener to be removed.
name
- the name of the MBean on which the listener should be removed. listener
- the listener that was previously added to this MBean. filter
- the filter that was specified when the listener was added. handback
- the handback that was specified when the listener was added. javax.management.InstanceNotFoundException
- the MBean name provided does not match any of the registered MBeans. javax.management.ListenerNotFoundException
- the listener is not registered in the MBean,
or it is not registered with the given filter and handback. removeNotificationListener
- void removeNotificationListener( javax.management.ObjectName name,
- javax.management.ObjectName listener)
- throws javax.management.InstanceNotFoundException
- javax.management.ListenerNotFoundException
name
- the name of the MBean on which the listener should be removed. listener
- the object name of the listener to be removed. javax.management.InstanceNotFoundException
- the MBean name provided does not match any of the registered MBeans. javax.management.ListenerNotFoundException
- the listener is not registered in the MBean. removeNotificationListener
- void removeNotificationListener( javax.management.ObjectName name,
- javax.management.ObjectName listener,
- javax.management.NotificationFilter filter,
- java.lang.Object handback)
- throws javax.management.InstanceNotFoundException
- javax.management.ListenerNotFoundException
If there is more than one such listener, only one is removed. The filter and handback parameters may be null if and only if they are null in a listener to be removed.
name
- the name of the MBean on which the listener should be removed. listener
- the listener that was previously added to this MBean filter
- the filter that was specified when the listener was added. handback
- the handback that was specified when the listener was added. javax.management.InstanceNotFoundException
- the MBean name provided does not match any of the registered MBeans. javax.management.ListenerNotFoundException
- - The listener is not registered in the MBean,
or it is not registered with the given filter and handback. getClassLoaderFor
- java.lang.ClassLoader getClassLoaderFor( javax.management.ObjectName name)
- throws javax.management.InstanceNotFoundException
javax.management.InstanceNotFoundException
getClassLoader
- java.lang.ClassLoader getClassLoader( javax.management.ObjectName name)
- throws javax.management.InstanceNotFoundException
javax.management.InstanceNotFoundException