|
Oracle Communications Services Gatekeeper Java API Reference 5.0 E21717-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
This is a proxy class for mbean registration
This is example code how to register into 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 does not necessarily have to be so.
This is example code how to unregister 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 object name |
static ObjectName |
constructObjectName(String type, String instanceName) Construct objectName |
static ObjectName |
constructObjectName(String type, String instanceName, boolean isApp) |
static ObjectName |
constructObjectName(String type, String instanceName, HashMap properties) Construct 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 the 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 mbean passes null display name |
static void |
registerMBean(Object mBeanImpl, ObjectName objectName, String displayName) Registers mBean with mbean server |
static void |
registerMBean(Object mBeanImpl, String type, String displayName) Registers 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 to 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
type
-MalformedObjectNameException
public static ObjectName constructObjectName(String type, String instanceName) throws MalformedObjectNameException
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. I.e. 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 to use managedPlugin.getId().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 class is your mbean class)instanceName
- The unique name of the management bean. I.e. 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 to use managedPlugin.getId().properties
- HashMap that contains objectNamekey and value pairs ObjectNameConstants class has set of constants that can be used as keys.MalformedObjectNameException
public static Object executeMBeanOperation(String operationName, Object[] params, String[] signature, String type, String instanceName) throws InstanceNotFoundException, MBeanException, ReflectionException, MalformedObjectNameException
operationName
- The operation to executeparams
- The operation input paramterssignature
- The operation signaturetype
- MBean typeinstanceName
- 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 MBeanReflectionException
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 registeredobjectName
- The objectName what will be used to register the the mbean with the mbean serverNotCompliantMBeanException
MBeanRegistrationException
InstanceAlreadyExistsException
public static void registerMBean(Object mBeanImpl, ObjectName objectName, String displayName) throws NotCompliantMBeanException, MBeanRegistrationException, InstanceAlreadyExistsException
mBeanImpl
- Management bean object that should be registeredobjectName
- The objectName what will be used to register the the mbean with the mbean serverdisplayName
- The display name of the management bean that will be shown in the consoleNotCompliantMBeanException
MBeanRegistrationException
InstanceAlreadyExistsException
public static void registerMBean(Object mBeanImpl, String type, String displayName) throws NotCompliantMBeanException, MalformedObjectNameException, MBeanRegistrationException, InstanceAlreadyExistsException
mBeanImpl
- Management bean object that should be registeredtype
- The fully qualified name of the management bean (use class.getName where 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 to use managedPlugin.getId().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 registeredtype
- 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. I.e. 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 to 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
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 setvalue
- The value to setReflectionException
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 serverMBeanRegistrationException
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 class is your mbean class)instanceName
- The unique name of the management bean. I.e. 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 to use serviceContext.getName().MBeanRegistrationException
InstanceNotFoundException
MalformedObjectNameException
|
Oracle Communications Services Gatekeeper Java API Reference 5.0 E21717-02 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |