Examples of JMSBindingContext


Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

    }
   
    public Message invokeRequest(Message msg) {
        try {
            // get the jms context
            JMSBindingContext context = msg.getBindingContext();
            Session session = context.getJmsSession();
           
            javax.jms.Message requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, msg.getBody());
            msg.setBody(requestMsg);
           
            requestMsg.setJMSReplyTo(context.getReplyToDestination());
           
            return msg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

    }
   
    public Message invokeRequest(Message tuscanyMsg) {
        try {
            // get the jms context
            JMSBindingContext context = tuscanyMsg.getBindingContext();
            javax.jms.Message jmsMsg = tuscanyMsg.getBody();
           
            Operation operation = tuscanyMsg.getOperation();
            String operationName = operation.getName();
            RuntimeEndpointReference reference = runtimeWire;
           
            // I think the OASIS spec suggests we do not need to do anything with
            // @nativeOperation here on the reference side.
            requestMessageProcessor.setOperationName(operationName, jmsMsg);
   
         
           
            if (jmsBinding.getEffectiveJMSDeliveryMode(operationName) != null) {
              if (jmsBinding.getEffectiveJMSDeliveryMode(operationName)) {
                jmsMsg.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
              } else {
                jmsMsg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
              }
            }
   
            if (jmsBinding.getEffectiveJMSPriority(operationName) != null) {
              jmsMsg.setJMSPriority(jmsBinding.getEffectiveJMSPriority(operationName));
            }
   
            if ( jmsBinding.getEffectiveJMSType(operationName) != null ) {        
              jmsMsg.setJMSType(jmsBinding.getEffectiveJMSType(operationName));
            }
           
            if ( jmsBinding.getEffectiveJMSTimeToLive(operationName) != null ) {
              jmsMsg.setJMSExpiration(jmsBinding.getEffectiveJMSTimeToLive(operationName));
            }
           
            if (jmsBinding.getOperationJMSCorrelationId(operationName) != null) {
                jmsMsg.setJMSCorrelationID(jmsBinding.getOperationJMSCorrelationId(operationName));
            } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equals(jmsBinding.getCorrelationScheme())) {
                jmsMsg.setJMSCorrelationID(UUID.randomUUID().toString());
            }
   
            if (tuscanyMsg.getFrom().getCallbackEndpoint() != null) {
   
                String callbackDestName = getCallbackDestinationName(reference);
                if (callbackDestName != null) {
                    jmsMsg.setStringProperty(JMSBindingConstants.CALLBACK_Q_PROPERTY, "jms:jndi:" + callbackDestName);
                    if (operation.isNonBlocking()) {
                      Destination dest = context.getJmsResourceFactory().lookupDestination(callbackDestName);
            jmsMsg.setJMSReplyTo(dest);
                    }
                }
            }
           
            for (String propName : jmsBinding.getPropertyNames()) {
                Object value = jmsBinding.getProperty(propName);
                jmsMsg.setObjectProperty(propName, value);
            }
   
            Map<String, Object> operationProperties = jmsBinding.getOperationProperties(operationName);
            if (operationProperties != null) {
                for (String propName : operationProperties.keySet()) {
                    Object value = operationProperties.get(propName);
                    jmsMsg.setObjectProperty(propName, value);
                }
            }
           
            if (jmsBinding.getEffectiveJMSTimeToLive(operationName) != null) {
                context.setTimeToLive(jmsBinding.getEffectiveJMSTimeToLive(operationName) * 2);       
            } else {  
              context.setTimeToLive(JMSBindingConstants.DEFAULT_TIME_TO_LIVE);       
            }
           
            return tuscanyMsg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

        return msg;
    }
   
    public Message invokeRequest(Message msg) {
        // get the jms context
        JMSBindingContext context = msg.getBindingContext();
        javax.jms.Message jmsMsg = context.getJmsMsg();
        Object requestPayload;
       
        // If the service interface has a single argument then we need
        // to check if the object from the wire is expected 
        // to be unwrapped or not
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

        return msg;
    }
   
    public Message invokeRequest(Message msg) {
        // get the jms context
        JMSBindingContext context = msg.getBindingContext();
        javax.jms.Message jmsMsg = context.getJmsMsg();

        Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(jmsMsg);
        msg.setBody(new Object[]{requestPayload});
                
        return msg;
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

        return msg;
    }
   
    public Message invokeResponse(Message msg) {
        // get the jms context
        JMSBindingContext context = msg.getBindingContext();
        Session session = context.getJmsResponseSession();

        javax.jms.Message responseJMSMsg = null;
        if (msg.isFault()) {
            responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody());
        } else {
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

        return msg;
    }
   
    public Message invokeResponse(Message msg) {
        // get the jms context
        JMSBindingContext context = msg.getBindingContext();
        Session session = context.getJmsResponseSession();

        javax.jms.Message responseJMSMsg;
        if (msg.isFault()) {
            responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody());
        } else {
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

    }
   
    public Message invokeRequest(Message msg) {
        try {
            // get the jms context
            JMSBindingContext context = msg.getBindingContext();
            Session session = context.getJmsSession();

            javax.jms.Message requestMsg;
                       
            // Tuscany automatically wraps operation arguments in an array before we
            // get to this point so here we need to decide how they are going to appear
            // on the wire.
            //
            // If the operation has a single parameter and the user has set @wrapSingle=false
            // then
            //    send the single parameter out onto the wire unwrapped
            // else
            //    send out the message as is
            //
            if (singleArgMap.get(msg.getOperation().getName()) == null) {
                requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, msg.getBody());
            } else {
                // we know that wrapSinle is set to false here as the provider only
                // populates singleArgMap if it is set false
                requestMsg = ((ObjectMessageProcessor) requestMessageProcessor).createJMSMessageForSingleParamOperation(session, msg.getBody(), false);
            }

            msg.setBody(requestMsg);
           
            requestMsg.setJMSReplyTo(context.getReplyToDestination());
           
            return msg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

        return msg;
    }
   
    public Message invokeRequest(Message msg) {
        // get the jms context
        JMSBindingContext context = msg.getBindingContext();
        javax.jms.Message jmsMsg = context.getJmsMsg();

        Object requestPayload = requestMessageProcessor.extractPayloadFromJMSMessage(jmsMsg);
        msg.setBody(new Object[]{requestPayload});
                
        return msg;
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

        return msg;
    }
   
    public Message invokeResponse(Message msg) {
        // get the jms context
        JMSBindingContext context = msg.getBindingContext();
        Session session = context.getJmsResponseSession();

        javax.jms.Message responseJMSMsg;
        if (msg.isFault()) {
            responseJMSMsg = responseMessageProcessor.createFaultMessage(session, (Throwable)msg.getBody());
        } else {
View Full Code Here

Examples of org.apache.tuscany.sca.binding.jms.context.JMSBindingContext

    }
   
    public Message invokeRequest(Message msg) {
        try {
            // get the jms context
            JMSBindingContext context = msg.getBindingContext();
            Session session = context.getJmsSession();
           
            Object[] requestParams = msg.getBody();
            javax.jms.Message requestMsg = null;
            if (requestParams != null && requestParams.length > 0 ){
                requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, requestParams[0]);
            } else {
              requestMsg = requestMessageProcessor.insertPayloadIntoJMSMessage(session, null);
            }
            msg.setBody(requestMsg);
           
            requestMsg.setJMSReplyTo(context.getReplyToDestination());
           
            return msg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
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.