|
Oracle Communications Services Gatekeeper Java API Reference 7.0.0.1 E96578-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.wlcp.wlng.api.management.MBeanManager
Proxy class for MBean registration.
This example shows how to register an MBean with the MBean manager:
mbean = new MyMBeanImpl();
MBeanManager.registerMBean(mbean, MyMBean.class.getName(), serviceContext.getName(), serviceContext.getName());
Note: The instanceName and the displayName in the example above are the same, but that doesn't have to be the case.
This example shows how to unregister an MBean from the MBean manager:
MBeanManager.unregisterMBean(MyMBean.class.getName(), serviceContext.getName());
Note: The service context is retrieved from the setServiceContext
in the
ServiceDeployable
implementation class. When using AbstractManagedPlugin
it is possible to retrieve the serviceContext through the protected variable
svcCtx
.
Constructor Summary | |
MBeanManager()
Public constructor. |
Method Summary | |
static javax.management.ObjectName |
constructObjectName(java.lang.String type)
Constructs an objectName. |
static javax.management.ObjectName |
constructObjectName(java.lang.String type,
java.lang.String instanceName)
Constructs an objectName. |
static javax.management.ObjectName |
constructObjectName(java.lang.String type,
java.lang.String instanceName,
boolean isApp)
|
static javax.management.ObjectName |
constructObjectName(java.lang.String type,
java.lang.String instanceName,
java.util.HashMap properties)
Construct an objectName. |
static java.lang.Object |
executeMBeanOperation(java.lang.String operationName,
java.lang.Object[] params,
java.lang.String[] signature,
java.lang.String type,
java.lang.String instanceName)
Execute an MBean operation using the supplied parameters. |
static java.lang.Object |
getMBeanAttribute(java.lang.String attribute,
java.lang.String type,
java.lang.String displayName)
Gets a specific attribute value from an MBean. |
static javax.management.MBeanServer |
getMBeanServer()
Returns the MBean server instance after lookup in the JNDI tree. |
static java.util.HashMap |
getObjectMap()
|
static void |
registerMBean(java.lang.Object mBeanImpl,
javax.management.ObjectName objectName)
Registers an MBean, passing a null display name. |
static void |
registerMBean(java.lang.Object mBeanImpl,
javax.management.ObjectName objectName,
java.lang.String displayName)
Registers an MBean with the MBean server. |
static void |
registerMBean(java.lang.Object mBeanImpl,
java.lang.String type,
java.lang.String displayName)
Registers the MBean with MBean server |
static void |
registerMBean(java.lang.Object mBeanImpl,
java.lang.String type,
java.lang.String instanceName,
java.lang.String displayName)
|
static void |
setMBeanAttribute(java.lang.String attribute,
java.lang.Object value,
java.lang.String type,
java.lang.String displayName)
Sets a specific attribute for the MBean. |
static void |
unregister(java.lang.String type,
java.lang.String displayName)
Unregisters the MBean from the MBeanServer. |
static void |
unregisterMBean(javax.management.ObjectName objectName)
Unregisters the MBean from the MBeanServer. |
static void |
unregisterMBean(java.lang.String type,
java.lang.String instanceName)
Unregisters the MBean from the MBeanServer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MBeanManager()
Method Detail |
public static javax.management.ObjectName constructObjectName(java.lang.String type) throws javax.management.MalformedObjectNameException
type
- type.
MalformedObjectNameException.
javax.management.MalformedObjectNameException
public static javax.management.ObjectName constructObjectName(java.lang.String type, java.lang.String instanceName) throws javax.management.MalformedObjectNameException
type
- The fully qualified name of the management bean
(use class.getName where the class is your MBean class).instanceName
- The unique name of the management bean.
For example, if this is a plug-in that will ever be used
on the same machine with multiple plug-ins this
should be unique per plug-in instance. In the case
of a plug-in or service you should use managedPlugin.getId().
MalformedObjectNameException.
javax.management.MalformedObjectNameException
public static javax.management.ObjectName constructObjectName(java.lang.String type, java.lang.String instanceName, boolean isApp) throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameException
public static javax.management.ObjectName constructObjectName(java.lang.String type, java.lang.String instanceName, java.util.HashMap properties) throws javax.management.MalformedObjectNameException
type
- The fully qualified name of the management bean
(use class.getName where the class is your MBean class).instanceName
- The unique name of the management bean.
For example, if this is a plug-in that will ever be used
on the same machine with multiple plug-ins this
should be unique per plug-in instance. In the case
of a plug-in or service you should use managedPlugin.getId().properties
- HashMap that contains objectNamekey and value pairs
ObjectNameConstants class has set of constants that
can be used as keys.
MalformedObjectNameException.
javax.management.MalformedObjectNameException
public static java.lang.Object executeMBeanOperation(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature, java.lang.String type, java.lang.String instanceName) throws javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.ReflectionException, javax.management.MalformedObjectNameException
operationName
- The operation to execute.params
- The operation input paramters.signature
- The operation signature.type
- MBean type.instanceName
- MBean instance name (ServiceContext.getName()).
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.ReflectionException
javax.management.MalformedObjectNameException
public static java.lang.Object getMBeanAttribute(java.lang.String attribute, java.lang.String type, java.lang.String displayName) throws javax.management.ReflectionException, javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.MalformedObjectNameException
attribute
- The attribute to retreive from the MBean.
javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.MalformedObjectNameException
public static javax.management.MBeanServer getMBeanServer()
public static java.util.HashMap getObjectMap()
public static void registerMBean(java.lang.Object mBeanImpl, javax.management.ObjectName objectName) throws javax.management.NotCompliantMBeanException, javax.management.MBeanRegistrationException, javax.management.InstanceAlreadyExistsException
mBeanImpl
- Management bean object that should be registered.objectName
- The objectName what will be used to register
the the MBean with the MBean server.
NotCompliantMBeanException.
MBeanRegistrationException.
InstanceAlreadyExistsException.
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
public static void registerMBean(java.lang.Object mBeanImpl, javax.management.ObjectName objectName, java.lang.String displayName) throws javax.management.NotCompliantMBeanException, javax.management.MBeanRegistrationException, javax.management.InstanceAlreadyExistsException
mBeanImpl
- Management bean object that should be registered.objectName
- The objectName that will be used to register
the the MBean with the mbean server.displayName
- The display name of the management bean that will
be shown in the console.
NotCompliantMBeanException.
MBeanRegistrationException.
InstanceAlreadyExistsException.
javax.management.NotCompliantMBeanException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
public static void registerMBean(java.lang.Object mBeanImpl, java.lang.String type, java.lang.String displayName) throws javax.management.NotCompliantMBeanException, javax.management.MalformedObjectNameException, javax.management.MBeanRegistrationException, javax.management.InstanceAlreadyExistsException
mBeanImpl
- Management bean object that should be registered.type
- The fully qualified name of the management bean
(use class.getName where the class is your MBean class).displayName
- The displayed name of the management bean.
If this is a plug-in that will ever be used on the
same machine with multiple plug-ins this should be unique
per plug-in instance. In the case of a plug-in or service
it is recommended that you use managedPlugin.getId().
NotCompliantMBeanException.
MalformedObjectNameException.
MBeanRegistrationException.
InstanceAlreadyExistsException.
javax.management.NotCompliantMBeanException
javax.management.MalformedObjectNameException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
public static void registerMBean(java.lang.Object mBeanImpl, java.lang.String type, java.lang.String instanceName, java.lang.String displayName) throws javax.management.NotCompliantMBeanException, javax.management.MalformedObjectNameException, javax.management.MBeanRegistrationException, javax.management.InstanceAlreadyExistsException
mBeanImpl
- Management bean object that should be registered.type
- The fully qualified name of the management bean
(use class.getName where class is your mbean class).instanceName
- The unique name of the management bean.
For example, if this is a plug-in that will ever be used
on the same machine with multiple plug-ins this
should be unique per plug-in instance. In the case
of a plug-in or service it is recommended
that you use managedPlugin.getId().displayName
- The display name of the management bean that will
be shown in the console. Should be a unique value
per plug-in instance. managedPlugin.getId() is
recommended here as well.
NotCompliantMBeanException.
MalformedObjectNameException.
MBeanRegistrationException.
InstanceAlreadyExistsException.
javax.management.NotCompliantMBeanException
javax.management.MalformedObjectNameException
javax.management.MBeanRegistrationException
javax.management.InstanceAlreadyExistsException
public static void setMBeanAttribute(java.lang.String attribute, java.lang.Object value, java.lang.String type, java.lang.String displayName) throws javax.management.ReflectionException, javax.management.InstanceNotFoundException, javax.management.MBeanException, javax.management.AttributeNotFoundException, javax.management.MalformedObjectNameException, javax.management.InvalidAttributeValueException, javax.naming.NamingException
attribute
- The attribute name to set.value
- The value to set.
javax.management.ReflectionException
javax.management.InstanceNotFoundException
javax.management.MBeanException
javax.management.AttributeNotFoundException
javax.management.MalformedObjectNameException
javax.management.InvalidAttributeValueException
javax.naming.NamingException
public static void unregister(java.lang.String type, java.lang.String displayName) throws javax.management.MalformedObjectNameException, javax.management.MBeanRegistrationException, javax.management.InstanceNotFoundException
javax.management.MalformedObjectNameException
javax.management.MBeanRegistrationException
javax.management.InstanceNotFoundException
public static void unregisterMBean(javax.management.ObjectName objectName) throws javax.management.MBeanRegistrationException, javax.management.InstanceNotFoundException
objectName
- The objectName that was used to register
the the MBean with the MBean server.
MBeanRegistrationException.
InstanceNotFoundException.
javax.management.MBeanRegistrationException
javax.management.InstanceNotFoundException
public static void unregisterMBean(java.lang.String type, java.lang.String instanceName) throws javax.management.MalformedObjectNameException, javax.management.MBeanRegistrationException, javax.management.InstanceNotFoundException
type
- The fully qualified name of the management bean
(use class.getName where the class is your MBean class).instanceName
- The unique name of the management bean.
For example, if this is a plug-in that will ever be used
on the same machine with multiple plug-ins this
should be unique per plug-in instance. In the case
of a plug-in or service you should use serviceContext.getName().
MBeanRegistrationException.
InstanceNotFoundException.
javax.management.MalformedObjectNameException
javax.management.MBeanRegistrationException
javax.management.InstanceNotFoundException
|
Oracle Communications Services Gatekeeper Java API Reference 7.0.0.1 E96578-01 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |