Package org.jboss.jms.destination

Examples of org.jboss.jms.destination.JBossDestination


      JBossMessage msg = (JBossMessage)del.getMessage();
     
      MessageProxy proxy = JBossMessage.
         createThinDelegate(del.getDeliveryId(), (JBossMessage)msg, del.getDeliveryCount());
     
      JBossDestination dest =(JBossDestination) proxy.getJMSDestination();
     
      // If the message received is a direct destination (MessageSucker), and this Consumer is not a MessageSucker.. then we need to replace the destination
      if (dest.isDirect() && !this.consumerDelegate.getDestination().isDirect())
      {
         proxy.setJMSDestination(msg.getOriginalSuckerDestination());
      }
     
      proxy.setSource(cbManager);
View Full Code Here


      String consumerID = GUIDGenerator.generateGUID();

      int prefetchSize = connectionEndpoint.getPrefetchSize();

      JBossDestination dest = new JBossQueue(queueName);

      //We don't care about redelivery delays and number of attempts for a direct consumer

      ServerConsumerEndpoint ep =
         new ServerConsumerEndpoint(consumerID, binding.queue,
View Full Code Here

      String consumerID = GUIDGenerator.generateGUID();

      int prefetchSize = connectionEndpoint.getPrefetchSize();

      JBossDestination dest = new JBossQueue(queueName);

      //We don't care about redelivery delays and number of attempts for a direct consumer

      ServerConsumerEndpoint ep =
         new ServerConsumerEndpoint(consumerID, binding.queue,
View Full Code Here

      JBossMessage msg = (JBossMessage)del.getMessage();
     
      MessageProxy proxy = JBossMessage.
         createThinDelegate(del.getDeliveryId(), (JBossMessage)msg, del.getDeliveryCount());
     
      JBossDestination dest =(JBossDestination) proxy.getJMSDestination();
     
      // If the message received is a direct destination (MessageSucker), and this Consumer is not a MessageSucker.. then we need to replace the destination
      if (dest.isDirect() && !this.consumerDelegate.getDestination().isDirect())
      {
         proxy.setJMSDestination(msg.getOriginalSuckerDestination());
      }

      //TODO - we temporarily need to execute on a different thread to avoid a deadlock situation in
View Full Code Here

                 
         synchronized (temporaryDestinations)
         {
            for(Iterator i = temporaryDestinations.iterator(); i.hasNext(); )
            {
               JBossDestination dest = (JBossDestination)i.next();
  
               if (dest.isQueue())
               {    
                 // Temporary queues must be unbound on ALL nodes of the cluster
                
                 postOffice.removeBinding(dest.getName(), postOffice.isClustered());                
               }
               else
               {
                  //No need to unbind - this will already have happened, and removeAllReferences
                  //will have already been called when the subscriptions were closed
                  //which always happens before the connection closed (depth first close)    
                 //note there are no durable subs on a temporary topic
                
                 //Sanity check
                
                  Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, dest.getName()), true);
                
                  if (!queues.isEmpty())
                 {
                    //This should never happen
                    throw new IllegalStateException("Cannot delete temporary destination if it has consumer(s)");
View Full Code Here

         
          return;
        }
      }
     
      JBossDestination dest = (JBossDestination)msg.getJMSDestination();
     
      // This allows the no-local consumers to filter out the messages that come from the same
      // connection.

      // TODO Do we want to set this for ALL messages. Optimisation is possible here.
      msg.setConnectionID(id);


      // We must reference the message *before* we send it the destination to be handled. This is
      // so we can guarantee that the message doesn't disappear from the store before the
      // handling is complete. Each channel then takes copies of the reference if they decide to
      // maintain it internally
     
      MessageReference ref = msg.createReference();
     
      long schedDeliveryTime = msg.getScheduledDeliveryTime();
     
      if (schedDeliveryTime > 0)
      {
         ref.setScheduledDeliveryTime(schedDeliveryTime);
      }
     
      if (dest.isDirect())
      {
        //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());
        }
       
        Queue queue = binding.queue;
       
        Delivery del = queue.handle(null, ref, tx);
       
        if (del == null)
        {
          throw new JMSException("Failed to route " + ref + " to " + dest.getName());
        }
      }
      else if (dest.isQueue())
      {
         if (!postOffice.route(ref, new JMSCondition(true, dest.getName()), tx))
         {
            throw new JMSException("Failed to route " + ref + " to " + dest.getName());
         }
      }
      else
      {
         postOffice.route(ref, new JMSCondition(false, dest.getName()), tx);  
      }
        
      if (trace) { log.trace("sent " + msg); }
   }
