Package org.jboss.messaging.core.contract

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


      }
     
      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

      
       nameMap.put(queue.getName(), binding);
      
       channelIDMap.put(cid, binding);
             
       Condition condition = binding.condition;    
      
       List queues = (List)mappings.get(condition);
      
       if (queues == null)
       {
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

       
        while (iter.hasNext())
        {
          Map.Entry entry = (Map.Entry)iter.next();
         
          Condition condition = (Condition)entry.getKey();
         
          List queues = (List)entry.getValue();
         
          Iterator iter2 = queues.iterator();
         
View Full Code Here

        while (iter.hasNext())
        {
          Binding binding = (Binding)iter.next();
         
          Condition condition = binding.condition;
         
          Queue queue = binding.queue;
         
          // Sanity check
            if (!queue.isRecoverable())
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

      {
         Message msg = CoreMessageFactory.createCoreMessage(msgCount++, persistent, null);

         MessageReference ref = ms.reference(msg);

         Condition condition = conditionFactory.createCondition(conditionText);

         boolean routed = office.route(ref, condition, null);

         assertTrue(routed);
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.