FileDocCategorySizeDatePackage
MessageFilter.javaAPI DocGlassfish v2 API4217Fri May 04 22:24:42 BST 2007com.sun.enterprise.admin.wsmgmt.msg

MessageFilter

public class MessageFilter extends Object implements com.sun.enterprise.admin.wsmgmt.filter.spi.Filter
Filter that can implement or collect web services management information

Fields Summary
private String
_applicationId
private String
_endpointId
public EndpointHandler
_handler
private static final String
DELIM
private static final String
NAME_PREFIX
Constructors Summary
public MessageFilter(String appId, String endpoint, EndpointHandler h)
Public Constructor.

param
appId name of the application
param
endpoint end point name for which stats are collected
param
h endpoint handler

        _applicationId = appId;
        _endpointId    = endpoint;
        _handler       = h;
    
Methods Summary
public java.lang.StringgetName()
Returns the unique name for this filter

        return (NAME_PREFIX + _applicationId + DELIM + _endpointId);
    
public voidprocess(java.lang.String stage, java.lang.String endpoint, com.sun.enterprise.admin.wsmgmt.filter.spi.FilterContext context)
Invoke the filter.

param
stage stage of the execution
param
endpoint name of the endpoint
param
context filter context


        MessageTraceFactory mtf = MessageTraceFactory.getInstance();

        // SOAP request
        if ( stage.equals(Filter.PROCESS_REQUEST) ) {

            // delegates to message trace factory for holding 
            mtf.processRequest(context, _applicationId);

        // SOAP response
        } else if ( stage.equals(Filter.PROCESS_RESPONSE) ) {
            mtf.processResponse(context);

        } else if (stage.equals(Filter.POST_PROCESS_RESPONSE) ) {
            MessageTrace mt = mtf.postProcessResponse(context);

            // adds the newly created message trace to the pool
            _handler.addMessage(mt);
        }