Package org.apache.axis2.engine

Examples of org.apache.axis2.engine.MessageReceiver


                if (request.getAttachment() != null &&
                    request.getAttachment() instanceof Axis2HttpRequest) {

                    Axis2HttpRequest axis2Request = (Axis2HttpRequest) request.getAttachment();
                    MessageContext mc = axis2Request.getMsgContext();
                    MessageReceiver mr = mc.getAxisOperation().getMessageReceiver();

                    try {
                        // this fault is NOT caused by the endpoint while processing. so we have to
                        // inform that this is a sending error (e.g. endpoint failure) and handle it
                        // differently at the message receiver.

                        Exception exception = request.getException();
                        MessageContext nioFaultMessageContext =
                            MessageContextBuilder.createFaultMessageContext(
                                /** this is not a mistake I do NOT want getMessage()*/
                                mc, new AxisFault(exception.toString(), exception));
                        nioFaultMessageContext.setProperty(NhttpConstants.SENDING_FAULT, Boolean.TRUE);
                        mr.receive(nioFaultMessageContext);
                       
                    } catch (AxisFault af) {
                        log.error("Unable to report back failure to the message receiver", af);
                    }
                }
View Full Code Here


        messageReciverMap.put(
                org.apache.axis2.description.WSDL2Constants.MEP_URI_IN_ONLY,
                messageReceiver);
        Class inoutMessageReceiver = org.apache.axis2.util.Loader.loadClass(
                "org.apache.axis2.rpc.receivers.RPCMessageReceiver");
        MessageReceiver inOutmessageReceiver =
                (MessageReceiver) inoutMessageReceiver.newInstance();
        messageReciverMap.put(
                org.apache.axis2.description.WSDL2Constants.MEP_URI_IN_OUT,
                inOutmessageReceiver);
        messageReciverMap.put(org.apache.axis2.description.WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,
View Full Code Here

                // client. Should / would be ignored by any transport other than
                // nhttp. For example, JMS would not send a reply message for one-way
                // operations.
                MessageContext outMsgCtx =
                    (MessageContext) context.getAttribute(OUTGOING_MESSAGE_CONTEXT);
                MessageReceiver mr = outMsgCtx.getAxisOperation().getMessageReceiver();

                try {
                    MessageContext responseMsgCtx = outMsgCtx.getOperationContext().
                        getMessageContext(WSDL2Constants.MESSAGE_LABEL_IN);
                    if (responseMsgCtx == null) {
                        // to support Sandesha.. however, this means that we received a 202 accepted
                        // for an out-only , for which we do not need a dummy message anyway
                        return;
                    }
                    responseMsgCtx.setServerSide(true);
                    responseMsgCtx.setDoingREST(outMsgCtx.isDoingREST());
                    responseMsgCtx.setProperty(MessageContext.TRANSPORT_IN,
                        outMsgCtx.getProperty(MessageContext.TRANSPORT_IN));
                    responseMsgCtx.setTransportIn(outMsgCtx.getTransportIn());
                    responseMsgCtx.setTransportOut(outMsgCtx.getTransportOut());

                    responseMsgCtx.setAxisMessage(outMsgCtx.getAxisOperation().
                        getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE));
                    responseMsgCtx.setOperationContext(outMsgCtx.getOperationContext());
                    responseMsgCtx.setConfigurationContext(outMsgCtx.getConfigurationContext());
                    responseMsgCtx.setTo(null);

                    if (!outMsgCtx.isDoingREST() && !outMsgCtx.isSOAP11()) {
                        responseMsgCtx.setEnvelope(new SOAP12Factory().getDefaultEnvelope());
                    } else {
                        responseMsgCtx.setEnvelope(new SOAP11Factory().getDefaultEnvelope());
                    }
                    responseMsgCtx.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
                    responseMsgCtx.setProperty(NhttpConstants.SC_ACCEPTED, Boolean.TRUE);
                    mr.receive(responseMsgCtx);

                } catch (org.apache.axis2.AxisFault af) {
                    log.error("Unable to report back 202 Accepted state to the message receiver", af);
                }
