Package org.exolab.jms.client

Examples of org.exolab.jms.client.JmsDestination


     */
    public void displayConnections() {
        Enumeration e = AbstractAdminConnection.instance().getAllDestinations();
        if (e != null) {
            while (e.hasMoreElements()) {
                JmsDestination destination = (JmsDestination) e.nextElement();
                if (destination instanceof JmsQueue) {
                    add(new OpenJMSQueue(destination.getName(), tree_));
                } else if (destination instanceof JmsTopic) {
                    add(new OpenJMSTopic(destination.getName(), tree_));
                }
            }
        }
        //Users
        e = AbstractAdminConnection.instance().getAllUsers();
View Full Code Here


                    } else if (wrapper.isReceivedMessage()) {
                        ReceivedMessageWrapper rmsg_wrapper =
                                (ReceivedMessageWrapper) wrapper;
                        MessageHandle handle =
                                (MessageHandle) rmsg_wrapper.getObject();
                        JmsDestination dest = handle.getDestination();
                        DestinationCache cache =
                                _destinations.getDestinationCache(dest);
                        cache.returnMessageHandle(handle);
                    }
                } else {
View Full Code Here

     * @throws JMSException if the message cannot be added
     */
    public void add(MessageImpl message) throws JMSException {
        prepare(message);

        JmsDestination destination =
                (JmsDestination) message.getJMSDestination();
        final JmsDestination existing
                = _destinations.getDestination(destination.getName());
        final boolean persistent = (existing != null)
                ? existing.getPersistent() : false;

        try {
            _database.begin(); // need a transaction for any database access

            // if the message's delivery mode is PERSISTENT, and the destination
View Full Code Here

     */
    private void addNonPersistentMessage(MessageImpl message)
            throws JMSException {

        // notify the listener for the destination
        JmsDestination destination
                = (JmsDestination) message.getJMSDestination();

        MessageManagerEventListener listener = getEventListener(destination);
        listener.messageAdded(destination, message);
    }
View Full Code Here

     * @throws JMSException if the message cannot be processed
     * @throws PersistenceException for any persistence error
     */
    private void addPersistentMessage(MessageImpl message)
            throws JMSException, PersistenceException {
        JmsDestination destination =
                (JmsDestination) message.getJMSDestination();

        Connection connection = _database.getConnection();

            // add the message to the database
View Full Code Here

            insert.setLong(6, message.getJMSExpiration());
            insert.setInt(7, message.getJMSPriority());
            insert.setBoolean(8, message.getJMSRedelivered());
            long replyToId = 0;
            if (message.getJMSReplyTo() != null) {
                JmsDestination replyTo =
                        (JmsDestination) message.getJMSReplyTo();
                replyToId = _destinations.getId(replyTo);
            }
            insert.setLong(9, replyToId);
            insert.setLong(10, message.getJMSTimestamp());
View Full Code Here

            // Create an endpoint for each durable consumer
            while (iter.hasNext()) {
                String consumer = (String) iter.next();
                String deststr = (String) map.get(consumer);

                JmsDestination dest = _destinations.getDestination(deststr);
                if (dest == null) {
                    // this maybe a wildcard subscription
                    dest = new JmsTopic(deststr);
                    if (!((JmsTopic) dest).isWildCard()) {
                        dest = null;
View Full Code Here

            _log.debug("removeConsumerEntry(key=" + key + ")");
        }

        ConsumerEntry entry = (ConsumerEntry) _consumers.remove(key);
        if (entry != null) {
            JmsDestination dest = entry.getDestination();

            if (dest instanceof JmsTopic && ((JmsTopic) dest).isWildCard()) {
                // remove it from the wildcard cache.
                _wildcardConsumers.remove(entry);
            } else {
View Full Code Here

     */
    private JmsDestination getDestination(JmsDestination destination,
                                          boolean create)
            throws InvalidDestinationException, JMSException {
        final String name = destination.getName();
        JmsDestination result;
        JmsDestination existing = _destinations.getDestination(name);

        if (existing == null) {
            if (!create) {
                throw new InvalidDestinationException(
                        "No destination with name=" + name + " exists");
            }
            // register the destination dynamically.
            _destinations.createDestination(destination);
            result = _destinations.getDestination(destination.getName());
        } else {
            // make sure the supplied destination has the same properties
            // as the existing one
            if (!destination.getClass().getName().equals(
                    existing.getClass().getName())) {
                throw new InvalidDestinationException(
                        "Mismatched destination properties for destination"
                        + " with name=" + name);
            }
            if (existing.getPersistent() != destination.getPersistent()) {
                throw new InvalidDestinationException(
                        "Mismatched destination properties for destination"
                        + " with name=" + name);
            }
            result = existing;
View Full Code Here

        PreparedStatement select = null;
        ResultSet set = null;
        Vector messages = new Vector();

        try {
            JmsDestination dest = _destinations.get(destination);
            if (dest == null) {
                throw new PersistenceException(
                    "Cannot getMessages for destination=" + destination
                    + ": destination does not exist");
            }
View Full Code Here

TOP

Related Classes of org.exolab.jms.client.JmsDestination

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.