Execute MBean Operation

Actions of type Execute MBean Operation can be created to invoke operations
on MBeans of JMX Compliant Resources. The JMX compliant resources that are supported
by Applications Manager are : WebLogic, WebSphere, JBoss, AdventNet RMI Adapter
and JMX agents (JDK1.5 / MX4J). Creating a MBean Operation would be helpful
if you want to monitor the value of any custom attribute and do any action based
on its value.

For Eg, When you want to shut down your JBoss server when the number of threads
running in it goes above a specified value, you can add the necessary code to
shutdown the server on the JBoss Montor side as a MBean operation and invoke
this as a MBean Operation action from the Applications Manager.

To configure an Execute MBean , follow these steps:

Select the New Action
link from the top menu.

Click Execute MBean under the Actions
menu in the left frame. This opens the Create
New MBean Operation Action screen.

By following a simple set of 4 steps you can create
a MBean Operation. First Step : If you have a JMX compliant monitor already
configured, it will be listed in the Combo box. Provide a name for the action
and select any one of the resources for which you create a MBean Operation.
If you donot have any monitor configured, use the link given the page to discover
a new monitor. Click on the Show Domains
Button to go to the next step.

Secondly, The list of domains present in the agent you have selected are
displayed. Select any of the Domains and click on the button Show
MBeans.

In the third Step, Select
any one of the MBeans for which you want to create the action and click
Show Operations.

All the MBean Operations are listed in this screen with
varying return types and arguments. Click Create
Action button for the operation for which you want to create this
action. A success message that you have created this action would be displayed
and the newly created action will be listed under the head Execute
MBean Operations Action(s)

Note: You can give multiple values
to the operation arguments as comma separated values. For an operation
with multiple arguments, the combinations of the values supplied, can
also be executed. This is done in order to ensure that we need not create
separate actions to represent different combinations of argument values.

For Example, if you want to create actions for the logging level of a
product, the operation change logginLevel may take two arguments as, "User"
and "Level". You can supply, admin and operator as values for
User and debug and info for Level respectively. You can execute the operation
manually by choosing any of the combinations using the "Manual Execution"
option. By default the first values given will be taken to execute the
action, as Admin and debug in the above example.

After creating an MBean Operation action, you can test the execution of that
action in two ways:

You can have a trial execution of the action. To do so,
click the Execute icon of that action.

You can also manually execute the action, click on . This opens a popup with the operation details.
Select the options from the list
and click Execute Action button. The
action would be called with the given values and return value will be given
in the UI.

Note: There is a link Fetch
data now in the corresponding monitor details page, which will
fetch the data from the server, after you have executed the action. This
will help you to see the value of the custom attribute without waiting
for the next polling interval.