View Full Code Here

      sess = (JBossSession)localConnection.createXASession();
     
      localSession = (SessionDelegate)sess.getDelegate();
    }
           
    JBossDestination dest = new JBossQueue(localQueue.getName(), true);
       
    producer = localSession.createProducerDelegate(dest);
   
    //We create the consumer with autoFlowControl = false
    //In this mode, the consumer does not handle it's own flow control, but it must be handled
View Full Code Here

     
      String consumerID = GUIDGenerator.generateGUID();
           
      int prefetchSize = connectionEndpoint.getPrefetchSize();
     
      JBossDestination dest = new JBossQueue(queueName);
     
      //We don't care about redelivery delays and number of attempts for a direct consumer
     
      ServerConsumerEndpoint ep =
         new ServerConsumerEndpoint(consumerID, binding.queue,
View Full Code Here

                 
         synchronized (temporaryDestinations)
         {
            for(Iterator i = temporaryDestinations.iterator(); i.hasNext(); )
            {
               JBossDestination dest = (JBossDestination)i.next();
  
               if (dest.isQueue())
               {    
                 // Temporary queues must be unbound on ALL nodes of the cluster
                
                 postOffice.removeBinding(dest.getName(), postOffice.isClustered());                
               }
               else
               {
                  //No need to unbind - this will already have happened, and removeAllReferences
                  //will have already been called when the subscriptions were closed
                  //which always happens before the connection closed (depth first close)    
                 //note there are no durable subs on a temporary topic
                
                 //Sanity check
                
                  Collection queues = serverPeer.getPostOfficeInstance().getQueuesForCondition(new JMSCondition(false, dest.getName()), true);
                
                  if (!queues.isEmpty())
                 {
                    //This should never happen
                    throw new IllegalStateException("Cannot delete temporary destination if it has consumer(s)");
View Full Code Here

         
          return;
        }
      }
     
      JBossDestination dest = (JBossDestination)msg.getJMSDestination();
     
      // This allows the no-local consumers to filter out the messages that come from the same
      // connection.

      // TODO Do we want to set this for ALL messages. Optimisation is possible here.
      msg.setConnectionID(id);


      // We must reference the message *before* we send it the destination to be handled. This is
      // so we can guarantee that the message doesn't disappear from the store before the
      // handling is complete. Each channel then takes copies of the reference if they decide to
      // maintain it internally
     
      MessageReference ref = msg.createReference();
     
      long schedDeliveryTime = msg.getScheduledDeliveryTime();
     
      if (schedDeliveryTime > 0)
      {
         ref.setScheduledDeliveryTime(schedDeliveryTime);
      }
     
      if (dest.isDirect())
      {
        //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());
        }
       
        Queue queue = binding.queue;
       
         Long scid = (Long)ref.getMessage().removeHeader(Message.SOURCE_CHANNEL_ID);
        
         Delivery del = queue.handleMove(ref, scid.longValue());
       
        if (del == null)
        {
          throw new JMSException("Failed to route " + ref + " to " + dest.getName());
        }
      }
      else if (dest.isQueue())
      {
         if (!postOffice.route(ref, new JMSCondition(true, dest.getName()), tx))
         {
            throw new JMSException("Failed to route " + ref + " to " + dest.getName());
         }
      }
      else
      {
         postOffice.route(ref, new JMSCondition(false, dest.getName()), tx);  
      }
        
      if (trace) { log.trace("sent " + msg); }
   }
View Full Code Here

TOP

Related Classes of org.jboss.jms.destination.JBossDestination

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.