Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.MessagingException


                                                       messageSelector);
            }

            jmsDest.consumer.setMessageListener(callback);
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }
    }
View Full Code Here


            if (timeout > 0)
                return jmsDest.consumer.receive(timeout);
            else
                return jmsDest.consumer.receive();
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }
    }
View Full Code Here

                connectionFactoryName = defaultConnectionFactoryName;
            }
            connectionFactory =
                    (ConnectionFactory) jndiLookup(connectionFactoryName);
        } else {
            throw new MessagingException("Unable to create JMS connection "
                    + "because JNDI properties were not initialized.");
        }

        try {
            connection = connectionFactory.createConnection();
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }
        return connection;
    }
View Full Code Here

        }

        try {
            return jndi.lookup(name);
        } catch (NamingException e) {
            throw new MessagingException("jndiLookup(" + name + ") failed: "
                                         + e.getMessage(), e);
        }
    }
View Full Code Here

                logger.debug("----------------");
            }
            return envCtx;
        } catch (Exception e) {
            logger.error("getContext() failed with: " + e.getMessage());
            throw new MessagingException(e.getMessage(), e);
        }
    }
View Full Code Here

                              boolean durable)
            throws MessagingException {

        // Check for a null listener
        if (listener == null) {
            throw new MessagingException("MessageListener may not be null");
        }

        // Check for null properties
        if (connectionProperties == null) {
            throw new MessagingException("Connection properties may not be null");
        }

        // Check for required property values
        String initialContextFactory =
            connectionProperties.getProperty(Context.INITIAL_CONTEXT_FACTORY);
        String providerUrl =
            connectionProperties.getProperty(Context.PROVIDER_URL);
        String connectionFactoryName =
            connectionProperties.getProperty(JMSManager.CONNECTION_FACTORY_NAME);

        if (initialContextFactory == null
            || providerUrl == null
            || connectionFactoryName == null) {
            throw new MessagingException("Propery values for "
                    + "'java.naming.factory.initial', "
                    + "'java.naming.provider.url', and"
                    + "'connection.factory.name' must be provided "
                    + "in order to initialize a messaging client");
        }

        // Check for valid client ID if durable subscriptions are required
        if (durable) {
            if (clientId == null || clientId.equals("")) {
                throw new MessagingException("ClientId must be "
                        + "specified for durable subscriptions");
            }
        }

        m_clientId = clientId;
View Full Code Here

                        waitTime += 100;
                    } catch (InterruptedException ie) {
                        Thread.currentThread().interrupt();
                    }
                } else {
                    throw new MessagingException("Timeout reached waiting " +
                                           "for messaging client to start.");
                }
            }
        }
    }
View Full Code Here

            // Get destination list
            List<Destination> destinations = m_jmsManager.getDestinations();

            // If there are no Destinations, throw an exception
            if (destinations.size() == 0) {
                throw new MessagingException("No destinations available for "
                        + "subscription, make sure that there is at least one topic "
                        + "or queue specified in the connection properties.");
            }

            // Subscribe
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.MessagingException

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.