Package org.apache.axis

Examples of org.apache.axis.Handler


                                Messages.getMessage("serverDisabled00"),
                                null, null);
        }

        String  hName = null ;
        Handler h     = null ;

        // save previous context
        MessageContext previousContext = getCurrentMessageContext();

        try {
            // set active context
            setCurrentMessageContext(msgContext);

            hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER );
            if ( hName != null ) {
                if ( (h = getHandler(hName)) == null ) {
                    ClassLoader cl = msgContext.getClassLoader();
                    try {
                        log.debug( Messages.getMessage("tryingLoad00", hName) );
                        Class cls = ClassUtils.forName(hName, true, cl);
                        h = (Handler) cls.newInstance();
                    }
                    catch( Exception e ) {
                        h = null ;
                    }
                }
                if( tlog.isDebugEnabled() ) {
                    t1=System.currentTimeMillis();
                }
                if ( h != null )
                    h.invoke(msgContext);
                else
                    throw new AxisFault( "Server.error",
                                         Messages.getMessage("noHandler00", hName),
                                         null, null );
                if( tlog.isDebugEnabled() ) {
                    t2=System.currentTimeMillis();
                    tlog.debug( "AxisServer.invoke " + hName + " invoke=" +
                                ( t2-t1 ) + " pre=" + (t1-t0 ));
                }
               
            }
            else {
                // This really should be in a handler - but we need to discuss it
                // first - to make sure that's what we want.
                /* Now we do the 'real' work.  The flow is basically:         */
                /*   Transport Specific Request Handler/Chain                   */
                /*   Global Request Handler/Chain                               */
                /*   Protocol Specific-Handler(ie. SOAP, XP)                  */
                /*     ie. For SOAP Handler:                                  */
                /*           - Service Specific Request Handler/Chain           */
                /*           - SOAP Semantic Checks                           */
                /*           - Service Specific Response Handler/Chain          */
                /*   Global Response Handler/Chain                              */
                /*   Transport Specific Response Handler/Chain                  */
                /**************************************************************/

                // When do we call init/cleanup??
                if (log.isDebugEnabled()) {
                    log.debug(Messages.getMessage("defaultLogic00") );
                }

                /*  This is what the entirety of this logic might evolve to:

                hName = msgContext.getStrProp(MessageContext.TRANSPORT);
                if ( hName != null ) {
                if ((h = hr.find( hName )) != null ) {
                h.invoke(msgContext);
                } else {
                log.error(Messages.getMessage("noTransport02", hName));
                }
                } else {
                // No transport set, so use the default (probably just
                // calls the global->service handlers)
                defaultTransport.invoke(msgContext);
                }

                */

                /* Process the Transport Specific Request Chain */
                /**********************************************/
                hName = msgContext.getTransportName();
                SimpleTargetedChain transportChain = null;

                if (log.isDebugEnabled())
                    log.debug(Messages.getMessage("transport01", "AxisServer.invoke", hName));

                if( tlog.isDebugEnabled() ) {
                    t1=System.currentTimeMillis();
                }
                if ( hName != null && (h = getTransport( hName )) != null ) {
                    if (h instanceof SimpleTargetedChain) {
                        transportChain = (SimpleTargetedChain)h;
                        h = transportChain.getRequestHandler();
                        if (h != null)
                            h.invoke(msgContext);
                    }
                }

                if( tlog.isDebugEnabled() ) {
                    t2=System.currentTimeMillis();
                }
                /* Process the Global Request Chain */
                /**********************************/
                if ((h = getGlobalRequest()) != null )
                    h.invoke(msgContext);

                /**
                 * At this point, the service should have been set by someone
                 * (either the originator of the MessageContext, or one of the
                 * transport or global Handlers).  If it hasn't been set, we
                 * fault.
                 */
                h = msgContext.getService();
                if (h == null) {
                    // It's possible that we haven't yet parsed the
                    // message at this point.  This is a kludge to
                    // make sure we have.  There probably wants to be
                    // some kind of declarative "parse point" on the handler
                    // chain instead....
                    Message rm = msgContext.getRequestMessage();
                    rm.getSOAPEnvelope().getFirstBody();
                    h = msgContext.getService();
                    if (h == null)
                        throw new AxisFault("Server.NoService",
                                            Messages.getMessage("noService05",
                                                                 "" + msgContext.getTargetService()),
                                            null, null );
                }
                if( tlog.isDebugEnabled() ) {
                    t3=System.currentTimeMillis();
                }

                h.invoke(msgContext);

                if( tlog.isDebugEnabled() ) {
                    t4=System.currentTimeMillis();
                }

                /* Process the Global Response Chain */
                /***********************************/
                if ((h = getGlobalResponse()) != null)
                    h.invoke(msgContext);

                /* Process the Transport Specific Response Chain */
                /***********************************************/
                if (transportChain != null) {
                    h = transportChain.getResponseHandler();
                    if (h != null)
                        h.invoke(msgContext);
                }
               
                if( tlog.isDebugEnabled() ) {
                    t5=System.currentTimeMillis();
                    tlog.debug( "AxisServer.invoke2 " +
View Full Code Here


                                Messages.getMessage("serverDisabled00"),
                                null, null);
        }

        String  hName = null ;
        Handler h     = null ;

        // save previous context
        MessageContext previousContext = getCurrentMessageContext();

        try {
            // set active context
            setCurrentMessageContext(msgContext);

            hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER );
            if ( hName != null ) {
                if ( (h = getHandler(hName)) == null ) {
                    ClassLoader cl = msgContext.getClassLoader();
                    try {
                        log.debug( Messages.getMessage("tryingLoad00", hName) );
                        Class cls = ClassUtils.forName(hName, true, cl);
                        h = (Handler) cls.newInstance();
                    }
                    catch( Exception e ) {
                        throw new AxisFault(
                                "Server.error",
                                Messages.getMessage("noHandler00", hName),
                                null, null );
                    }
                }
                h.generateWSDL(msgContext);
            }
            else {
                // This really should be in a handler - but we need to discuss it
                // first - to make sure that's what we want.
                /* Now we do the 'real' work.  The flow is basically:         */
                /*   Transport Specific Request Handler/Chain                   */
                /*   Global Request Handler/Chain                               */
                /*   Protocol Specific-Handler(ie. SOAP, XP)                  */
                /*     ie. For SOAP Handler:                                  */
                /*           - Service Specific Request Handler/Chain           */
                /*           - SOAP Semantic Checks                           */
                /*           - Service Specific Response Handler/Chain          */
                /*   Global Response Handler/Chain                              */
                /*   Transport Specific Response Handler/Chain                  */
                /**************************************************************/

                // When do we call init/cleanup??
                log.debug( Messages.getMessage("defaultLogic00") );

                /*  This is what the entirety of this logic might evolve to:

                hName = msgContext.getStrProp(MessageContext.TRANSPORT);
                if ( hName != null ) {
                if ((h = hr.find( hName )) != null ) {
                h.generateWSDL(msgContext);
                } else {
                log.error(Messages.getMessage("noTransport02", hName));
                }
                } else {
                // No transport set, so use the default (probably just
                // calls the global->service handlers)
                defaultTransport.generateWSDL(msgContext);
                }

                */

                /* Process the Transport Specific Request Chain */
                /**********************************************/
                hName = msgContext.getTransportName();
                SimpleTargetedChain transportChain = null;

                if (log.isDebugEnabled())
                    log.debug(Messages.getMessage("transport01",
                                                   "AxisServer.generateWSDL",
                                                   hName));
                if ( hName != null && (h = getTransport( hName )) != null ) {
                    if (h instanceof SimpleTargetedChain) {
                        transportChain = (SimpleTargetedChain)h;
                        h = transportChain.getRequestHandler();
                        if (h != null) {
                            h.generateWSDL(msgContext);
                        }
                    }
                }

                /* Process the Global Request Chain */
                /**********************************/
                if ((h = getGlobalRequest()) != null )
                    h.generateWSDL(msgContext);

                /**
                 * At this point, the service should have been set by someone
                 * (either the originator of the MessageContext, or one of the
                 * transport or global Handlers).  If it hasn't been set, we
                 * fault.
                 */
                h = msgContext.getService();
                if (h == null) {
                    // It's possible that we haven't yet parsed the
                    // message at this point.  This is a kludge to
                    // make sure we have.  There probably wants to be
                    // some kind of declarative "parse point" on the handler
                    // chain instead....
                    Message rm = msgContext.getRequestMessage();
                    if (rm != null) {
                        rm.getSOAPEnvelope().getFirstBody();
                        h = msgContext.getService();
                    }
                    if (h == null) {
                        throw new AxisFault(Constants.QNAME_NO_SERVICE_FAULT_CODE,
                                            Messages.getMessage("noService05",
                                                                 "" + msgContext.getTargetService()),
                                            null, null );
                    }
                }

                h.generateWSDL(msgContext);

                /* Process the Global Response Chain */
                /***********************************/
                if ((h = getGlobalResponse()) != null )
                    h.generateWSDL(msgContext);

                /* Process the Transport Specific Response Chain */
                /***********************************************/
                if (transportChain != null) {
                    h = transportChain.getResponseHandler();
                    if (h != null) {
                        h.generateWSDL(msgContext);
                    }
                }
            }
        } catch (AxisFault e) {
            throw e;
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Enter: AxisClient::invoke");
        }

        String  hName = null ;
        Handler h     = null ;

        // save previous context
        MessageContext previousContext = getCurrentMessageContext();

        try {
            // set active context
            setCurrentMessageContext(msgContext);

            hName = msgContext.getStrProp( MessageContext.ENGINE_HANDLER );
            if (log.isDebugEnabled()) {
                log.debug( "EngineHandler: " + hName );
            }

            if ( hName != null ) {
                h = getHandler( hName );
                if ( h != null )
                    h.invoke(msgContext);
                else
                    throw new AxisFault( "Client.error",
                                        Messages.getMessage("noHandler00", hName),
                                        null, null );
            }
            else {
                // This really should be in a handler - but we need to discuss it
                // first - to make sure that's what we want.

                /* Now we do the 'real' work.  The flow is basically:         */
                /*                                                            */
                /*   Service Specific Request Chain                           */
                /*   Global Request Chain                                     */
                /*   Transport Request Chain - must have a send at the end    */
                /*   Transport Response Chain                                 */
                /*   Global Response Chain                                    */
                /*   Service Specific Response Chain                          */
                /*   Protocol Specific-Handler/Checker                        */
                /**************************************************************/

                // When do we call init/cleanup??

                SOAPService service = null ;
                msgContext.setPastPivot(false);

                /* Process the Service Specific Request Chain */
                /**********************************************/
                service = msgContext.getService();
                if ( service != null ) {
                    h = service.getRequestHandler();
                    if ( h != null )
                        h.invoke( msgContext );
                }

                /* Process the Global Request Chain */
                /**********************************/
                if ((h = getGlobalRequest()) != null )
                    h.invoke(msgContext);

                /* Process the JAXRPC Handlers */
                invokeJAXRPCHandlers(msgContext);

                /** Process the Transport Specific stuff
                 *
                 * NOTE: Somewhere in here there is a handler which actually
                 * sends the message and receives a response.  Generally
                 * this is the pivot point in the Transport chain.
                 */
                hName = msgContext.getTransportName();
                if ( hName != null && (h = getTransport( hName )) != null ) {
                    h.invoke(msgContext);
                }
                else {
                    throw new AxisFault(
                        Messages.getMessage("noTransport00", hName));
                }

                /* Process the JAXRPC Handlers */
                invokeJAXRPCHandlers(msgContext);

                /* Process the Global Response Chain */
                /***********************************/
                if ((h = getGlobalResponse()) != null) {
                    h.invoke(msgContext);
                }

                if ( service != null ) {
                    h = service.getResponseHandler();
                    if ( h != null ) {
                        h.invoke(msgContext);
                    }
                }

                // Do SOAP Semantics checks here - this needs to be a call to
                // a pluggable object/handler/something
View Full Code Here

     * find a suitable item
     */
    Handler makeNewInstance(DeploymentRegistry registry) throws Exception {
        try {
            Class c = getTypeClass(getType());
            Handler h = (Handler)createInstance(c);
            h.setOptions(getParametersTable());
            return h;
        } catch (ClassNotFoundException e) {
            String type = getType();
            Handler h = registry.getDeployedItem(type);
            if (h != null) {
                WSDDParameter[] parms = getParameters();
                for (int n = 0; n < parms.length; n++) {
                    WSDDParameter parm = parms[n];
                    h.addOption(parm.getName(), parm.getValue());
                }
                return h;
            }
            throw e;
        } catch (Exception e) {
View Full Code Here

    public Handler newInstance(DeploymentRegistry registry) throws Exception {
        return newInstance(null, registry);
    }
   
    public Handler newInstance(Handler pivot, DeploymentRegistry registry) throws Exception {
        Handler h = super.makeNewInstance(registry);
        TargetedChain c = (TargetedChain)h;
        c.setRequestHandler(getRequestFlow().newInstance(registry));
        c.setPivotHandler(pivot);
        c.setResponseHandler(getResponseFlow().newInstance(registry));
        return c;
View Full Code Here

                                JavaClass jc,
                   
                                Object obj)
        throws Exception
    {
        Handler targetService = msgContext.getServiceHandler();
       
        // is this service a body-only service?
        // if true (the default), the servic3e expects two args,
        // a MessageContext and a Document which is the contents of the first body element.
        // if false, the service expects just one MessageContext argument,
        // and looks at the entire request envelope in the MessageContext
        // (hence it's a "FullMessageService").
        boolean bodyOnlyService = true;
        if (targetService.getOption("FullMessageService") != null) {
            bodyOnlyService = false;
        }
       
        Class[]         argClasses;
        Object[]        argObjects;
View Full Code Here

    }
   
    public Handler getHandler()
    {
        try {
            Handler handler = (Handler)_class.newInstance();
            handler.setOptions(_options);
            if (category.isDebugEnabled())
                category.debug("FactorySupplier returning new instance of " + _class.getName());
            return handler;
        } catch (IllegalAccessException e1) {
            e1.printStackTrace();
View Full Code Here

     */
    public Document ProxyService(MessageContext msgContext)
        throws AxisFault
    {
        // Look in the message context for our service
        Handler self = msgContext.getServiceHandler();
       
        // what is our target URL?
        String dest = (String)self.getOption("URL");
       
        // use the server's client engine in case anything has been deployed to it
        ServiceClient client = new ServiceClient(msgContext.getAxisEngine().getClientEngine());
       
        // add TCP for proxy testing
View Full Code Here

        return type;
    }
  
    public Handler newInstance(DeploymentRegistry registry) throws Exception {
        try {
            Handler h = super.makeNewInstance(registry);
            Chain c = (Chain)h;
            WSDDHandler[] handlers = getHandlers();
            for (int n = 0; n < handlers.length; n++) {
                c.addHandler(handlers[n].newInstance(registry));
            }
View Full Code Here

    /**
     * Creates a new instance of this Chain
     */
    public Handler newInstance(DeploymentRegistry registry) throws Exception {
        try {
            Handler h = super.newInstance(registry);
            Chain c = (Chain)h;
            WSDDHandler[] handlers = getHandlers();
            for (int n = 0; n < handlers.length; n++) {
                c.addHandler(handlers[n].newInstance(registry));
            }
View Full Code Here

TOP

Related Classes of org.apache.axis.Handler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.