Package org.apache.tuscany.sca.binding.jms.impl

Examples of org.apache.tuscany.sca.binding.jms.impl.JMSBindingException


                        OMElement om = (OMElement) response;
                        e.setFaultName(new QName(om.getNamespace().getNamespaceURI(), om.getLocalName()));
                        msg.setFaultBody(e);
                    }
                } catch (JMSException e) {
                    throw new JMSBindingException(e);
                }
            } else {
                msg.setBody(null);
            }
        }
View Full Code Here


                parameters.setConversationID(conversationID);
            }
           
            return msg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

            if (replyDest == null) {
                if (jmsBinding.getResponseDestinationName() != null) {
                    try {
                        replyDest = jmsResourceFactory.lookupDestination(jmsBinding.getResponseDestinationName());
                    } catch (NamingException e) {
                        throw new JMSBindingException("Exception lookingup response destination", e);
                    }
                }
            }

            if (replyDest == null) {
                // assume no reply is expected
                if (msg.getBody() != null) {
                    logger.log(Level.FINE, "JMS service '" + service.getName() + "' dropped response as request has no replyTo");
                }
                return msg;
            }
           
            responseJMSMsg.setJMSDeliveryMode(requestJMSMsg.getJMSDeliveryMode());
            responseJMSMsg.setJMSPriority(requestJMSMsg.getJMSPriority());
   
            if (correlationScheme == null ||
                JMSBindingConstants.CORRELATE_MSG_ID.equalsIgnoreCase(correlationScheme)) {
                responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSMessageID());
            } else if (JMSBindingConstants.CORRELATE_CORRELATION_ID.equalsIgnoreCase(correlationScheme)) {
                responseJMSMsg.setJMSCorrelationID(requestJMSMsg.getJMSCorrelationID());
            }               
                      
            MessageProducer producer = session.createProducer(replyDest);
           
            // Set jms header attributes in producer, not message.
            int deliveryMode = requestJMSMsg.getJMSDeliveryMode();
            producer.setDeliveryMode(deliveryMode);
            int deliveryPriority = requestJMSMsg.getJMSPriority();
            producer.setPriority(deliveryPriority);
   
            producer.send((javax.jms.Message)msg.getBody());
   
            producer.close();
            context.closeJmsResponseSession();
           
            return msg;
   
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }   
View Full Code Here

            } finally {
                producer.close();
            }
            return msg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

                replyMsg = consumer.receive(context.getTimeToLive());
            } finally {
                consumer.close();
            }
            if (replyMsg == null) {
                throw new JMSBindingException("No reply message received on " +
                                              context.getReplyToDestination() +
                                              " for message id " +
                                              requestMessage.getJMSMessageID());
            }
           
            msg.setBody(replyMsg);
            return msg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        } catch (NamingException e) {
            throw new JMSBindingException(e);
        } finally {
            try {
                context.closeJmsResponseSession();
                if (jmsResourceFactory.isConnectionClosedAfterUse())
                    jmsResourceFactory.closeResponseConnection();
View Full Code Here

                os = null;
            }
            return os;

        } catch (XMLStreamException e) {
            throw new JMSBindingException(e);
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

            }

            return message;

        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

                message.setText(String.valueOf(((FaultException)o).getFaultInfo()));
                message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true);
                return message;

            } catch (JMSException e) {
                throw new JMSBindingException(e);
            }
        } else {
            return super.createFaultMessage(session, o);
        }
    }
View Full Code Here

                return new InvocationTargetException(new ServiceRuntimeException(bytes.toString()));
            } else {
                return bytes;
            }
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

            byte [] bytes = new byte[(int)noOfBytes];
            ((BytesMessage)msg).readBytes(bytes);
            return bytes;

        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.jms.impl.JMSBindingException

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.