Package org.jboss.messaging.core.contract

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


      if (dest.isDirect())
      {
         if (trace) { log.trace(this + " routing " + msg + " to direct destination"); }
        //Route directly to queue - temp kludge for clustering

        Binding binding = postOffice.getBindingForQueueName(dest.getName());

        if (binding == null)
        {
          throw new IllegalArgumentException("Cannot find binding for queue " + dest.getName());
        }
View Full Code Here


     return added;
   }
               
   public Binding removeBinding(String queueName, boolean allNodes) throws Throwable
   {
     Binding binding = internalRemoveBinding(queueName, allNodes, true);
    
     if (binding != null && allNodes && clustered && binding.queue.isClustered())
     {
       //Now we must wait for all the bindings to be removed from state
       //This is necessary since the second unbind in an all unbind is sent asynchronously to avoid deadlock
View Full Code Here

     try
     {
       if (localNameMap != null)
       {
         Binding binding = (Binding)localNameMap.get(queueName);
         
          return binding;
       }
       else
       {
View Full Code Here

         }
      }

     try
     {
       Binding binding = (Binding)channelIDMap.get(new Long(channelID));
      
       return binding;
     }
     finally
     {
View Full Code Here

 
  //  Testing only
  
   public Map getRecoveryArea(String queueName)
   {
     Binding binding = (Binding)localNameMap.get(queueName);
    
     if (binding != null)
     {
       return binding.queue.getRecoveryArea();
     }
View Full Code Here

     }
   }
  
   public int getRecoveryMapSize(String queueName)
   {
     Binding binding = (Binding)localNameMap.get(queueName);
    
     if (binding != null)
     {
       return binding.queue.getRecoveryMapSize();
     }
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())
         {
           // insert into db if not already there
           if (!loadedBindings.containsKey(queue.getName()))
           {
             //Create a local binding too
            
            long channelID = channelIDManager.getID();
                       
            Queue queue2 = new MessagingQueue(thisNodeID, mapping.getQueueName(), channelID, ms, pm,
                                             mapping.isRecoverable(), mapping.getMaxSize(), filter,
                                             mapping.getFullSize(), mapping.getPageSize(), mapping.getDownCacheSize(),
                                             true, mapping.getRecoverDeliveriesTimeout());    
           
            Binding localBinding = new Binding(condition, queue2, true);
                        
             if (mapping.isRecoverable())
             {              
               //We need to insert it into the database
               if (trace) { log.trace(this + " got all binding in state for queue " + queue.getName() + " inserting it in DB"); }
View Full Code Here

         
          Iterator iter2 = map.values().iterator();
         
          while (iter2.hasNext())
          {
            Binding binding = (Binding)iter2.next();
         
            Queue queue = binding.queue;
           
            //We only get the clustered queues
            if (queue.isClustered())
View Full Code Here

                                       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)
     {
       if (trace) { log.trace("allNodes is true, so also forcing a local bind"); }
      
       //There is the possibility that two nodes send a bind all with the same name simultaneously OR
       //a node starts and sends a bind "ALL" and the other nodes already have a queue with that name
       //This is ok - but we must check for this and not create the local binding in this case
                            
       //Bind locally

       long channelID = channelIDManager.getID();
      
       Queue queue2 = new MessagingQueue(thisNodeID, mapping.getQueueName(), channelID, ms, pm,
                                        mapping.isRecoverable(), mapping.getMaxSize(), filter,
                                        mapping.getFullSize(), mapping.getPageSize(), mapping.getDownCacheSize(), true,
                                        mapping.getRecoverDeliveriesTimeout());

       //We must cast back asynchronously to avoid deadlock
       boolean added = internalAddBinding(new Binding(condition, queue2, true), false, false);
      
       if (added)
       {        
         if (trace) { log.trace(this + " inserted in binding locally"); }     
        
View Full Code Here

   public void handleReplicateDelivery(int nodeID, String queueName, String sessionID, long messageID,
                                     long deliveryID, final Address replyAddress) throws Exception
   {
     if (trace) { log.trace(this + " handleReplicateDelivery for queue " + queueName + " session " + sessionID + " message " + messageID); }
    
     Binding binding = getBindingForQueueName(queueName);
    
     if (binding == null)
     {
       //This is ok - the queue might not have been deployed yet - when the queue is deployed it
       //will request for deliveries to be sent to it in a batch
View Full Code Here

TOP

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

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.