Examples of JMSCondition


Examples of org.jboss.jms.server.JMSCondition

               ids.add(new Long(info.getMessageID()));
            }
           
            Queue queue = binding.getQueue();
           
            JMSCondition cond = (JMSCondition)binding.getCondition();                       
           
            ManagedDestination dest =
               sp.getDestinationManager().getDestination(cond.getName(), cond.isQueue());
           
            if (dest == null)
            {
               throw new IllegalStateException("Cannot find managed destination with name " +
                  cond.getName() + " isQueue" + cond.isQueue());
            }
           
            Queue dlqToUse =
               dest.getDLQ() == null ? defaultDLQ : dest.getDLQ();
           
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

                                  sp.getDefaultMessageCounterHistoryDayLimit());
           
            sp.getMessageCounterManager().registerMessageCounter(counterName, counter);
                                
            // make a binding for this queue
            postOffice.bindQueue(new JMSCondition(true, dest.getName()), coreQueue);
         }        
      }
      catch (Throwable t)
      {
         throw ExceptionUtil.handleJMSInvocation(t, this + " addTemporaryDestination");
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

         }
         else
         {
            //Topic           
            Collection bindings =
               postOffice.getBindingsForCondition(new JMSCondition(false, dest.getName()));
           
            if (!bindings.isEmpty())
            {
               throw new IllegalStateException("Cannot delete temporary destination, " +
                  "since it has active consumer(s)");
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

                                            subscriptionName + " since it has active subscribers");
         }
        
         //Look up the topic
        
         JMSCondition topicCond = (JMSCondition)binding.getCondition();
        
         String topicName = topicCond.getName();
        
         ManagedDestination mDest = dm.getDestination(topicName, false);
        
         //Unbind it
   
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

         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)
            {
               throw new JMSException("Cannot create durable subscriber without a valid client ID");
            }
           
            // See if there any bindings with the same client_id.subscription_name name
           
            String name = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);
           
            binding = postOffice.getBindingForQueueName(name);
           
            if (binding == null)
            {
               // Does not already exist
              
               if (trace) { log.trace(this + " creating new durable subscription on " + jmsDestination); }
                             
               PagingFilteredQueue q;

               if (postOffice.isLocal())
               {
                  q = new PagingFilteredQueue(name, idm.getID(), ms, pm, true, true,
                                              mDest.getMaxSize(), selector,
                                              mDest.getFullSize(),
                                              mDest.getPageSize(),
                                              mDest.getDownCacheSize());

                  binding = postOffice.bindQueue(topicCond, q);
               }
               else
               {
                  q = new LocalClusteredQueue((ClusteredPostOffice)postOffice, nodeId, name, idm.getID(),
                                              ms, pm, true, true,
                                              mDest.getMaxSize(), selector, tr,
                                              mDest.getFullSize(),
                                              mDest.getPageSize(),
                                              mDest.getDownCacheSize());
                 
                  ClusteredPostOffice cpo = (ClusteredPostOffice)postOffice;
                 
                  if (mDest.isClustered())
                  {
                     binding = cpo.bindClusteredQueue(topicCond, (LocalClusteredQueue)q);
                  }
                  else
                  {
                     binding = cpo.bindQueue(topicCond, q);
                  }
               }
               String counterName = TopicService.SUBSCRIPTION_MESSAGECOUNTER_PREFIX + q.getName();
                      
               MessageCounter counter =
                  new MessageCounter(counterName, subscriptionName, q, true, true,
                                     mDest.getMessageCounterHistoryDayLimit());
              
               sp.getMessageCounterManager().registerMessageCounter(counterName, counter);
            }
            else
            {
               //Durable sub already exists
              
               if (trace) { log.trace(this + " subscription " + subscriptionName + " already exists"); }
              
               // From javax.jms.Session Javadoc (and also JMS 1.1 6.11.1):
               // A client can change an existing durable subscription by creating a durable
               // TopicSubscriber with the same name and a new topic and/or message selector.
               // Changing a durable subscriber is equivalent to unsubscribing (deleting) the old
               // one and creating a new one.
              
               String filterString =
                  binding.getQueue().getFilter() != null ?
                     binding.getQueue().getFilter().getFilterString() : null;
              
               boolean selectorChanged =
                  (selectorString == null && filterString != null) ||
                  (filterString == null && selectorString != null) ||
                  (filterString != null && selectorString != null &&
                           !filterString.equals(selectorString));
              
               if (trace) { log.trace("selector " + (selectorChanged ? "has" : "has NOT") + " changed"); }
              
               JMSCondition cond = (JMSCondition)binding.getCondition();
              
               boolean topicChanged = !cond.getName().equals(jmsDestination.getName());
              
               if (log.isTraceEnabled()) { log.trace("topic " + (topicChanged ? "has" : "has NOT") + " changed"); }
              
               if (selectorChanged || topicChanged)
               {
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

            ref.setScheduledDeliveryTime(schedDeliveryTime);
         }
        
         if (dest.isQueue())
         {
            if (!postOffice.route(ref, new JMSCondition(true, dest.getName()), tx))
            {
               throw new JMSException("Failed to route " + ref + " to " + dest.getName());
            }
         }
         else
         {
            postOffice.route(ref, new JMSCondition(false, dest.getName()), tx);  
         }
      }
      finally
      {
         if (ref != null)
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

      super(name, fullSize, pageSize, downCacheSize);          
   }

   public void removeAllMessages() throws Throwable
   {
      JMSCondition topicCond = new JMSCondition(false, name);
     
      Collection subs = serverPeer.getPostOfficeInstance().getBindingsForCondition(topicCond);
     
      //XXX How to lock down all subscriptions?
      Iterator iter = subs.iterator();
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

      return getMessageCount(NON_DURABLE);
   }
  
   public int getAllSubscriptionsCount() throws Exception
   {
      JMSCondition topicCond = new JMSCondition(false, name);
     
      Collection subs = serverPeer.getPostOfficeInstance().getBindingsForCondition(topicCond);
     
      return subs.size();        
   }
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

      return listMessages(NON_DURABLE, subId, selector);
   }
  
   public List getMessageCounters() throws Exception
   {
      JMSCondition topicCond = new JMSCondition(false, name);
     
      List counters = new ArrayList();
     
      // We deploy any queues corresponding to pre-existing durable subscriptions
      Collection bindings = serverPeer.getPostOfficeInstance().getBindingsForCondition(topicCond);
View Full Code Here

Examples of org.jboss.jms.server.JMSCondition

  
   private List listSubscriptions(int type) throws Exception
   {     
      List subs = new ArrayList();
  
      JMSCondition topicCond = new JMSCondition(false, name);     
     
      Collection bindings = serverPeer.getPostOfficeInstance().getBindingsForCondition(topicCond);
     
      Iterator iter = bindings.iterator();
     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.