Package org.jboss.messaging.core.contract

Examples of org.jboss.messaging.core.contract.Condition


                                     idm.getID(), ms, pm, false, -1, null,
                                       fullSize, pageSize, downCacheSize, postOffice.isClustered(),
                                       sp.getRecoverDeliveriesTimeout());


            Condition cond = new JMSCondition(true, dest.getName());

           // make a binding for this temporary queue

            // temporary queues need to bound on ALL nodes of the cluster
            postOffice.addBinding(new Binding(cond, coreQueue, true), postOffice.isClustered());
View Full Code Here


    *
    * @throws Exception if the post office can't be reached.
    */
   private void setMaxSizeForQueues() throws Exception
   {
      Condition cond = new JMSCondition(isQueue(), this.getName());
      PostOffice postOffice = serverPeer.getPostOfficeInstance();
      Collection subs = postOffice.getQueuesForCondition(cond, true);
      Iterator iter = subs.iterator();
      while (iter.hasNext())
      {
View Full Code Here

    *
    * @throws Exception if the post office can't be reached.
    */
   private void setMaxSizeForQueues() throws Exception
   {
      Condition cond = new JMSCondition(isQueue(), this.getName());
      PostOffice postOffice = serverPeer.getPostOfficeInstance();
      Collection subs = postOffice.getQueuesForCondition(cond, true);
      Iterator iter = subs.iterator();
      while (iter.hasNext())
      {
View Full Code Here

                                     idm.getID(), ms, pm, false, -1, null,
                                       fullSize, pageSize, downCacheSize, postOffice.isClustered(),
                                       sp.getRecoverDeliveriesTimeout());


            Condition cond = new JMSCondition(true, dest.getName());

           // make a binding for this temporary queue

            // temporary queues need to bound on ALL nodes of the cluster
            postOffice.addBinding(new Binding(cond, coreQueue, true), postOffice.isClustered());
View Full Code Here

                  Queue queue = new MessagingQueue(thisNodeID, queueName, channelID, ms, pm,
                                                   true, filter, bindingClustered && clustered);

                  if (trace) { log.trace(this + " loaded binding from storage: " + queueName); }
                 
                  Condition condition = conditionFactory.createCondition(conditionText);

                  Binding binding = new Binding(condition, queue, allNodes);

                  bindings.put(queueName, binding);
               }
View Full Code Here

         }
        
         Queue queue = new MessagingQueue(mapping.getNodeId(), mapping.getQueueName(), mapping.getChannelId(),
                                          mapping.isRecoverable(), filter, true);
        
         Condition condition = conditionFactory.createCondition(mapping.getConditionText());
        
         addBindingInMemory(new Binding(condition, queue, false));
        
         if (mapping.isAllNodes())
         {
View Full Code Here

      }
     
      Queue queue = new MessagingQueue(mapping.getNodeId(), mapping.getQueueName(), mapping.getChannelId(),
                                       mapping.isRecoverable(), filter, mapping.isClustered());
     
      Condition condition = conditionFactory.createCondition(mapping.getConditionText());
     
      //addBindingInMemory(new Binding(condition, queue, mapping.isAllNodes()));
      addBindingInMemory(new Binding(condition, queue, false));
     
      if (allNodes)
View Full Code Here

   public void routeFromCluster(Message message, String routingKeyText, Set queueNames) throws Exception
   {
      if (trace) { log.trace(this + " routing from cluster " + message + ", routing key " + routingKeyText + ", queue names " + queueNames); }

      Condition routingKey = conditionFactory.createCondition(routingKeyText);

      MessageReference ref = message.createReference();
        
      routeInternal(ref, routingKey, null, true, queueNames);       
   }
View Full Code Here

     if (binding == null)
      {
         throw new IllegalArgumentException("Binding is null");
      }
    
     Condition condition = binding.condition;
    
     Queue queue = binding.queue;
    
     if (queue == null)
      {
         throw new IllegalArgumentException("Queue is null");
      }
    
     if (queue.getNodeID() != thisNodeID)
     {
       throw new IllegalArgumentException("Cannot bind a queue from another node");
     }

      if (condition == null)
      {
         throw new IllegalArgumentException("Condition is null");
      }
          
     //The binding might already exist - this could happen if the queue is bind all simultaneously from more than one node of the cluster
      boolean added = addBindingInMemory(binding);   
     
      if (added)
      {
        if (queue.isRecoverable())
        {
          // Need to write the mapping to the database
          insertBindingInStorage(condition, queue, binding.allNodes);
        }
       
        if (clustered && queue.isClustered())
         {
           String filterString = queue.getFilter() == null ? null : queue.getFilter().getFilterString();       
          
           MappingInfo info = new MappingInfo(thisNodeID, queue.getName(), condition.toText(), filterString, queue.getChannelID(),
                                            queue.isRecoverable(), true,
                                            binding.allNodes,
                                            queue.getFullSize(), queue.getPageSize(), queue.getDownCacheSize(),
                                            queue.getMaxSize(),
                                            queue.getRecoverDeliveriesTimeout());
View Full Code Here

      //The queue might not be removed (it's already removed) if two unbind all requests are sent simultaneously on the cluster
      if (removed != null)
      {
        Queue queue = removed.queue;

        Condition condition = removed.condition;

        if (queue.isRecoverable())
        {
           //Need to remove from db too

           deleteBindingFromStorage(queue);
        }

        if (clustered && queue.isClustered())
        {
          String filterString = queue.getFilter() == null ? null : queue.getFilter().getFilterString();

          MappingInfo info = new MappingInfo(thisNodeID, queue.getName(), condition.toText(), filterString, queue.getChannelID(),
                                           queue.isRecoverable(), true, allNodes);

          UnbindRequest request = new UnbindRequest(info, allNodes);

          groupMember.multicastControl(request, sync);
View Full Code Here

TOP

Related Classes of org.jboss.messaging.core.contract.Condition

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.