Examples of MsgProcessor


Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

    if(log.isDebugEnabled()) log.debug("MsgReceiver got type: " + SandeshaUtil.getMessageTypeString(rmMsgCtx.getMessageType()))

    // Note that some messages (such as stand-alone acks) will be routed here, but
    // the headers will already have been processed. Therefore we should not assume
    // that we will have a MsgProcessor every time.
    MsgProcessor msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
    if(msgProcessor != null) {
      Transaction transaction = null;
     
      try {
        ConfigurationContext context = msgCtx.getConfigurationContext();
        StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context, context.getAxisConfiguration());       
        transaction = storageManager.getTransaction();

        msgProcessor.processInMessage(rmMsgCtx, transaction);

        if(transaction != null && transaction.isActive()) transaction.commit();
          transaction = null;

      } catch (Exception e) {
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

    if(log.isDebugEnabled()) log.debug("MsgReceiver got type: " + SandeshaUtil.getMessageTypeString(rmMsgCtx.getMessageType()))

    // Note that some messages (such as stand-alone acks) will be routed here, but
    // the headers will already have been processed. Therefore we should not assume
    // that we will have a MsgProcessor every time.
    MsgProcessor msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
    if(msgProcessor != null) {
      Transaction transaction = null;
     
      if (msgCtx.getAxisService() != null) {
        Parameter unreliableParam = msgCtx.getAxisService().getParameter(SandeshaClientConstants.UNRELIABLE_MESSAGE);
        if (null != unreliableParam && "true".equals(unreliableParam.getValue())) {
         
          if (rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.CREATE_SEQ)
            FaultManager.makeCreateSequenceRefusedFault(rmMsgCtx,
                SandeshaMessageHelper.getMessage(SandeshaMessageKeys.reliableMessagingNotEnabled, msgCtx.getAxisService().getName()),
                new Exception());
          else
            throw new AxisFault(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.reliableMessagingNotEnabled, msgCtx.getAxisService().getName()));
         
          log.debug("Exit: RMMessageReceiver::invokeBusinessLogic, Service has disabled RM ");
          return;
        }
      }

      try {
        ConfigurationContext context = msgCtx.getConfigurationContext();
        StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context, context.getAxisConfiguration());       
        transaction = storageManager.getTransaction();

        msgProcessor.processInMessage(rmMsgCtx, transaction);

        if(transaction != null && transaction.isActive()) transaction.commit();
          transaction = null;

      } catch (Exception e) {
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

      transaction = storageManager.getTransaction();
     
      // getting rm message
      RMMsgContext rmMsgCtx = MsgInitializer.initializeMessage(msgCtx);

      MsgProcessor msgProcessor = null;
      int messageType = rmMsgCtx.getMessageType();
      if(log.isDebugEnabled()) log.debug("Message Type: " + messageType);
      if (messageType == Sandesha2Constants.MessageTypes.UNKNOWN) {
                if (msgCtx.isServerSide()) {
                  String inboundSequence = (String) msgCtx.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID);
                  Long   msgNum = (Long) msgCtx.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_MESSAGE_NUMBER);
                 
                    if (inboundSequence != null && msgNum != null) {
                  msgProcessor = new ApplicationMsgProcessor(inboundSequence, msgNum.longValue());
                    }
                } else // if client side.
                    msgProcessor = new ApplicationMsgProcessor();
               
      } else {
        msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
      }

      if (msgProcessor != null){
        if(msgProcessor.processOutMessage(rmMsgCtx)){
          //the msg was paused
          returnValue = InvocationResponse.SUSPEND;
        }
      } else if (messageType==Sandesha2Constants.MessageTypes.ACK_REQUEST) {
        AckRequestedProcessor ackRequestedProcessor = new AckRequestedProcessor ();
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

    if (dummyMessageString!=null && Sandesha2Constants.VALUE_TRUE.equals(dummyMessageString))
      dummyMessage = true;
   
    StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context);

    MsgProcessor msgProcessor = null;
    int messageType = rmMsgCtx.getMessageType();
    if (messageType==Sandesha2Constants.MessageTypes.UNKNOWN) {
      MessageContext requestMsgCtx = msgCtx.getOperationContext().getMessageContext(OperationContextFactory.MESSAGE_LABEL_IN_VALUE);
      if (requestMsgCtx!=null) {  //for the server side
        RMMsgContext reqRMMsgCtx = MsgInitializer.initializeMessage(requestMsgCtx);
        Sequence sequencePart = (Sequence) reqRMMsgCtx.getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
        if (sequencePart!=null)
          msgProcessor = new ApplicationMsgProcessor ();// a rm intended message.
      } else if (!msgCtx.isServerSide()) //if client side.
          msgProcessor = new ApplicationMsgProcessor ();
    }else  {
      msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
    }
   
    if (msgProcessor!=null)
      msgProcessor.processOutMessage(rmMsgCtx);
 
  }
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

      String message = "Cant initialize the message";
      log.debug(message);
      throw new AxisFault(message);
    }
   
    MsgProcessor msgProcessor = MsgProcessorFactory.getMessageProcessor (rmMsgCtx);

    try {
      if (msgProcessor!=null)
        msgProcessor.processInMessage(rmMsgCtx);
    } catch (SandeshaException se) {
      String message = "Error in processing the message";
      log.debug(message);
      throw new AxisFault(message,se);
    }
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

    if(log.isDebugEnabled()) log.debug("MsgReceiver got type: " + SandeshaUtil.getMessageTypeString(rmMsgCtx.getMessageType()))

    // Note that some messages (such as stand-alone acks) will be routed here, but
    // the headers will already have been processed. Therefore we should not assume
    // that we will have a MsgProcessor every time.
    MsgProcessor msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
    if(msgProcessor != null) {
      Transaction transaction = null;
     
      if (msgCtx.getAxisService() != null) {
        Parameter unreliableParam = msgCtx.getAxisService().getParameter(SandeshaClientConstants.UNRELIABLE_MESSAGE);
        if (null != unreliableParam && "true".equals(unreliableParam.getValue())) {
         
          if (rmMsgCtx.getMessageType() == Sandesha2Constants.MessageTypes.CREATE_SEQ)
            FaultManager.makeCreateSequenceRefusedFault(rmMsgCtx,
                SandeshaMessageHelper.getMessage(SandeshaMessageKeys.reliableMessagingNotEnabled, msgCtx.getAxisService().getName()),
                new Exception(), null);
          else
            throw new AxisFault(SandeshaMessageHelper.getMessage(SandeshaMessageKeys.reliableMessagingNotEnabled, msgCtx.getAxisService().getName()));
          if (log.isDebugEnabled())
            log.debug("Exit: RMMessageReceiver::invokeBusinessLogic, Service has disabled RM ");
          return;
        }
      }

      try {
        ConfigurationContext context = msgCtx.getConfigurationContext();
        StorageManager storageManager = SandeshaUtil.getSandeshaStorageManager(context, context.getAxisConfiguration());       
        transaction = storageManager.getTransaction();

        msgProcessor.processInMessage(rmMsgCtx, transaction);

        if(transaction != null && transaction.isActive()) transaction.commit();
          transaction = null;

      } catch (Exception e) {
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

      transaction = storageManager.getTransaction();
     
      // getting rm message
      RMMsgContext rmMsgCtx = MsgInitializer.initializeMessage(msgCtx);

      MsgProcessor msgProcessor = null;
      int messageType = rmMsgCtx.getMessageType();
      if(LoggingControl.isAnyTracingEnabled() && log.isDebugEnabled()) log.debug("Message Type: " + messageType);
      if (messageType == Sandesha2Constants.MessageTypes.UNKNOWN) {
                if (msgCtx.isServerSide()) {
                  String inboundSequence = (String) msgCtx.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID);
                  Long   msgNum = (Long) msgCtx.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_MESSAGE_NUMBER);
                 
                    if (inboundSequence != null && msgNum != null) {
                  msgProcessor = new ApplicationMsgProcessor(inboundSequence, msgNum.longValue());
                    }
                } else // if client side.
                    msgProcessor = new ApplicationMsgProcessor();
               
      } else {
        msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
      }

      if (msgProcessor != null){
            if(msgProcessor.processOutMessage(rmMsgCtx, transaction)){
          //the msg was paused
          returnValue = InvocationResponse.SUSPEND;
        }
      } else if (messageType==Sandesha2Constants.MessageTypes.ACK_REQUEST) {
        AckRequestedProcessor ackRequestedProcessor = new AckRequestedProcessor ();
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

            + SandeshaUtil.getMessageTypeString(rmMsgCtx
                .getMessageType()) + "' message.");
      }
    }

    MsgProcessor msgProcessor = MsgProcessorFactory
        .getMessageProcessor(rmMsgCtx.getMessageType());

    if (msgProcessor == null)
      throw new AxisFault("Cant find a suitable message processor");

    try {
      msgProcessor.processMessage(rmMsgCtx);
    } catch (SandeshaException se) {
      se.printStackTrace();
      throw new AxisFault("Error in processing the message");
    }
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

    try {
      // getting rm message
      RMMsgContext rmMsgCtx = MsgInitializer.initializeMessage(msgCtx);

      MsgProcessor msgProcessor = null;
      int messageType = rmMsgCtx.getMessageType();
      if (messageType == Sandesha2Constants.MessageTypes.UNKNOWN) {
        MessageContext requestMsgCtx = msgCtx.getOperationContext().getMessageContext(
            OperationContextFactory.MESSAGE_LABEL_IN_VALUE);

                if (msgCtx.isServerSide()) { // for the server side
                    RMMsgContext reqRMMsgCtx = MsgInitializer.initializeMessage(requestMsgCtx);
                    Sequence sequencePart = (Sequence) reqRMMsgCtx
                                    .getMessagePart(Sandesha2Constants.MessageParts.SEQUENCE);
                    if (sequencePart != null)
                            msgProcessor = new ApplicationMsgProcessor();// a rm intended message
                } else // if client side.
                    msgProcessor = new ApplicationMsgProcessor();
               
      } else {
        msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);
      }

      if (msgProcessor != null){
        if(msgProcessor.processOutMessage(rmMsgCtx)){
          //the msg was paused
          returnValue = InvocationResponse.SUSPEND;
        }
      } else if (messageType==Sandesha2Constants.MessageTypes.ACK_REQUEST) {
        AckRequestedProcessor ackRequestedProcessor = new AckRequestedProcessor ();
View Full Code Here

Examples of org.apache.sandesha2.msgprocessors.MsgProcessor

      if (rmMsgCtx.getMessageType()==Sandesha2Constants.MessageTypes.ACK) {
        rmMsgCtx.pause();
        returnValue = InvocationResponse.SUSPEND;
      }
     
      MsgProcessor msgProcessor = MsgProcessorFactory.getMessageProcessor(rmMsgCtx);

      if (msgProcessor != null){
        if(msgProcessor.processInMessage(rmMsgCtx)){
          //this paused the msg
          returnValue = InvocationResponse.SUSPEND;
        }
      }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.