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

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


                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


            }
            message.setBooleanProperty(JMSBindingConstants.FAULT_PROPERTY, true);
            return message;

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

            requestMsg.setJMSReplyTo(context.getReplyToDestination());

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

                    if (!jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
                        // If there is only one arg we must add a wrapper if the operation is wrapper style
                        wrapper = this.outputWrapperMap.get(msg.getOperation().getName());
                    }
                } catch (JMSException e) {
                    throw new JMSBindingException(e);
                }

                Object response;
                if (jmsMsg instanceof BytesMessage) {
                    response = responseMessageProcessor.extractPayloadFromJMSBytesMessage(jmsMsg, wrapper);
                } else {
                    response = responseMessageProcessor.extractPayloadFromJMSTextMessage(jmsMsg, wrapper);
                }

                if (response != null) {
                    msg.setBody(response);
                    try {
                        if (jmsMsg.getBooleanProperty(JMSBindingConstants.FAULT_PROPERTY)) {
                            FaultException e = new FaultException("remote exception", response);
                            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

                }

            } catch (XMLStreamException e) {
                //let's ignore this in case the client doesn't want to use a wrapped xml message
            } catch (JMSException e) {
                throw new JMSBindingException(e);
            }

            // If operation is still null we attempt the last rule
            if (operation == null) {

                // SCA JMS Binding Specification - Rule 1.5.1 line 207
                for (Operation op : serviceOperations) {
                    if (op.getName().equals(ON_MESSAGE_METHOD_NAME)) {
                        operation = op;
                        break;
                    }
                }
            }
        }
       
        if (operation == null) {
            throw new JMSBindingException("Can't find operation " + (operationName != null ? operationName : ON_MESSAGE_METHOD_NAME));
        }

        return operation;
    }
View Full Code Here

            this.serviceListener = serviceListenerFactory.createJMSServiceListener(this);
            serviceListener.start();
           
        } catch (Exception e) {
            throw new JMSBindingException("Error starting JMSServiceBinding", e);
        }
    }
View Full Code Here

    public void stop() {
        try {
            serviceListener.stop();
        } catch (Exception e) {
            throw new JMSBindingException("Error stopping JMSServiceBinding", e);
        }
    }
View Full Code Here

    public Invoker createInvoker(Operation operation) {

        if (jmsBinding.getDestinationName() == null) {
            if (!reference.isCallback()) {
                throw new JMSBindingException("No destination specified for reference " + reference.getName());
            }
        }

        Invoker invoker = null;
        invoker = new RRBJMSBindingInvoker(jmsBinding, operation, jmsResourceFactory, reference);
View Full Code Here

    public void stop() {
        try {
            jmsResourceFactory.closeConnection();
            jmsResourceFactory.closeResponseConnection();
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
View Full Code Here

            if (!reference.isCallback()) {
                bindingRequestDest = lookupDestination();
            }
            bindingReplyDest = lookupResponseDestination();
        } catch (NamingException 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.