Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.MessagingException


            throws MessagingException {
        if (fedoraTypes == null) {
            try {
                fedoraTypes = new FedoraTypes();
            } catch (FileNotFoundException e) {
                throw new MessagingException(e.getMessage(), e);
            } catch (DocumentException e) {
                throw new MessagingException(e.getMessage(), e);
            }
        }
        this.method = method.getMethod();
        this.args = method.getParameters();
        returnVal = method.getReturnValue();
View Full Code Here


            jmsMessage.setStringProperty("methodName", method.getName());
            if(method.getPID() != null) {
                jmsMessage.setStringProperty("pid", method.getPID().toString());
            }
        } catch(JMSException jmse) {
            throw new MessagingException("Unable to set message properties.", jmse);
        }
        jmsMgr.send(destName, jmsMessage);
    }
View Full Code Here

                providerUrl = (String) jndiLookup(Context.PROVIDER_URL);
            } catch (MessagingException me) {
                providerUrl = null;
            }
            if(providerUrl == null) {
                throw new MessagingException("JMS connection properties must either be "
                        + "provided by the container or by a non-null properties file "
                        + "containing, at minimum, a value for "
                        + Context.INITIAL_CONTEXT_FACTORY + " and "
                        + Context.PROVIDER_URL + ".");
            }
        } else {
            String icf = jndiProps.getProperty(Context.INITIAL_CONTEXT_FACTORY);
            if (icf == null) {
                throw new MessagingException("A value for "
                        + Context.INITIAL_CONTEXT_FACTORY
                        + " must be included in the JNDI properties.");
            }

            String pUrl = jndiProps.getProperty(Context.PROVIDER_URL);
            if (pUrl == null) {
                throw new MessagingException("A value for "
                        + Context.PROVIDER_URL
                        + "must be included in the JNDI properties.");
            }
        }
View Full Code Here

        // Create the new destination and store it
        Session session;
        try {
            session = connection.createSession(fTransacted, ackMode);
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        // Look up the destination otherwise create it
        Destination destination = null;
        try {
            destination = (Destination) jndiLookup(name);
        } catch (MessagingException me) {
            logger.debug("JNDI lookup for destination " + name + " failed. "
                    + "Destination must be created.");
            destination = null;
        }
        if (destination == null) {
            // Create a topic or queue as specified
            try {
                if (type.equals(DestinationType.Queue)) {
                    logger.debug("setupDestination() - creating Queue" + name);
                    destination = session.createQueue(name);
                } else {
                    logger.debug("setupDestination() - creating Topic " + name);
                    destination = session.createTopic(name);
                }
            } catch (JMSException e) {
                throw new MessagingException(e.getMessage(), e);
            }
        }

        jmsDest = new JMSDestination(destination, session, null, null);
View Full Code Here

            MessageConsumer c = s.createConsumer(dest, messageSelector);
            Message msg = c.receive();
            s.close();
            return msg;
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }
    }
View Full Code Here

            Session s =
                    connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageConsumer c = s.createConsumer(dest, messageSelector);
            c.setMessageListener(callback);
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        if (logger.isDebugEnabled()) {
            logger.debug("listen() - Asynchronous listen on destination " + dest);
        }
View Full Code Here

                                String subscriptionName)
            throws MessagingException {
        try {
            String clientId = connection.getClientID();
            if (clientId == null) {
                throw new MessagingException("A non-null client ID must be provided upon "
                        + "creation of a JMSManager in order to create a JMS connection "
                        + "capable of creating durable subscriptions.");
            }
            if (subscriptionName == null) {
                subscriptionName = topic.getTopicName();
            }

            Session s =
                    connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageConsumer c =
                    s.createDurableSubscriber(topic, subscriptionName, messageSelector, false);
            c.setMessageListener(callback);
            durableSubscriptions.put(subscriptionName, c);
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        if (logger.isDebugEnabled()) {
            logger.debug("listen() - Asynchronous durable listen on topic " + topic);
        }
View Full Code Here

        // Send the message for this destination
        try {
            jmsDest.producer.send(msg);
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        if(logger.isDebugEnabled()) {
            logger.debug("send() - message sent to destination " + destName);
        }
View Full Code Here

                    connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageProducer p = s.createProducer(dest);
            p.send(msg);
            s.close();
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        if(logger.isDebugEnabled()) {
            logger.debug("send() - message sent to destination " + dest);
        }
View Full Code Here

        // Send the message for this destination
        try {
            Message msg = createJMSMessage(obj, jmsDest.session);
            jmsDest.producer.send(msg);
        } catch (JMSException e) {
            throw new MessagingException(e.getMessage(), e);
        }

        if(logger.isDebugEnabled()) {
            logger.debug("send() - message sent to destination " + destName);
        }
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.