Package net.timewalker.ffmq3.common.destination

Examples of net.timewalker.ffmq3.common.destination.TopicRef


        }
    }
   
    protected void multiTopicConnectionListenerTest( String testName , CommTestParameters params , DummyMessageFactory msgFactory ) throws Exception
    {
        Topic topic = new TopicRef(params.destinationName);
       
        SynchronizationPoint startSynchro = new SynchronizationPoint();
        TopicConnection[] receiverConnections = new TopicConnection[params.receiverCount];
        for (int n = 0 ; n < receiverConnections.length ; n++)
            receiverConnections[n] = createTopicConnection();
View Full Code Here


       
        // Topic
        if (objClassName.equals(TopicRef.class.getName()))
        {
          String topicName = getRequiredAttribute(reference, "topicName");
          return new TopicRef(topicName);
        }
       
        // ConnectionFactory
        if (objClassName.equals(FFMQConnectionFactory.class.getName()))
          return new FFMQConnectionFactory(recreateConnectionFactoryEnv(reference));
View Full Code Here

        {
          // Dynamic queue or topic lookup
          if (nm.startsWith("queue/") && nm.length() > 6)
            return new QueueRef(nm.substring(nm.indexOf('/')+1));
          if (nm.startsWith("topic/") && nm.length() > 6)
            return new TopicRef(nm.substring(nm.indexOf('/')+1));
         
            throw new NameNotFoundException(name + " not found");
        }

        return answer;
View Full Code Here

          else
          if (destination instanceof Queue)
            dstMessage.setJMSDestination(new QueueRef(((Queue)destination).getQueueName()));
          else
          if (destination instanceof Topic)
            dstMessage.setJMSDestination(new TopicRef(((Topic)destination).getTopicName()));
        }
       
        dstMessage.setJMSExpiration(srcMessage.getJMSExpiration());
        dstMessage.setJMSMessageID(srcMessage.getJMSMessageID());
        dstMessage.setJMSPriority(srcMessage.getJMSPriority());
        dstMessage.setJMSRedelivered(srcMessage.getJMSRedelivered());
       
        dstMessage.setJMSReplyTo(srcMessage.getJMSReplyTo());
        Destination replyTo = srcMessage.getJMSReplyTo();
        if (replyTo != null)
        {
          // Do our best to convert the ref. to one of our native types
          if (replyTo instanceof DestinationRef)
            dstMessage.setJMSReplyTo(replyTo);
          else
          if (replyTo instanceof Queue)
            dstMessage.setJMSReplyTo(new QueueRef(((Queue)replyTo).getQueueName()));
          else
          if (replyTo instanceof Topic)
            dstMessage.setJMSReplyTo(new TopicRef(((Topic)replyTo).getTopicName()));
        }
       
        dstMessage.setJMSTimestamp(srcMessage.getJMSTimestamp());
        dstMessage.setJMSType(srcMessage.getJMSType());
       
View Full Code Here

    /* (non-Javadoc)
     * @see javax.jms.Session#createTopic(java.lang.String)
     */
    public Topic createTopic(String topicName) throws JMSException
    {
        return new TopicRef(topicName);
    }
View Full Code Here

          if (timeout == 0)
          {
            if (!connection.isStarted())
              return null;
           
            AbstractMessage message = localQueue.get((LocalSession)session,
                                   transactionSet,
                                                 selector);         
              if (message == null)
                return null;
             
            if (traceEnabled)
                  log.trace(session+" [GET] in "+localQueue+" - "+message);
 
            if (duplicateRequired)
              message = MessageTools.duplicate(message);
              message.markAsReadOnly();
             
              return message;
          }
   
          // Wait loop
          long now = System.currentTimeMillis();
          long startTime = now;
         
          // Passive wait
          while (!closed && (timeout < 0 || (now - startTime < timeout)))
          {
            // Don't do anything if connection is not started
          if (connection.isStarted())
          {
                  // Try obtaining something from target queue
            AbstractMessage message = localQueue.get((LocalSession)session,
                                                 transactionSet,
                                                 selector);
                if (message != null)
                {
                    if (traceEnabled)
                        log.trace(session+" [GET] in "+localQueue+" - "+message);
                   
                    if (duplicateRequired)
                  message = MessageTools.duplicate(message);
                  message.markAsReadOnly();
                 
                  return message;
                }
          }
             
View Full Code Here

        synchronized (this)
      {
            // Push up to 'prefetchCapacity' messages to the remote consumer
          while (prefetchCapacity > 0)
          {         
            AbstractMessage message = receiveFromDestination(0, false);
            if (message != null)
            {
                count++;
              prefetchCapacity--;
              notificationProxy.addNotification(id,message,prefetchCapacity);
View Full Code Here

        if (messages != null)
        {
            // Dispatch to session
            for(int n=0;n<messages.size();n++)
            {
                AbstractMessage msg = (AbstractMessage)messages.get(n);
                localSession.dispatch(msg);
            }
        }
       
        // Commit session
View Full Code Here

    }
   
    private PutResponse processPut( PutQuery query ) throws JMSException
    {
        LocalSession session = lookupSession(query);
        AbstractMessage msg = query.getMessage();
       
        // Dispatch to session
        session.dispatch(msg);
    
        return new PutResponse();
View Full Code Here

        if (messages != null)
        {
            // Dispatch to session
            for(int n=0;n<messages.size();n++)
            {
                AbstractMessage msg = (AbstractMessage)messages.get(n);
                session.dispatch(msg);
            }
        }
    
        return new MultiplePutResponse();
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.common.destination.TopicRef

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.