Package org.jboss.messaging.core.contract

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


         ref = messageStore.reference(msg);

         ref.getMessage().setPersisted(true);

         Binding binding = postOffice.getBindingForChannelID(channelID);

         if (binding == null)
         {
            throw new IllegalStateException("Cannot find binding for channel id " + channelID);
         }
View Full Code Here


         
          if (trace) { log.trace(this + " Looking for remote bindings"); }
         
          while (iter.hasNext())
          {
            Binding binding = (Binding)iter.next();
           
            if (trace) { log.trace(this + " Remote binding is " + binding); }
           
            //This will only create it if it doesn't already exist
           
            if (binding.queue.getNodeID() != this.nodeID)
             {             
              if (trace) { log.trace(this + " Creating sucker"); }
            
              createSucker(queueName, binding.queue.getNodeID());
            }
          }                   
        }
        else
        {
          //Remote bind
         
          if (trace) { log.trace(this + " Remote bind"); }
         
          ensureAllConnectionsCreated();
                   
          //Look for local queue
         
          Binding localBinding = postOffice.getBindingForQueueName(queueName);
                       
          if (localBinding == null)
          {
            //This is ok - the queue was deployed on the remote node before being deployed on the local node - do nothing for now
            if (trace) { log.trace(this + " There's no local binding"); }
View Full Code Here

    {
      if (trace) { log.trace("Creating Sucker for queue " + queueName + " node " + nodeID); }

      // Need to lookup the local queue

      Binding binding = this.postOffice.getBindingForQueueName(queueName);

      Queue localQueue = binding.queue;
     
      if (localQueue.isClustered())
      {       
         //Find channel id for remote queue - we need this for doing shared DB optimisation
         Collection coll = this.postOffice.getAllBindingsForQueueName(queueName);
         Iterator iter = coll.iterator();
         long sourceChannelID = -1;
         while (iter.hasNext())
         {
            Binding b = (Binding)iter.next();
            if (b.queue.getNodeID() == nodeID)
            {
               sourceChannelID = b.queue.getChannelID();
            }
         }
View Full Code Here

               
    //This can probably be greatly optimised
   
    while (iter.hasNext())
    {
      Binding binding = (Binding)iter.next();
     
      if (binding.queue.isClustered())
      {       
        List queues = (List)nameMap.get(binding.queue.getName());
       
View Full Code Here

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

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

         // get a reference to the destination and use it while it is still being loaded. Also,
         // binding might already exist.
          
         PostOffice po = serverPeer.getPostOfficeInstance();
                          
         Binding binding = po.getBindingForQueueName(destination.getName());
        
         Queue queue;
        
         if (binding != null)
         {                    
           queue = binding.queue;
          
           if (queue.isActive())
           {
             throw new IllegalStateException("Cannot deploy queue " + destination.getName() + " it is already deployed");
           }
          
           //Sanity check - currently it is not possible to change the clustered attribute of a destination
           //See http://jira.jboss.org/jira/browse/JBMESSAGING-1235
          
           boolean actuallyClustered = po.isClustered() && destination.isClustered();
          
           if (actuallyClustered != queue.isClustered())
           {
             throw new IllegalArgumentException("Queue " + destination.getName() + " is already deployed as clustered = " +
                                              queue.isClustered() + " so cannot redeploy as clustered=" + destination.isClustered() +
                                              " . You must delete the destination first before redeploying");
            
           }
          
            queue.setPagingParams(destination.getFullSize(),
                                  destination.getPageSize(),
                                  destination.getDownCacheSize())
           
            queue.load();
              
            // Must be done after load
            queue.setMaxSize(destination.getMaxSize());
           
            queue.activate();          
         }
         else
         {          
            // Create a new queue

            JMSCondition queueCond = new JMSCondition(true, destination.getName());
           
            queue = new MessagingQueue(nodeId, destination.getName(),
                                     serverPeer.getChannelIDManager().getID(),
                                       serverPeer.getMessageStore(), serverPeer.getPersistenceManagerInstance(),
                                       true,
                                       destination.getMaxSize(), null,
                                       destination.getFullSize(), destination.getPageSize(),
                                       destination.getDownCacheSize(), destination.isClustered(),
                                       serverPeer.getRecoverDeliveriesTimeout());
            po.addBinding(new Binding(queueCond, queue, false), false);        
           
            queue.activate();
         }
        
         ((ManagedQueue)destination).setQueue(queue);
View Full Code Here

        
         Iterator mIter1 = msgList1.iterator();
         while (mIter1.hasNext())
         {
            MessageChannelPair pair = (MessageChannelPair)mIter1.next();
            Binding binding = postOffice.getBindingForChannelID(pair.getChannelId());
            String qname = binding.queue.getName();
            Long chid = binding.queue.getChannelID();
            String qkey = qname + " (" + chid + ")";
            List<String> msgs = qInfo.get(qkey);
            if (msgs == null)
            {
               msgs = new ArrayList<String>();
               qInfo.put(qkey, msgs);
            }
            msgs.add(String.valueOf(pair.getMessage().getMessageID()) + " (+)");
         }
        
         Iterator mIter2 = msgList2.iterator();
         while (mIter2.hasNext())
         {
            MessageChannelPair pair = (MessageChannelPair)mIter2.next();
            Binding binding = postOffice.getBindingForChannelID(pair.getChannelId());
            String qname = binding.queue.getName();
            Long chid = binding.queue.getChannelID();
            String qkey = qname + " (" + chid + ")";
            List<String> msgs = qInfo.get(qkey);
            if (msgs == null)
View Full Code Here

        
         Iterator mIter1 = msgList1.iterator();
         while (mIter1.hasNext())
         {
            MessageChannelPair pair = (MessageChannelPair)mIter1.next();
            Binding binding = postOffice.getBindingForChannelID(pair.getChannelId());
            String qname = binding.queue.getName();
            Long chid = binding.queue.getChannelID();
            String qkey = qname + " (" + chid + ")";
            List<String> msgs = qInfo.get(qkey);
            if (msgs == null)
            {
               msgs = new ArrayList<String>();
               qInfo.put(qkey, msgs);
            }
            msgs.add(String.valueOf(pair.getMessage().getMessageID()) + " (+)");
         }
        
         Iterator mIter2 = msgList2.iterator();
         while (mIter2.hasNext())
         {
            MessageChannelPair pair = (MessageChannelPair)mIter2.next();
            Binding binding = postOffice.getBindingForChannelID(pair.getChannelId());
            String qname = binding.queue.getName();
            Long chid = binding.queue.getChannelID();
            String qkey = qname + " (" + chid + ")";
            List<String> msgs = qInfo.get(qkey);
            if (msgs == null)
View Full Code Here

         // 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());
            }
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.