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

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


            }
           
            return message;

        } 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

        Destination dest = jmsResourceFactory.lookupDestination(queueName);

        if (qCreateMode.equals(JMSBindingConstants.CREATE_ALWAYS)) {
            // In this mode, the queue must not already exist as we are creating it
            if (dest != null) {
                throw new JMSBindingException(queueType + queueName
                    + " already exists but has create mode of \""
                    + qCreateMode
                    + "\" while registering binding "
                    + jmsBinding.getName()
                    + " invoker");
            }
            // Create the queue
            dest = jmsResourceFactory.createDestination(queueName);

        } else if (qCreateMode.equals(JMSBindingConstants.CREATE_IF_NOT_EXIST)) {
            // In this mode, the queue may nor may not exist. It will be created if it does not exist
            if (dest == null) {
                dest = jmsResourceFactory.createDestination(queueName);
            }

        } else if (qCreateMode.equals(JMSBindingConstants.CREATE_NEVER)) {
            // In this mode, the queue must have already been created.
            if (dest == null) {
                throw new JMSBindingException(queueType + queueName
                    + " not found but create mode of \""
                    + qCreateMode
                    + "\" while registering binding "
                    + jmsBinding.getName()
                    + " invoker");
            }
        }

        // Make sure we ended up with a queue
        if (dest == null) {
            throw new JMSBindingException(queueType + queueName
                + " not found with create mode of \""
                + qCreateMode
                + "\" while registering binding "
                + jmsBinding.getName()
                + " invoker");
View Full Code Here

                }
            }
           
            return tuscanyMsg;
        } catch (Exception e) {
            throw new JMSBindingException(e);
        }  
    }
View Full Code Here

        String opSelectorPropertyName = operationSelector.getPropertyName();
       
        try {
            operationName = jmsMsg.getStringProperty(opSelectorPropertyName);
        } catch(JMSException e) {
            throw new JMSBindingException(e);
        }
       
        if (operationName == null){
            throw new JMSBindingException("Property " + opSelectorPropertyName + " not found in message header");
        }
       
        for (Operation op : serviceOperations) {
            if (op.getName().equals(operationName)) {
                return op;
            }
        }
       
        throw new JMSBindingException("Can't find operation " + operationName);
    }
View Full Code Here

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

                        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

              context.setTimeToLive(JMSBindingConstants.DEFAULT_TIME_TO_LIVE);       
            }            
           
            return tuscanyMsg;
        } catch (JMSException e) {
            throw new JMSBindingException(e);
        }
    }
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

           
            requestMsg.setJMSReplyTo(context.getReplyToDestination());
           
            return msg;
        } 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.