|
Oracle Communications Services Gatekeeper Java API Reference 6.0 E55513-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.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 ObjectName |
constructObjectName(String type) Constructs an objectName. |
static ObjectName |
constructObjectName(String type, String instanceName) Constructs an objectName. |
static ObjectName |
constructObjectName(String type, String instanceName, boolean isApp) |
static ObjectName |
constructObjectName(String type, String instanceName, HashMap properties) Construct an objectName. |
static Object |
executeMBeanOperation(String operationName, Object[] params, String[] signature, String type, String instanceName) Execute an MBean operation using the supplied parameters. |
static Object |
getMBeanAttribute(String attribute, String type, String displayName) Gets a specific attribute value from an MBean. |
static MBeanServer |
getMBeanServer() Returns the MBean server instance after lookup in the JNDI tree. |
static HashMap |
getObjectMap() |
static void |
registerMBean(Object mBeanImpl, ObjectName objectName) Registers an MBean, passing a null display name. |
static void |
registerMBean(Object mBeanImpl, ObjectName objectName, String displayName) Registers an MBean with the MBean server. |
static void |
registerMBean(Object mBeanImpl, String type, String displayName) Registers the MBean with MBean server |
static void |
registerMBean(Object mBeanImpl, String type, String instanceName, String displayName) |
static void |
setMBeanAttribute(String attribute, Object value, String type, String displayName) Sets a specific attribute for the MBean. |
static void |
unregister(String type, String displayName) Unregisters the MBean from the MBeanServer. |
static void |
unregisterMBean(ObjectName objectName) Unregisters the MBean from the MBeanServer. |
static void |
unregisterMBean(String type, 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 ObjectName constructObjectName(String type) throws MalformedObjectNameException
MalformedObjectNameException.
MalformedObjectNameException
public static ObjectName constructObjectName(String type, String instanceName) throws 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.
MalformedObjectNameException
public static ObjectName constructObjectName(String type, String instanceName, boolean isApp) throws MalformedObjectNameException
MalformedObjectNameException
public static ObjectName constructObjectName(String type, String instanceName, HashMap properties) throws 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.
MalformedObjectNameException
public static Object executeMBeanOperation(String operationName, Object[] params, String[] signature, String type, String instanceName) throws InstanceNotFoundException, MBeanException, ReflectionException, MalformedObjectNameException
operationName
- The operation to execute.params
- The operation input paramters.signature
- The operation signature.type
- MBean type.instanceName
- MBean instance name (ServiceContext.getName()).InstanceNotFoundException
MBeanException
ReflectionException
MalformedObjectNameException
public static Object getMBeanAttribute(String attribute, String type, String displayName) throws ReflectionException, InstanceNotFoundException, MBeanException, AttributeNotFoundException, MalformedObjectNameException
attribute
- The attribute to retreive from the MBean.ReflectionException
InstanceNotFoundException
MBeanException
AttributeNotFoundException
MalformedObjectNameException
public static MBeanServer getMBeanServer()
public static HashMap getObjectMap()
public static void registerMBean(Object mBeanImpl, ObjectName objectName) throws NotCompliantMBeanException, MBeanRegistrationException, 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.
NotCompliantMBeanException
MBeanRegistrationException
InstanceAlreadyExistsException
public static void registerMBean(Object mBeanImpl, ObjectName objectName, String displayName) throws NotCompliantMBeanException, MBeanRegistrationException, 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.
NotCompliantMBeanException
MBeanRegistrationException
InstanceAlreadyExistsException
public static void registerMBean(Object mBeanImpl, String type, String displayName) throws NotCompliantMBeanException, MalformedObjectNameException, MBeanRegistrationException, 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.
NotCompliantMBeanException
MalformedObjectNameException
MBeanRegistrationException
InstanceAlreadyExistsException
public static void registerMBean(Object mBeanImpl, String type, String instanceName, String displayName) throws NotCompliantMBeanException, MalformedObjectNameException, MBeanRegistrationException, 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.
NotCompliantMBeanException
MalformedObjectNameException
MBeanRegistrationException
InstanceAlreadyExistsException
public static void setMBeanAttribute(String attribute, Object value, String type, String displayName) throws ReflectionException, InstanceNotFoundException, MBeanException, AttributeNotFoundException, MalformedObjectNameException, InvalidAttributeValueException, NamingException
attribute
- The attribute name to set.value
- The value to set.ReflectionException
InstanceNotFoundException
MBeanException
AttributeNotFoundException
MalformedObjectNameException
InvalidAttributeValueException
NamingException
public static void unregister(String type, String displayName) throws MalformedObjectNameException, MBeanRegistrationException, InstanceNotFoundException
MalformedObjectNameException
MBeanRegistrationException
InstanceNotFoundException
public static void unregisterMBean(ObjectName objectName) throws MBeanRegistrationException, InstanceNotFoundException
objectName
- The objectName that was used to register the the MBean with the MBean server.MBeanRegistrationException.
InstanceNotFoundException.
MBeanRegistrationException
InstanceNotFoundException
public static void unregisterMBean(String type, String instanceName) throws MalformedObjectNameException, MBeanRegistrationException, 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.
MalformedObjectNameException
MBeanRegistrationException
InstanceNotFoundException
|
Oracle Communications Services Gatekeeper Java API Reference 6.0 E55513-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |