Package org.jboss.jms.destination

Examples of org.jboss.jms.destination.JBossDestination


   {
      if (trace) { log.trace("createConnectionConsumer()"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
View Full Code Here


      DelegateSupport delegate = (DelegateSupport)consumerDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];
      boolean noLocal = ((Boolean)mi.getArguments()[2]).booleanValue();
      String subscriptionName = (String)mi.getArguments()[3];
      boolean connectionConsumer = ((Boolean)mi.getArguments()[4]).booleanValue();
View Full Code Here

      ClientBrowserDelegate browserDelegate = (ClientBrowserDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)browserDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      JBossDestination destination = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];

      BrowserState state =
         new BrowserState(sessionState, browserDelegate, destination, selector);
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)");
                  }
               }

               //
               // Remove temporary destination from the DestinationManager (JBMESSAGING-1215)
               //
               DestinationManager dm = serverPeer.getDestinationManager();

               ManagedDestination mDest = dm.getDestination(dest.getName(), dest.isQueue());
               if (dm == null)
               {
                  throw new InvalidDestinationException("No such destination: " + dest);
               }
View Full Code Here

      return remotingClientSessionID;
   }

   boolean sendMessage(JBossMessage msg, Transaction tx, boolean checkForDuplicates) throws Exception
   {
      JBossDestination dest = (JBossDestination)msg.getJMSDestination();

      if (!dest.isDirect())
      {
         long msgID = serverPeer.getMessageIDMgr().getID();

         msg.setMessageId(msgID);
      }

      // Trace after the messageID was generated
      if (trace) { log.trace(this + " sending message " + msg + (tx == null ? " non-transactionally" : " in " + tx)); }

      // This allows the no-local consumers to filter out the messages that come from the same
      // connection.

      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();

      if (checkForDuplicates)
      {
         if (serverPeer.getPersistenceManagerInstance().idExists(msg.getJMSMessageID()))
         {
            log.trace("ID exists in ID cache, probably duplicate sent on failover");

            return false;
         }
      }

      long schedDeliveryTime = msg.getScheduledDeliveryTime();

      if (schedDeliveryTime > 0)
      {
         ref.setScheduledDeliveryTime(schedDeliveryTime);
      }

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

        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 (trace) { log.trace(this + " routing " + msg + " to queue"); }
         if (!postOffice.route(ref, new JMSCondition(true, dest.getName()), tx))
         {
            throw new JMSException("Failed to route " + ref + " to " + dest.getName());
         }
      }
      else
      {
         if (trace) { log.trace(this + " routing " + msg + " to postoffice"); }
         postOffice.route(ref, new JMSCondition(false, dest.getName()), tx);
      }

      if (trace) { log.trace("sent " + msg); }

      return true;
View Full Code Here

      DelegateSupport delegate = (DelegateSupport)consumerDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];
      boolean noLocal = ((Boolean)mi.getArguments()[2]).booleanValue();
      String subscriptionName = (String)mi.getArguments()[3];
      boolean connectionConsumer = ((Boolean)mi.getArguments()[4]).booleanValue();
View Full Code Here

      ClientBrowserDelegate browserDelegate = (ClientBrowserDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)browserDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      JBossDestination destination = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];

      BrowserState state =
         new BrowserState(sessionState, browserDelegate, destination, selector);
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

      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

   {
      if (trace) { log.trace("createConnectionConsumer()"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
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.