Package net.timewalker.ffmq3.local.destination

Examples of net.timewalker.ffmq3.local.destination.LocalTopic


                break;
            Thread.sleep(100);
        }

        // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
        LocalTopic localTopic = engine.getLocalTopic(params.destinationName);
        if (!params.receiverTransacted)
        {
            while (localTopic.getSize() > 0)
                Thread.sleep(10);
        }
       
        long endTime = System.currentTimeMillis();
        double rate = (double)totalExpected*1000/(endTime-startTime);
        System.out.println((endTime-startTime)+" ms ("+rateFormat.format(rate)+" msg/s)");

        int totalReceived = 0;
        for (int n = 0 ; n < receivers.length ; n++)
            totalReceived += receivers[n].getReceivedCount();

        int topicSize = localTopic.getSize();
        if (topicSize > 0)
        {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            System.out.println(localTopic);
            System.out.println(localTopic.getConsumersSummary());              
            TestUtils.dumpThreads();
            TestUtils.hang();
        }

        // Close receivers
View Full Code Here


                break;
            Thread.sleep(100);
        }

        // When in non-transacted mode, the ack is sent _after_ message processing so we need to wait a bit
        LocalTopic localTopic = engine.getLocalTopic(params.destinationName);
        if (!params.receiverTransacted)
        {
          while (localTopic.getSize() > 0)
            Thread.sleep(10);
        }
       
        long endTime = System.currentTimeMillis();
        double rate = (double)totalExpected*1000/(endTime-startTime);
        System.out.println((endTime-startTime)+" ms ("+rateFormat.format(rate)+" msg/s)");

        int totalReceived = 0;
        for (int n = 0 ; n < receivers.length ; n++)
            totalReceived += receivers[n].getReceivedCount();

        int topicSize = localTopic.getSize();
        if (topicSize > 0)
        {
            System.out.println("Expected : "+totalExpected);
            System.out.println("Received : "+totalReceived);
            System.out.println(localTopic);
            System.out.println(localTopic.getConsumersSummary());              
            TestUtils.dumpThreads();
            TestUtils.hang();
        }

        // Close receivers
View Full Code Here

             throw new IllegalStateException("Temporary queue does not belong to session's connection.");
      }
      else
      if (destination instanceof LocalTopic)
      { 
        LocalTopic localTopic = (LocalTopic)destination;
          if (localTopic.isTemporary() && !connection.isRegisteredTemporaryTopic(localTopic.getTopicName()))
             throw new IllegalStateException("Temporary topic does not belong to session's connection.");
      }
      else
        throw new FFMQException("Unexpected destination type : "+destination,"INTERNAL_ERROR");
    }
View Full Code Here

            {
              List topics = new ArrayList();
              topics.addAll(topicMap.values());
              for (int i = 0; i < topics.size(); i++)
                {
                    LocalTopic localTopic = (LocalTopic)topics.get(i);
                    try
                    {
                      undeployTopic(localTopic);
                    }
                    catch (JMSException e)
View Full Code Here

     */
    public void deleteTopic( String topicName ) throws JMSException
    {
        synchronized (topicMap)
        {
            LocalTopic topic = (LocalTopic)topicMap.remove(topicName);
            if (topic != null)
            {
                undeployTopic(topic);
                log.debug("Undeployed local topic : "+topicName);
            }
View Full Code Here

     */
    public LocalTopic getLocalTopic( String topicName ) throws JMSException
    {
        synchronized (topicMap)
        {
            LocalTopic topic = (LocalTopic)topicMap.get(topicName);
            if (topic == null)
                return loadOrAutoCreateTopic(topicName);
           
            return topic;
        }
View Full Code Here

     */
    public boolean localTopicExists( String topicName ) throws JMSException
    {
        synchronized (topicMap)
        {
            LocalTopic topic = (LocalTopic)topicMap.get(topicName);
            if (topic != null)
                return true;
           
            // Check if a definition exists
            if (destinationDefinitionProvider.getTopicDefinition(topicName) != null)
View Full Code Here

    private LocalTopic loadOrAutoCreateTopic( String topicName ) throws JMSException
    {
        TopicDefinition topicDef = destinationDefinitionProvider.getTopicDefinition(topicName);
        if (topicDef != null)
        {
            LocalTopic topic = new LocalTopic(topicDef);
            deployTopic(topic);
            return topic;
        }
       
        // Topic auto-creation
View Full Code Here

        synchronized (topicMap)
        {
            Iterator topics = topicMap.values().iterator();
            while (topics.hasNext())
            {
                LocalTopic topic = (LocalTopic)topics.next();
                topic.unsubscribe(clientID,subscriptionName);
            }
        }
       
        // Then delete subscription related queues
        String subscriberID = clientID+"-"+subscriptionName;
View Full Code Here

    }
    else
    if (destination instanceof Topic)
    {
      Topic topicRef = (Topic)destination;
      LocalTopic topic = engine.getLocalTopic(topicRef.getTopicName());
          topic.put(message,this,committables);
    }
    else
      throw new InvalidDestinationException("Unsupported destination : "+destination);
    }
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.local.destination.LocalTopic

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.