Package org.jboss.messaging.core.contract

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


                  if (selector != null)
                  {
                     filter = filterFactory.createFilter(selector);
                  }

                  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);
View Full Code Here


      {
        Binding binding = (Binding)iter.next();

        addBindingInMemory(binding);   
       
        Queue queue = binding.queue;
        
         //Need to broadcast it too
         if (clustered && queue.isClustered())
         {
           String filterString = queue.getFilter() == null ? null : queue.getFilter().getFilterString();                     
          
           MappingInfo info = new MappingInfo(thisNodeID, queue.getName(), binding.condition.toText(), filterString, queue.getChannelID(),
                                            queue.isRecoverable(), true,
                                            binding.allNodes,
                                            queue.getFullSize(), queue.getPageSize(), queue.getDownCacheSize(),
                                            queue.getMaxSize(),
                                            queue.getRecoverDeliveriesTimeout());
          
            ClusterRequest request = new BindRequest(info, binding.allNodes);

            log.trace("Multicasting bind all");
            groupMember.multicastControl(request, false);        
View Full Code Here

         
          Iterator iter2 = queues.iterator();
         
          while (iter2.hasNext())
          {
            Queue queue = (Queue)iter2.next();
           
            if (queue.getNodeID() == nodeToRemove.intValue())
            {
              toRemove.add(new Binding(condition, queue, false));
            }
          }
        }
View Full Code Here

               while (iter.hasNext())
               {
                  Binding binding = (Binding)iter.next();

                  Queue queue = binding.queue;

                  if (queue.isRecoverable() && queue.getNodeID() == failedNodeID.intValue())
                  {
                     toRemove.add(binding);
                  }
               }
            }

            Iterator iter = toRemove.iterator();

            while (iter.hasNext())
            {
               Binding binding = (Binding)iter.next();

               Condition condition = binding.condition;

               Queue queue = binding.queue;

               // Sanity check
               if (!queue.isRecoverable())
               {
                  throw new IllegalStateException("Found non recoverable queue " + queue.getName() +
                                                  " in map, these should have been removed!");
               }

               // Sanity check
               if (!queue.isClustered())
               {
                  throw new IllegalStateException("Queue " + queue.getName() + " is not clustered!");
               }

               // Remove from the in-memory map - no need to broadcast anything - they will get removed from other nodes
               // in memory
               // maps when the other nodes detect failure
               removeBindingInMemory(binding.queue.getNodeID(), binding.queue.getName());

               // Find if there is a local queue with the same name

               Queue localQueue = null;

               if (localNameMap != null)
               {
                  Binding b = (Binding)localNameMap.get(queue.getName());
                  if (b != null)
                  {
                     localQueue = b.queue;
                  }
               }

               if (localQueue != null)
               {
                  // need to merge the queues

                  log.debug(this + " has already a queue: " + queue.getName() + " queue so merging queues");

                  localQueue.mergeIn(queue.getChannelID(), failedNodeID.intValue());

                  log.debug("Merged queue");

                  // Delete from storage
View Full Code Here

                  if (selector != null)
                  {
                     filter = filterFactory.createFilter(selector);
                  }

                  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);
View Full Code Here

      }
   }

   public synchronized Queue getDefaultDLQInstance() throws Exception
   {
      Queue dlq = null;

      if (defaultDLQObjectName != null)
      {
         ManagedQueue dest = null;

         // This can be null... JMXAccessor will return null if InstanceNotFoundException is caught
         dest = (ManagedQueue) JMXAccessor.getJMXAttributeOverSecurity(getServer(), defaultDLQObjectName, "Instance");

         if (dest != null && dest.getName() != null)
         {
            Binding binding = postOffice.getBindingForQueueName(dest.getName());

            if (binding == null)
            {
              throw new IllegalStateException("Cannot find binding for queue " + dest.getName());
            }

            Queue queue = binding.queue;

            if (queue.isActive())
            {
              dlq = queue;
            }
         }
      }
View Full Code Here

      return dlq;
   }

   public synchronized Queue getDefaultExpiryQueueInstance() throws Exception
   {
      Queue expiryQueue = null;

      if (defaultExpiryQueueObjectName != null)
      {
         ManagedQueue dest = null;

         try
         {

            dest = (ManagedQueue)JMXAccessor.getJMXAttributeOverSecurity(getServer(), defaultExpiryQueueObjectName, "Instance");
         }
         catch (InstanceNotFoundException e)
         {
            //Ok
         }

         if (dest != null && dest.getName() != null)
         {
           Binding binding = postOffice.getBindingForQueueName(dest.getName());

            if (binding == null)
            {
              throw new IllegalStateException("Cannot find binding for queue " + dest.getName());
            }

            Queue queue = binding.queue;

            if (queue.isActive())
            {
              expiryQueue = queue;
            }
         }
      }
View Full Code Here

      Iterator iter = queues.iterator();

      while (iter.hasNext())
      {
         Queue queue = (Queue)iter.next();

         queue.removeAllReferences();
      }

      //undeploy the mbean
      if (!undeployDestination(isQueue, name))
      {
         return false;
      }

      //Unbind the destination's queues

      while (iter.hasNext())
      {
         Queue queue = (Queue)iter.next();

         queue.removeAllReferences();

         //Durable subs need to be removed on all nodes
         boolean all = !isQueue && queue.isRecoverable();

         postOffice.removeBinding(queue.getName(), all);
      }

      return true;
   }
View Full Code Here

         
          Iterator iter2 = queues.iterator();
         
          while (iter2.hasNext())
          {
            Queue queue = (Queue)iter2.next();
           
            if (queue.getNodeID() == nodeToRemove.intValue())
            {
              toRemove.add(new Binding(condition, queue, false));
            }
          }
        }
View Full Code Here

         
          while (iter.hasNext())
          {
            Binding binding = (Binding)iter.next();
           
            Queue queue = binding.queue;
           
            if (queue.isRecoverable() && queue.getNodeID() == failedNodeID.intValue())
            {
              toRemove.add(binding);
            }           
          }
        }
                  
        Iterator iter = toRemove.iterator();

        while (iter.hasNext())
        {
          Binding binding = (Binding)iter.next();
         
          Condition condition = binding.condition;
         
          Queue queue = binding.queue;
         
          // Sanity check
            if (!queue.isRecoverable())
            {
               throw new IllegalStateException("Found non recoverable queue " +
                                               queue.getName() + " in map, these should have been removed!");
            }

            // Sanity check
            if (!queue.isClustered())
            {
               throw new IllegalStateException("Queue " + queue.getName() + " is not clustered!");
            }
           
            //Remove from the in-memory map - no need to broadcast anything - they will get removed from other nodes in memory
            //maps when the other nodes detect failure
            removeBindingInMemory(binding.queue.getNodeID(), binding.queue.getName());
         
            //Find if there is a local queue with the same name
           
            Queue localQueue = null;
           
            if (localNameMap != null)
            {
              Binding b = (Binding)localNameMap.get(queue.getName());
              if (b != null)
              {
                localQueue = b.queue;
              }
            }
             
            if (localQueue != null)
            {
               //need to merge the queues
             
              log.debug(this + " has already a queue: " + queue.getName() + " queue so merging queues");
               
               localQueue.mergeIn(queue.getChannelID(), failedNodeID.intValue());
              
               log.debug("Merged queue");      
              
               //Delete from storage
              
View Full Code Here

TOP

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

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.