FileDocCategorySizeDatePackage
ServletPreHandler.javaAPI DocGlassfish v2 API3963Fri May 04 22:36:12 BST 2007com.sun.enterprise.webservice

ServletPreHandler

public class ServletPreHandler extends javax.xml.rpc.handler.GenericHandler
This handler is inserted first in the handler chain for an servlet web service endpoint.
author
Kenneth Saks

Fields Summary
private static Logger
logger
private WsUtil
wsUtil
Constructors Summary
public ServletPreHandler()


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

        return new QName[0];
    
public booleanhandleRequest(javax.xml.rpc.handler.MessageContext context)

        ComponentInvocation inv = null;

        try {
            Switch theSwitch = Switch.getSwitch();
            InvocationManager invManager = theSwitch.getInvocationManager();
            inv = invManager.getCurrentInvocation();

            Method method = wsUtil.getInvMethod(inv.getWebServiceTie(), 
                                                context);

            // Result can be null for some error cases.  This will be
            // handled by jaxrpc runtime so we don't treat it as an exception.
            if( method != null ) {
                inv.setWebServiceMethod(method);
            } else {
                inv.setWebServiceMethod(null);
            }

        } catch(Exception e) {
            logger.log(Level.WARNING, "preWebHandlerError", e);
            wsUtil.throwSOAPFaultException(e.getMessage(), context);
        }

        return true;