pp108 : Operations

Operations

This topic describes the operations for the managed components.


The operations defined on a managed component are exposed as JMX operations in the managed bean. For example, the operations for the managed component of the monitor application connector include start, stop and reset. The input of the operation accepts the DN of the Service Container as parameter and performs the respective operations on the Service Containers.
Based upon the impact, operations are classified into three types:

  • ACTION - Indicates that the operation performs the write function and modifies the MBean by writing a value or changing a configuration.
  • ACTION_INFO - Indicates that the operation can perform both read and write functions.
  • INFO - Indicates that the operation can perform read function and returns information.
  • UNKNOWN - Indicates that the nature of the operation is unknown.

    Defining an Operation


An operation is defined by invoking defineOperation on a managed component. The operation is implemented through a Java Web service operation where static and the non-static methods can be used.
The following is an example of a static Web service operation in which Cache.class is passed as an argument.

m_managedComponent.defineOperation ("clearCache",Messages.CACHE_CLEAR_DESC,"clearCache",
Cache.class,null,OperationImpact.ACTION);

The following is an example of a non-static Web service operation. The this object in it is passed as an argument as the Web service operation is non-static.

m_managedComponent.defineOperation 
("getSize",Messages.CACHE_READ_DESC,"getSize",this,null,OperationImpact.INFO);