org.jmonit.support.jaxrpc
Class JaxRpcMonitoringHandler

java.lang.Object
  extended by javax.xml.rpc.handler.GenericHandler
      extended by org.jmonit.support.jaxrpc.JaxRpcMonitoringHandler
All Implemented Interfaces:
javax.xml.rpc.handler.Handler

public class JaxRpcMonitoringHandler
extends javax.xml.rpc.handler.GenericHandler

Axis handler to monitor Time for SAOP invocation. Three jMonit domains are used for Axis SOAP monitoring :

You have to configure your Axis client by including in the client-config.wsdd file (Axis client configuration file):

      <?xml version="1.0" encoding="UTF-8"?>
      <deployment xmlns="http://xml.apache.org/axis/wsdd/"
      xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
 
        <handler name="jmonit" type="java:info.jmonit.support.soap.AxisMonitoringHandler">
          <parameter name="domain" value="soap.axis"/>
          <parameter name="requestDomain" value="soap.axis.request"/>
          <parameter name="responseDomain" value="soap.axis.response"/>
        </handler>
 
        <transport name="http"
        pivot="java:org.apache.axis.transport.http.HTTPSender">
          <requestFlow>
            <handler type="jmonit"/>
          </requestFlow>
          <responseFlow>
            <handler type="jmonit"/>
          </responseFlow>
        </transport>
 
      </deployment>
 
Handler parameter can be used to override default domains. This can be usefull if you are both using Axis as Web service client and as server-side SOAP stack, where request/response have inverted roles.

Author:
Nicolas De Loof

Constructor Summary
JaxRpcMonitoringHandler()
           
 
Method Summary
protected  java.lang.String getAction(javax.xml.rpc.handler.MessageContext context)
          Extract the Action from the message, either by getting the Jax-rpc header, or by getting the SOAP message first element.
 javax.xml.namespace.QName[] getHeaders()
          
 boolean handleFault(javax.xml.rpc.handler.MessageContext context)
           
 boolean handleRequest(javax.xml.rpc.handler.MessageContext context)
           
 boolean handleResponse(javax.xml.rpc.handler.MessageContext context)
           
protected  void stopMonitoring(javax.xml.rpc.handler.MessageContext context, boolean success)
          End monitoring for a SOAP invocation.
 
Methods inherited from class javax.xml.rpc.handler.GenericHandler
destroy, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxRpcMonitoringHandler

public JaxRpcMonitoringHandler()
Method Detail

handleRequest

public boolean handleRequest(javax.xml.rpc.handler.MessageContext context)
Specified by:
handleRequest in interface javax.xml.rpc.handler.Handler
Overrides:
handleRequest in class javax.xml.rpc.handler.GenericHandler

handleResponse

public boolean handleResponse(javax.xml.rpc.handler.MessageContext context)
Specified by:
handleResponse in interface javax.xml.rpc.handler.Handler
Overrides:
handleResponse in class javax.xml.rpc.handler.GenericHandler

handleFault

public boolean handleFault(javax.xml.rpc.handler.MessageContext context)
Specified by:
handleFault in interface javax.xml.rpc.handler.Handler
Overrides:
handleFault in class javax.xml.rpc.handler.GenericHandler

getAction

protected java.lang.String getAction(javax.xml.rpc.handler.MessageContext context)
Extract the Action from the message, either by getting the Jax-rpc header, or by getting the SOAP message first element.

TODO : Does this work for any SOAP message ?

Parameters:
context - Jax-rpc context
Returns:
soapAction of the SOAP message

stopMonitoring

protected void stopMonitoring(javax.xml.rpc.handler.MessageContext context,
                              boolean success)
End monitoring for a SOAP invocation.

Stops the running probe and add messages weight to request/response bytes monitors.

Parameters:
msgContext - Axis message context

getHeaders

public javax.xml.namespace.QName[] getHeaders()

Specified by:
getHeaders in interface javax.xml.rpc.handler.Handler
Specified by:
getHeaders in class javax.xml.rpc.handler.GenericHandler
See Also:
GenericHandler.getHeaders()


Copyright © 2007 Nicolas De Loof. All Rights Reserved.