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

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


            } catch (IOException e) {
                //let's ignore this in case the client doesn't want to use a wrapped xml message
            } catch (SAXException 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("Cannot determine service operation");
        }

        return operation;
    }
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);
                            Node om = ((Node)response).getFirstChild();
                            e.setFaultName(new QName(om.getNamespaceURI(), om.getLocalName()));
                            msg.setFaultBody(e);
                        }
                    } catch (JMSException e) {
                        throw new JMSBindingException(e);
                    }
                } else {
                    msg.setBody(null);
                }
            }
View Full Code Here

        this.targetBinding = jmsBinding;
        this.jmsResourceFactory = jmsResourceFactory;
        this.registry = registry;

        if (jmsBinding.getResponseActivationSpecName() != null && jmsBinding.getResponseActivationSpecName().length() > 0) {
            throw new JMSBindingException("[BJM30023] response/activationSpec element MUST NOT be present when the binding is being used for an SCA service");
        }
       
        // Set the default destination when using a connection factory.
        // If an activation spec is being used, do not set the destination
        // because the activation spec provides the destination.
View Full Code Here

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

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

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

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

            Constructor<?> constructor = clazz.getDeclaredConstructor(new Class[] {JMSBinding.class});
            instance = constructor.newInstance(binding);

        } catch (Throwable e) {
            throw new JMSBindingException("Exception instantiating OperationAndDataBinding class", e);
        }

        return instance;
    }
View Full Code Here

            Constructor<?> constructor = clazz.getDeclaredConstructor(new Class[] {JMSBinding.class, ExtensionPointRegistry.class});
            instance = constructor.newInstance(binding, registry);

        } catch (Throwable e) {
            throw new JMSBindingException("Exception instantiating OperationAndDataBinding class", e);
        }

        return instance;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.jms.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.