View Full Code Here

      MessageContext context = storageManager.retrieveMessageContext(messageStoreKey, configCtx);
     
      AxisOperation axisOperation = context.getAxisOperation();
      if (axisOperation != null)
      {
        MessageReceiver msgReceiver = axisOperation.getMessageReceiver();
        if ((msgReceiver != null) && (msgReceiver instanceof CallbackReceiver))
        {
          Object callback = ((CallbackReceiver)msgReceiver).lookupCallback(context.getMessageID());
          if (callback instanceof Callback)
          {
View Full Code Here

                OperationContext opCtx =
                        configurationContext.getOperationContext(bean.getApplicationMessageMessageId());
                if (opCtx != null) {
                    AxisOperation applicationAxisOperation = opCtx.getAxisOperation();
                    if (applicationAxisOperation != null) {
                        MessageReceiver msgReceiver = applicationAxisOperation.getMessageReceiver();
                        if ((msgReceiver != null) && (msgReceiver instanceof CallbackReceiver)) {
                            Object callback = ((CallbackReceiver) msgReceiver)
                                    .lookupCallback(bean.getApplicationMessageMessageId());
                            if (callback != null) {
                                AxisCallback axisCallback = ((AxisCallback) callback);
View Full Code Here

        oldRMSBean.setReallocated(Sandesha2Constants.WSRM_COMMON.REALLOCATION_FAILED);
        storageManager.getRMSBeanMgr().update(oldRMSBean);
        throw new SandeshaException(SandeshaMessageKeys.reallocationForSyncRequestReplyNotSupported);
      } else {
        MessageReceiver msgReceiver = axisOperation.getMessageReceiver();
        Object callback = ((CallbackReceiver)msgReceiver).lookupCallback(msgCtx.getMessageID())
        client.setAxisService(msgCtx.getAxisService());
        client.sendReceiveNonBlocking(msgCtx.getEnvelope().getBody().cloneOMElement().getFirstElement(), (Callback)callback);
      }
    }
View Full Code Here

            // element name
            if (operation == null) {
                operation = axisService.getOperation(new QName(
                        jmethod.getName()));
            }
            MessageReceiver mr =
                    axisService.getMessageReceiver(operation.getMessageExchangePattern());
            if (mr == null) {
                mr = axisConfig.getMessageReceiver(operation.getMessageExchangePattern());
            }
            if (operation.getMessageReceiver() == null) {
View Full Code Here

    }
  }

  private MessageReceiver loadDefaultMessageReceiver(String mepURL,
      AxisService service) {
    MessageReceiver messageReceiver;
    if (mepURL == null) {
      mepURL = WSDL2Constants.MEP_URI_IN_OUT;
    }
    if (service != null) {
      messageReceiver = service.getMessageReceiver(mepURL);
View Full Code Here

    try {
      HashMap<String, MessageReceiver> messageReciverMap = new HashMap<String, MessageReceiver>();
      Class inOnlyMessageReceiver = Loader
          .loadClass("org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
      MessageReceiver messageReceiver = (MessageReceiver) inOnlyMessageReceiver
          .newInstance();
      messageReciverMap.put(WSDL2Constants.MEP_URI_IN_ONLY,
          messageReceiver);
      Class inoutMessageReceiver = Loader
          .loadClass("org.apache.axis2.rpc.receivers.RPCMessageReceiver");
      MessageReceiver inOutmessageReceiver = (MessageReceiver) inoutMessageReceiver
          .newInstance();
      messageReciverMap.put(WSDL2Constants.MEP_URI_IN_OUT,
          inOutmessageReceiver);
      messageReciverMap.put(WSDL2Constants.MEP_URI_ROBUST_IN_ONLY,
          inOutmessageReceiver);
View Full Code Here

            String methodName = jmethod.getName();        
           
      AxisOperation operation = axisService.getOperation(new QName(methodName));

      String mep = operation.getMessageExchangePattern();
      MessageReceiver mr;
      if (messageReceiverClassMap != null) {

        if (messageReceiverClassMap.get(mep) != null) {
          Object obj = messageReceiverClassMap.get(mep);
          if (obj instanceof MessageReceiver) {
View Full Code Here

TOP

Related Classes of org.apache.axis2.engine.MessageReceiver

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.