Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker


    public static void sendBack(org.apache.synapse.MessageContext smc) {

        MessageContext messageContext = ((Axis2MessageContext) smc).getAxis2MessageContext();

        AxisEngine ae = new AxisEngine(messageContext.getConfigurationContext());
        try {
            messageContext.setProperty(Constants.ISRESPONSE_PROPERTY, Boolean.TRUE);
            // check for addressing is alredy engaged for this message.
            // if engage we should use the address enable Configuraion context.
            ae.send(messageContext);

        } catch (AxisFault e) {
            throw new SynapseException(e);
        }
    }
View Full Code Here


                }
            } catch (ManagementException e) {
                // Building a nicely formatted fault
                envelope.getBody().addFault(toSoapFault(e, soapFactory));
            }
            AxisEngine engine = new AxisEngine(
                    msgContext.getOperationContext().getServiceContext().getConfigurationContext());
            engine.send(outMsgContext);
        } catch (IllegalAccessException e) {
            throw new OdeFault("Couldn't invoke method named " + methodName + " in management interface!", e);
        } catch (InvocationTargetException e) {
            throw new OdeFault("Invocation of method " + methodName + " in management interface failed!", e.getTargetException());
        }
View Full Code Here

            if (__log.isDebugEnabled()) {
                __log.debug("Reply for " + msgContext.getAxisService().getName() + "."
                        + msgContext.getAxisOperation().getName());
                __log.debug("Reply message " + outMsgContext.getEnvelope());
            }
            AxisEngine engine = new AxisEngine(msgContext.getOperationContext().getServiceContext()
                    .getConfigurationContext());
            engine.send(outMsgContext);
        } else {
            if (__log.isDebugEnabled())
                __log.debug("Received one-way message for " + msgContext.getAxisService().getName() + "."
                        + msgContext.getAxisOperation().getName());
            invokeBusinessLogic(msgContext, null);
View Full Code Here

            outMsgContext.setEnvelope(envelope);

            OMElement responseOp = factory.createOMElement(op, _pmapi);
            responseOp.addChild(response);
            envelope.getBody().addChild(response);
            AxisEngine engine = new AxisEngine(
                    messageContext.getOperationContext().getServiceContext().getConfigurationContext());
            engine.send(outMsgContext);
        }
View Full Code Here

      if (__log.isDebugEnabled()) {
                __log.debug("Reply for " + msgContext.getAxisService().getName() + "."
                        + msgContext.getAxisOperation().getName());
        __log.debug("Reply message " + outMsgContext.getEnvelope());
      }
            AxisEngine engine = new AxisEngine(msgContext.getOperationContext().getServiceContext()
                    .getConfigurationContext());
      engine.send(outMsgContext);
    } else {
            if (__log.isDebugEnabled())
                __log.debug("Received one-way message for " + msgContext.getAxisService().getName() + "."
                        + msgContext.getAxisOperation().getName());
            invokeBusinessLogic(msgContext, null);
View Full Code Here

                if (__log.isDebugEnabled()) {
                    __log.debug("Reply mgmt for " + msgContext.getAxisService().getName() +
                            "." + msgContext.getAxisOperation().getName());
                    __log.debug("Reply mgmt message " + outMsgContext.getEnvelope());
                }
                AxisEngine engine = new AxisEngine(
                        msgContext.getOperationContext().getServiceContext().getConfigurationContext());
                engine.send(outMsgContext);
            }
        } catch (IllegalAccessException e) {
            throw new OdeFault("Couldn't invoke method named " + methodName + " in management interface!", e);
        } catch (InvocationTargetException e) {
            throw new OdeFault("Invocation of method " + methodName + " in management interface failed!", e);
View Full Code Here

            doService2(request, response, msgContext);
        } catch (Throwable e) {
            String msg = "Exception occurred while trying to invoke service method doService()";
            LOG.error(msg, e);
            try {
                AxisEngine engine = new AxisEngine(this.configurationContext);

                msgContext.setProperty(MessageContext.TRANSPORT_OUT, response.getOutputStream());
                msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, new Axis2TransportInfo(response));

                MessageContext faultContext = MessageContextBuilder.createFaultMessageContext(msgContext, e);
                // If the fault is not going along the back channel we should be 202ing
                if (AddressingHelper.isFaultRedirected(msgContext)) {
                    response.setStatusCode(HttpURLConnection.HTTP_ACCEPTED);
                } else {
                    response.setStatusCode(HttpURLConnection.HTTP_INTERNAL_ERROR);
                }
                engine.sendFault(faultContext);
            } catch (Exception ex) {
                if (AddressingHelper.isFaultRedirected(msgContext)) {
                    response.setStatusCode(HttpURLConnection.HTTP_ACCEPTED);
                } else {
                    response.setStatusCode(HttpURLConnection.HTTP_INTERNAL_ERROR);
View Full Code Here

        if (e == null) {
            e = new Exception(msg);
        }

        try {
            AxisEngine engine = new AxisEngine(cfgCtx);
            MessageContext faultContext = engine.createFaultMessageContext(msgContext, e);
            engine.sendFault(faultContext);

        } catch (Exception ex) {
            response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
            response.addHeader(CONTENT_TYPE, TEXT_XML);
            serverHandler.commitResponse(conn, response);
View Full Code Here

    /**
     * The main workhorse method.
     */
    public void run() {
        AxisEngine engine = new AxisEngine(configContext);
        // create and initialize a message context
        try {
            engine.receive(messageContext);
        } catch (Exception e) {
            try {
                if (messageContext != null&&!messageContext.isServerSide()) {
                    MessageContext faultContext =
                            MessageContextBuilder.createFaultMessageContext(messageContext, e);
                    engine.sendFault(faultContext);
                }
            } catch (Exception e1) {
                // Ignore errors that would possibly happen this catch
            }
        }
View Full Code Here

        response.setEnvelope(responseEnv);

        TestLogger.logger.debug("[server] response message [" + responseEnv.toString() + "]");
       
        response.getOperationContext().addMessageContext(response);
        AxisEngine engine = new AxisEngine(response.getConfigurationContext());
        engine.send(response);   
    }
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker

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.