com.ibm.websphere.management.dynamicproxy
Interface InvocationHandler


public interface InvocationHandler

State Management handler interface for dynamicproxy MBean which requires more rich & customized state management before and after invoking a method which will change its state. Implementation of this interface can be specified in MBeanDescriptor's MBean xml tag's attribute as "invocationHandlerClass."

example MBeanDescriptor header & initial MBean tag:

 <?xml version="1.0" encoding="UTF-8"?> 
 <!DOCTYPE MBean SYSTEM "MbeanDescriptor.dtd"> 
 < MBean type="SampleStateMBean" 
  collaboratorClass="com.ibm.ws390.scaffold.SampleStateMBeanProxy" 
  aggregationHandlerClass="com.ibm.ws390.scaffold.SampleStateAggregationHandler" 
  eventHandlerClass="com.ibm.ws390.scaffold.SampleStateEventHandler" 
  invocationHandlerClass="com.ibm.ws390.scaffold.SampleStateInvocationHandler" 
  stateObjectClass="com.ibm.ws390.scaffold.SampleState" 
  version="5.0" 
  platform="dynamicproxy" 
  description="Sample state MBean."> 
 : 
 : 
 

This interface defines the preInvoke and postInvoke methods that can be implemented by WebSphere for z/OS dynamicproxy MBeans that require state management information in order to properly coordinate with its associated servant MBeans in cases where "multicall" proxyInvokeType is required.


Method Summary
 void postInvoke(java.lang.String methodName, java.lang.Object[] params, java.lang.String[] signatures, StateObject stateObject, int correlationValue, java.lang.Throwable thrownException, boolean invokeException)
           
 void preInvoke(java.lang.String methodName, java.lang.Object[] params, java.lang.String[] signatures, StateObject stateObject, int correlationValue)
          Called by JMX runtime prior to executing a method on an MBean.
 

Method Detail

preInvoke

public void preInvoke(java.lang.String methodName,
                      java.lang.Object[] params,
                      java.lang.String[] signatures,
                      StateObject stateObject,
                      int correlationValue)
               throws java.lang.Exception
Called by JMX runtime prior to executing a method on an MBean. Used to handle any special functions before the method on an MBean is invoked.

Parameters:
methodName - MBean method name
params - MBean method parameters
signatures - MBean method signatures
stateObject - MBean provider provided StateObject used by dynamicproxy MBean in CR to manage its state. Note: this object MAY BE null if "stateObjectClass" was not specified OR internal error occurred during initialization of this dynamicproxy MBean. Implmentation MUST properly handle "null" input.
correlationValue - a correlation value for synchronizing with the preInvoke call.
java.lang.Exception

postInvoke

public void postInvoke(java.lang.String methodName,
                       java.lang.Object[] params,
                       java.lang.String[] signatures,
                       StateObject stateObject,
                       int correlationValue,
                       java.lang.Throwable thrownException,
                       boolean invokeException)
                throws java.lang.Exception
Parameters:
methodName - MBean method name
params - MBean method parameters
signatures - MBean method signatures
stateObject - MBean provider provided StateObject used by dynamicproxy MBean in CR to manage its state. Note: this object MAY BE null if "stateObjectClass" was not specified OR internal error occurred during initialization of this dynamicproxy MBean. Implmentation MUST properly handle "null" input.
correlationValue - a correlation value for synchronizing with the preInvoke call.
thrownException - exception or error thrown from either a preInvoke method or MBean method invoke. it will be null for normal execution
invokeException - boolean value indicating that exception was thrown during MBean method invoke execution and that postInvoke should handle the exception accordingly. if the value is false, the exception was thrown from preInvoke if thrownException is not null OR if it is null then ignore this boolean value (this is normal path)
java.lang.Exception