Package org.jboss.messaging.core.contract

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


      }
   }

   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

   * Note: this method should be called during the destination loading time, i.e.
   * the queue is not activated yet.
   */
   public Queue convertDestination(ManagedDestination newDest, String queueName) throws Throwable
   {
      Binding b = getBindingForQueueName(queueName);

      if (b.queue.isActive())
      {
         throw new IllegalStateException(this + " cannot convert the destination " + b.queue + " because it is in active state");
      }
     
      //if a destination changes from clustered to standalone, collect the messages from all channels
      Collection allBindings = getAllBindingsForQueueName(queueName);
      if (newDest.isDropOldMessageOnRedeploy())
      {
         removeDBChannelMessages(allBindings);
      }
      else
      {
         if ( !newDest.isClustered() )
         {
            mergeDBChannelMessages(allBindings, b.queue);
         }
      }

      //if the old destination is clustered, we need to remove from all nodes (queue and durable subs)
      b = removeBinding(queueName, !newDest.isClustered());

      b.queue.setClustered(newDest.isClustered());
  
      if (newDest.isQueue())
      {
         JMSCondition queueCond = new JMSCondition(true, queueName);
         addBinding(new Binding(queueCond, b.queue, false), false);
      }
      else
      {
         b.queue.setClustered(newDest.isClustered());
         JMSCondition queueCond = new JMSCondition(false, newDest.getName());
         addBinding(new Binding(queueCond, b.queue, true), newDest.isClustered());
      }
     
      return b.queue;
   }
View Full Code Here

      }
      Iterator itBindings = allBindings.iterator();

      while (itBindings.hasNext())
      {
         Binding bd = (Binding)itBindings.next();
         long channelID = bd.queue.getChannelID();
         pm.dropChannelMessages(channelID);
      }     
   }
View Full Code Here

      //do a staticMerge
      Iterator itBindings = allBindings.iterator();

      while (itBindings.hasNext())
      {
         Binding bd = (Binding)itBindings.next();
         long fromChannelID = bd.queue.getChannelID();
         if (fromChannelID != localQueue.getChannelID())
         {
            localQueue.staticMerge(bd.queue);
         }
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

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.