Package org.jboss.soa.esb.couriers

Examples of org.jboss.soa.esb.couriers.CourierException


                }
                catch (Exception e)
                {
                        e.printStackTrace();
                       
                        throw new CourierException(e);
                }
        }
View Full Code Here


                        }
                        return new File(_localDir,name);
                }
                catch (Exception e)
                {
                        throw new CourierException(e);
                }
        }
View Full Code Here

                }
                catch (Exception e)
                {
                        e.printStackTrace();
                       
                        throw new CourierException(e);
                }
                finally
                {
                    handler.quit() ;
                }
View Full Code Here

                {
                        return false;
                }
                catch (Exception e)
                {
                        throw new CourierException(e);
                }
                finally
                {
                    handler.quit();
                }
View Full Code Here

                        {
                                rfs.setRemoteDir(_remoteDir);
                        }
                        catch (Exception e)
                        {
                                throw new CourierException(e);
                        }

                        return rfs;
                }
                catch (RemoteFileSystemException e)
                {
                        throw new CourierException(e);
                }
        }
View Full Code Here

            try {
                _messageProperties = Util.propertiesFromSelector(_epr
                        .getMessageSelector());
            }
            catch (Exception e) {
                throw new CourierException(e);
            }
        }
    } // ________________________________
View Full Code Here

        }
    }
   
    private boolean internalDeliver(javax.jms.Message message) throws CourierException, JmsConnectionFailureException, IllegalStateException {
        if (_isReceiver) {
            throw new CourierException("This is a read-only Courier");
        }

        if (null == message) {
            return false;
        }
        synchronized(this) {
            if (_messageProducer == null) {
                try {
                    createMessageProducer();
                } catch (final NamingContextException nce) {
                    throw new CourierServiceBindException("Unexpected exception attempting to access naming context pool", nce) ;
                }
            }
        }

        synchronized(this) {
            if (_messageProducer != null) {
                try {
                    for (KeyValuePair kvp : _messageProperties) {
                        String key = kvp.getKey();
                        if(message.getStringProperty(key) == null) {
                            message.setStringProperty(key, kvp.getValue());
                        }
                    }
                } catch (final JMSException e) {
                    throw new CourierTransportException("Caught exception initialising properties! ",e);
                }
                   
                try {
                    _messageProducer.send(message);
                   
                    return true;
                }
                catch (final JmsConnectionFailureException jcfe) {
                    throw jcfe ;
                }
                catch (final IllegalStateException ise) {
                    throw ise ;
                }
                catch (JMSException e) {
                    if (!jmsConnectRetry(e))
                        throw new CourierTransportException("Caught exception during delivery and could not reconnect! ",e);
                    try {
                        _messageProducer.send(message);
                       
                        return true;
                    } catch (final JMSException e2) {
                        throw new CourierTransportException("Caught exception during delivery having successfully recovered! ",e2);
                    } catch (Exception e2) {
                        throw new CourierException(e2);
                    }
                }
                catch (Exception e) {
                    throw new CourierException(e);
                }
            }
        }
        return false;
    } // ________________________________
View Full Code Here

                            }
                            catch (NamingException ne) {
                                destination = session.createTopic(destinationName);
                            }
                        } else {
                            throw new CourierException("Unknown destination type");
                        }
                        _messageProducer = session.createProducer(destination);
                        _messageProducer.setDeliveryMode(_epr.getPersistent()?DeliveryMode.PERSISTENT:DeliveryMode.NON_PERSISTENT);
                        if ( _logger.isDebugEnabled() )
                            _logger.debug("JMSCourier deliveryMode: " + _messageProducer.getDeliveryMode() + ", peristent:" + _epr.getPersistent());
                    } finally {
                        if (oJndiCtx != null) {
                            NamingContextPool.releaseNamingContext(oJndiCtx) ;
                        }
                    }
                }
                catch (final JmsConnectionFailureException jcfe) {
                    throw jcfe ;
                }
                catch (final IllegalStateException ise) {
                    throw ise ;
                }
                catch (JMSException ex) {
                    _logger.debug("Error from JMS system.", ex);

                    throw new CourierException(ex);
                }
            }
        }
    } // ________________________________
View Full Code Here

        }
    }
   
    private javax.jms.Message internalPickupPayload(long millis) throws CourierException, CourierTimeoutException, JmsConnectionFailureException, IllegalStateException {
        if (!_isReceiver)
            throw new CourierException("This is an outgoing-only Courier");
        if (millis < 1)
            throw new IllegalArgumentException("Timeout millis must be > 0");
            try {
                createMessageConsumer();
            }
        catch (Exception e) {
            try {
                Thread.sleep(1000); // TODO magic number
            }
            catch (InterruptedException eI) {/* OK do nothing */
            }
            throw new CourierException("Unable to create Message Consumer", e);
        }

        javax.jms.Message jmsMessage = null;
        synchronized(this) {
            if (null != _messageConsumer) {
View Full Code Here

                             }
                             catch (NamingException ne) {
                                   destination = session.createTopic(destinationName);
                             }
                        } else {
                            throw new CourierException("Unknown destination type");
                        }
                        if (destination == null) {
                            throw new CourierException("Could not locate destination: " + destinationName);
                        }
                       
                        String durableSubscriptionName = _epr.getDurableSubscriptionName();
                        if(durableSubscriptionName != null && destination instanceof Topic) {
                          _messageConsumer = session.createDurableSubscriber((Topic)destination, durableSubscriptionName, _epr.getMessageSelector(), false);
                        } else {
                            _messageConsumer = session.createConsumer(destination, _epr.getMessageSelector());
                        }
                       
                        success = true;
                    } finally {
                        NamingContextPool.releaseNamingContext(oJndiCtx) ;
                    }
                }
                catch (final JmsConnectionFailureException jcfe) {
                    throw jcfe ;
                }
                catch (final IllegalStateException ise) {
                    throw ise ;
                }
                catch (JMSException ex) {
                    _logger.debug("Error from JMS system.", ex);

                    throw new CourierException(ex);
                }
                finally {
                    if (!success) {
                        closeSession();
                    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.couriers.CourierException

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.