Package javax.jms

Examples of javax.jms.InvalidDestinationException


         destination.setJndiName(jndiName);
        
         try
         {
            initialContext.lookup(jndiName);
            throw new InvalidDestinationException("Destination " + destination.getName() + " already exists");
         }
         catch(NameNotFoundException e)
         {
            // OK
         }     
View Full Code Here


         {
            throw new IllegalStateException("Session is closed");
         }
         if (subscriptionName == null)
         {
            throw new InvalidDestinationException("Destination is null");
         }

         String clientID = connectionEndpoint.getClientID();

         if (clientID == null)
         {
            throw new JMSException("null clientID on connection");
         }

         String queueName = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);

         Binding binding = postOffice.getBindingForQueueName(queueName);

         if (binding == null)
         {
            throw new InvalidDestinationException("Cannot find durable subscription with name " +
                                                  subscriptionName + " to unsubscribe");
         }

         Queue sub = binding.queue;
View Full Code Here

   void validateDestination(JBossDestination jmsDestination)
           throws InvalidDestinationException
   {
      if (dm.getDestination(jmsDestination.getName(), jmsDestination.isQueue()) == null)
      {
         throw new InvalidDestinationException("No such destination: " + jmsDestination);
      }
   }
View Full Code Here

      ManagedDestination mDest = dm.getDestination(jmsDestination.getName(), jmsDestination.isQueue());

      if (mDest == null)
      {
         throw new InvalidDestinationException("No such destination: " + jmsDestination + " has it been deployed?");
      }

      if (jmsDestination.isTemporary())
      {
         // Can only create a consumer for a temporary destination on the same connection
         // that created it
         if (!connectionEndpoint.hasTemporaryDestination(jmsDestination))
         {
            String msg = "Cannot create a message consumer on a different connection " +
                         "to that which created the temporary destination";
            throw new IllegalStateException(msg);
         }
      }

      String consumerID = GUIDGenerator.generateGUID();

      // Always validate the selector first
      Selector selector = null;

      if (selectorString != null)
      {
         selector = new Selector(selectorString);
      }

      Queue queue;

      if (jmsDestination.isTopic())
      {
         if (subscriptionName == null)
         {
            // non-durable subscription
            if (log.isTraceEnabled()) { log.trace(this + " creating new non-durable subscription on " + jmsDestination); }

            // Create the non durable sub

            queue = new MessagingQueue(nodeId, GUIDGenerator.generateGUID(),
                                idm.getID(), ms, pm, false,
                                mDest.getMaxSize(), selector,
                                mDest.getFullSize(),
                                mDest.getPageSize(),
                                mDest.getDownCacheSize(),
                                mDest.isClustered(),
                                sp.getRecoverDeliveriesTimeout());

            JMSCondition topicCond = new JMSCondition(false, jmsDestination.getName());

            postOffice.addBinding(new Binding(topicCond, queue, false), false);

            queue.activate();

            String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();

            int dayLimitToUse = mDest.getMessageCounterHistoryDayLimit();
            if (dayLimitToUse == -1)
            {
               //Use override on server peer
               dayLimitToUse = sp.getDefaultMessageCounterHistoryDayLimit();
            }

            //We don't create message counters on temp topics
            if (!mDest.isTemporary())
            {
              MessageCounter counter =  new MessageCounter(counterName, null, queue, true, false, dayLimitToUse);

              sp.getMessageCounterManager().registerMessageCounter(counterName, counter);
            }
         }
         else
         {
            if (jmsDestination.isTemporary())
            {
               throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
            }

            // We have a durable subscription, look it up
            String clientID = connectionEndpoint.getClientID();
            if (clientID == null)
View Full Code Here

         throw new IllegalStateException("Session is closed");
      }

      if (jmsDestination == null)
      {
         throw new InvalidDestinationException("null destination");
      }

      if (jmsDestination.isTopic())
      {
         throw new IllegalStateException("Cannot browse a topic");
View Full Code Here

         {
            throw new IllegalStateException("Session is closed");
         }
         if (!dest.isTemporary())
         {
            throw new InvalidDestinationException("Destination:" + dest +
               " is not a temporary destination");
         }

         connectionEndpoint.addTemporaryDestination(dest);
View Full Code Here

            throw new IllegalStateException("Session is closed");
         }

         if (!dest.isTemporary())
         {
            throw new InvalidDestinationException("Destination:" + dest +
                                                  " is not a temporary destination");
         }

         ManagedDestination mDest = dm.getDestination(dest.getName(), dest.isQueue());

         if (mDest == null)
         {
            throw new InvalidDestinationException("No such destination: " + dest);
         }

         if (dest.isQueue())
         {
           Binding binding = postOffice.getBindingForQueueName(dest.getName());
View Full Code Here

         {
            throw new IllegalStateException("Session is closed");
         }
         if (subscriptionName == null)
         {
            throw new InvalidDestinationException("Destination is null");
         }

         String clientID = connectionEndpoint.getClientID();

         if (clientID == null)
         {
            throw new JMSException("null clientID on connection");
         }

         String queueName = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);

         Binding binding = postOffice.getBindingForQueueName(queueName);

         if (binding == null)
         {
            throw new InvalidDestinationException("Cannot find durable subscription with name " +
                                                  subscriptionName + " to unsubscribe");
         }

         Queue sub = binding.queue;
View Full Code Here

   void validateDestination(JBossDestination jmsDestination)
           throws InvalidDestinationException
   {
      if (dm.getDestination(jmsDestination.getName(), jmsDestination.isQueue()) == null)
      {
         throw new InvalidDestinationException("No such destination: " + jmsDestination);
      }
   }
View Full Code Here

      ManagedDestination mDest = dm.getDestination(jmsDestination.getName(), jmsDestination.isQueue());

      if (mDest == null)
      {
         throw new InvalidDestinationException("No such destination: " + jmsDestination + " has it been deployed?");
      }

      if (jmsDestination.isTemporary())
      {
         // Can only create a consumer for a temporary destination on the same connection
         // that created it
         if (!connectionEndpoint.hasTemporaryDestination(jmsDestination))
         {
            String msg = "Cannot create a message consumer on a different connection " +
                         "to that which created the temporary destination";
            throw new IllegalStateException(msg);
         }
      }

      String consumerID = GUIDGenerator.generateGUID();

      // Always validate the selector first
      Selector selector = null;

      if (selectorString != null)
      {
         selector = new Selector(selectorString);
      }

      Queue queue;

      if (jmsDestination.isTopic())
      {
         if (subscriptionName == null)
         {
            // non-durable subscription
            if (log.isTraceEnabled()) { log.trace(this + " creating new non-durable subscription on " + jmsDestination); }

            // Create the non durable sub

            queue = new MessagingQueue(nodeId, GUIDGenerator.generateGUID(),
                                idm.getID(), ms, pm, false,
                                mDest.getMaxSize(), selector,
                                mDest.getFullSize(),
                                mDest.getPageSize(),
                                mDest.getDownCacheSize(),
                                mDest.isClustered(),
                                sp.getRecoverDeliveriesTimeout());

            JMSCondition topicCond = new JMSCondition(false, jmsDestination.getName());

            postOffice.addBinding(new Binding(topicCond, queue, false), false);

            queue.activate();

            String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + queue.getName();

            int dayLimitToUse = mDest.getMessageCounterHistoryDayLimit();
            if (dayLimitToUse == -1)
            {
               //Use override on server peer
               dayLimitToUse = sp.getDefaultMessageCounterHistoryDayLimit();
            }

            //We don't create message counters on temp topics
            if (!mDest.isTemporary())
            {
              MessageCounter counter =  new MessageCounter(counterName, null, queue, true, false, dayLimitToUse);

              sp.getMessageCounterManager().registerMessageCounter(counterName, counter);
            }
         }
         else
         {
            if (jmsDestination.isTemporary())
            {
               throw new InvalidDestinationException("Cannot create a durable subscription on a temporary topic");
            }

            // We have a durable subscription, look it up
            String clientID = connectionEndpoint.getClientID();
            if (clientID == null)
View Full Code Here

TOP

Related Classes of javax.jms.InvalidDestinationException

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.