Package javax.jms

Examples of javax.jms.InvalidDestinationException


   */
  public static final void checkId(String id) throws InvalidDestinationException {
    try {
      DestinationConstants.checkId(id);
    } catch (Exception exc) {
      throw new InvalidDestinationException(exc.getMessage());
    }
  }
View Full Code Here


   * @exception IllegalStateException  If the connection is broken.
   * @exception JMSException  If the creation fails for any other reason.
   */
  QueueBrowser(Session sess, Queue queue, String selector) throws JMSException {
    if (queue == null)
      throw new InvalidDestinationException("Invalid queue: " + queue);
    queue.check();

    try {
      ClientSelector.checks(selector);
    } catch (org.objectweb.joram.shared.excepts.SelectorException sE) {
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())
         {
            //Unbind
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");
         }
        
         // Section 6.11. JMS 1.1.
         // "It is erroneous for a client to delete a durable subscription while it has an active
View Full Code Here

      ManagedDestination mDest = dm.
         getDestination(jmsDestination.getName(), jmsDestination.isQueue());
     
      if (mDest == null)
      {
         throw new InvalidDestinationException("No such destination: " + jmsDestination);
      }
     
      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);
         }
      }
     
      int consumerID = connectionEndpoint.getServerPeer().getNextObjectID();
     
      Binding binding = null;
     
      // Always validate the selector first
      Selector selector = null;
      if (selectorString != null)
      {
         selector = new Selector(selectorString);
      }
     
      if (jmsDestination.isTopic())
      {
         JMSCondition topicCond = new JMSCondition(false, jmsDestination.getName());
        
         if (subscriptionName == null)
         {
            // non-durable subscription
            if (log.isTraceEnabled()) { log.trace(this + " creating new non-durable subscription on " + jmsDestination); }
           
            // Create the non durable sub
                       
            PagingFilteredQueue q;
           
            if (postOffice.isLocal() || !mDest.isClustered())
            {
               q = new PagingFilteredQueue(new GUID().toString(), idm.getID(), ms, pm, true, false,
                        mDest.getMaxSize(), selector,
                        mDest.getFullSize(),
                        mDest.getPageSize(),
                        mDest.getDownCacheSize());
              
               binding = postOffice.bindQueue(topicCond, q);
            }
            else
           
               q = new LocalClusteredQueue((ClusteredPostOffice)postOffice, nodeId, new GUID().toString(),
                                           idm.getID(), ms, pm, true, false,
                                           mDest.getMaxSize(), selector, tr,
                                           mDest.getFullSize(),
                                           mDest.getPageSize(),
                                           mDest.getDownCacheSize());
              
               ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;

               binding = cpo.bindClusteredQueue(topicCond, (LocalClusteredQueue)q);
            }
            String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + q.getName();
 
            int dayLimitToUse = mDest.getMessageCounterHistoryDayLimit();
            if (dayLimitToUse == -1)
            {
               //Use override on server peer
               dayLimitToUse = sp.getDefaultMessageCounterHistoryDayLimit();
            }
           
            MessageCounter counter =
               new MessageCounter(counterName, null, q, 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");
      }

      if (dm.getDestination(jmsDestination.getName(), jmsDestination.isQueue()) == null)
      {
         throw new InvalidDestinationException("No such destination: " + jmsDestination);
      }

      log.debug(this + " creating browser for " + jmsDestination +
         (selector == null ? "" : ", selector '" + selector + "'"));
View Full Code Here

   public MessageProducer createProducer(Destination d) throws JMSException
   {
      if (d != null && !(d instanceof JBossDestination))
      {
         throw new InvalidDestinationException("Not a JBossDestination:" + d);
      }
          
      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();

      try
View Full Code Here

   public MessageConsumer createConsumer(Destination d, String messageSelector, boolean noLocal)
         throws JMSException
   {
      if (d == null)
      {
         throw new InvalidDestinationException("Cannot create a consumer with a null destination");
      }
      if (!(d instanceof JBossDestination))
      {
         throw new InvalidDestinationException("Not a JBossDestination:" + d);
      }

      log.debug("attempting to create consumer for destination:" + d + (messageSelector == null ? "" : ", messageSelector: " + messageSelector) + (noLocal ? ", noLocal = true" : ""));

      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();
View Full Code Here

      {
         throw new IllegalStateException("Cannot create a durable subscriber on a QueueSession");
      }
      if (topic == null)
      {
         throw new InvalidDestinationException("Cannot create a durable subscriber on a null topic");
      }
      if (!(topic instanceof JBossTopic))
      {
         throw new InvalidDestinationException("Not a JBossTopic:" + topic);
      }

      ThreadContextClassLoaderChanger tccc = new ThreadContextClassLoaderChanger();

      try
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.