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

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


    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

            } 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

            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

        try {
          responseJMSMsg.setStringProperty(JMSBindingConstants.DEFAULT_OPERATION_PROP_NAME, msg.getOperation().getName());
        } catch (JMSException e) {
          // Not sure what to do at this point.. it doesn't make sense to create a fault message.
          // Throwing a runtime exception for now. 
          throw new JMSBindingException(e);         
        }
       
        msg.setBody(responseJMSMsg);

        return msg;
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

                    callbackdestName = (replyTo instanceof Queue) ? ((Queue) replyTo).getQueueName() : ((Topic) replyTo).getTopicName();
                      }
                } else {
                    if (callbackdestName != null) {
                        if (!callbackdestName.startsWith("jms:jndi:")) {
                            throw new JMSBindingException("message property " + JMSBindingConstants.CALLBACK_Q_PROPERTY + " does not start with 'jms:jndi:' found: " + callbackdestName);
                        } else {
                            callbackdestName = callbackdestName.substring(9);
                        }
                    }
                }
               
                if (callbackdestName != null) {
                  List<EndpointReference> refs = endpoint.getCallbackEndpointReferences();
                  for (EndpointReference ref : refs ) {
                    if  (ref.getBinding() instanceof JMSBinding ) {
                      JMSBinding callbackBinding = (JMSBinding) ref.getBinding();
                      callbackBinding.setDestinationName(callbackdestName);
                    }
                  }
               } 

                String callbackID = jmsMsg.getStringProperty(JMSBindingConstants.CALLBACK_ID_PROPERTY);
                if (callbackID != null) {
//                    parameters.setCallbackID(callbackID);
                }
            }

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

    public Invoker createInvoker(Operation operation) {

        if (jmsBinding.getDestinationName() == null) {
//            if (!reference.isCallback()) { // TODO: 2.x migration, is this check needed?
                throw new JMSBindingException("No destination specified for reference " + reference.getName());
//            }
        }

        if ( jmsBinding.getActivationSpecName() != null ) {
          throw new JMSBindingException("Activation spec can not be specified on an SCA reference binding.");
        }
        Invoker invoker = null;
        invoker = new RRBJMSBindingInvoker(operation, jmsResourceFactory, endpointReference);
      
        return invoker;
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.