Package net.timewalker.ffmq3.local.destination

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


    }
   
    private CreateConsumerResponse processCreateDurableSubscriber( CreateDurableSubscriberQuery query ) throws JMSException
    {
        LocalSession session = lookupSession(query);
        LocalDurableTopicSubscriber subscriber = (LocalDurableTopicSubscriber)session.createDurableSubscriber(query.getConsumerId(),
                                                                                                          query.getTopic(),
                                                                                                              query.getName(),
                                                                                                              query.getMessageSelector(),
                                                                                                              query.isNoLocal());
       
        // Start prefetching
        subscriber.prefetchMore();
       
        CreateConsumerResponse response = new CreateConsumerResponse();
        response.setPrefetchSize(subscriber.getPrefetchSize());
       
        return response;
    }
View Full Code Here


    }
   
    private LocalMessageConsumer lookupConsumer( AbstractConsumerQuery query ) throws JMSException
    {
        LocalSession localSession = lookupSession(query);
        LocalMessageConsumer consumer = (LocalMessageConsumer)localSession.lookupRegisteredConsumer(query.getConsumerId());
        if (consumer == null)
            throw new FFMQException("Invalid consumer id : "+query.getConsumerId(),"NETWORK_ERROR");
        return consumer;
    }
View Full Code Here

        return new RollbackResponse();
    }
   
    private GetResponse processGet( GetQuery query ) throws JMSException
    {
        LocalMessageConsumer consumer = lookupConsumer(query);
        Message msg = consumer.receiveFromDestination(0,false);    
        GetResponse response = new GetResponse();
        response.setMessage((AbstractMessage)msg);
       
        return response;
    }
View Full Code Here

        return response;
    }
   
    private AbstractResponsePacket processPrefetch( PrefetchQuery query ) throws JMSException
    {
        LocalMessageConsumer consumer = lookupConsumer(query);
        consumer.prefetchMore();

        return null; // Async call
    }
View Full Code Here

        return response;
    }
   
    private CloseConsumerResponse processCloseConsumer( CloseConsumerQuery query ) throws JMSException
    {
        LocalMessageConsumer consumer = lookupConsumer(query);
        consumer.close();
       
        // Rollback undelivered prefetched messages
        List undeliveredMessageIDs = query.getUndeliveredMessageIDs();
        if (undeliveredMessageIDs != null && !undeliveredMessageIDs.isEmpty())
          ((LocalSession)consumer.getSession()).rollbackUndelivered(undeliveredMessageIDs);

        return new CloseConsumerResponse();
    }
View Full Code Here

            // Rollback undelivered prefetched messages
            List undeliveredMessageIDs = new ArrayList();
            undeliveredMessageIDs.add(query.getMessageId());
            localSession.rollbackUndelivered(undeliveredMessageIDs);
           
            LocalMessageConsumer consumer = (LocalMessageConsumer)localSession.lookupRegisteredConsumer(query.getConsumerId());
            if (consumer != null)
              consumer.restorePrefetchCapacity(1);
        }
       
        return new RollbackMessageResponse();
    }
View Full Code Here

    }
   
    private CreateConsumerResponse processCreateConsumer( CreateConsumerQuery query ) throws JMSException
    {
        LocalSession session = lookupSession(query);
        LocalMessageConsumer consumer = (LocalMessageConsumer)session.createConsumer(query.getConsumerId(),
                                                                                 query.getDestination(),
                                                                                     query.getMessageSelector(),
                                                                                     query.isNoLocal());
       
        // Start prefetching if we are receiving from a queue
        if (query.getDestination() instanceof Queue)
          consumer.prefetchMore();
       
        CreateConsumerResponse response = new CreateConsumerResponse();
        response.setPrefetchSize(consumer.getPrefetchSize());
       
        return response;
    }
View Full Code Here

    }
   
    private LocalQueueBrowser lookupBrowser( AbstractQueueBrowserQuery query ) throws JMSException
    {
        LocalSession localSession = lookupSession(query);
        LocalQueueBrowser browser = (LocalQueueBrowser)localSession.lookupRegisteredBrowser(query.getBrowserId());
        if (browser == null)
            throw new FFMQException("Invalid browser id : "+query.getBrowserId(),"NETWORK_ERROR");
        return browser;
    }
View Full Code Here

        return browser;
    }
   
    private LocalQueueBrowserEnumeration lookupBrowserEnumeration( AbstractQueueBrowserEnumerationQuery query ) throws JMSException
    {
        LocalQueueBrowser browser = lookupBrowser(query);
        LocalQueueBrowserEnumeration browserEnum = (LocalQueueBrowserEnumeration)browser.lookupRegisteredEnumeration(query.getEnumId());
        if (browserEnum == null)
            throw new FFMQException("Invalid browser enumeration id : "+query.getEnumId(),"NETWORK_ERROR");
        return browserEnum;
    }
View Full Code Here

        return new CreateBrowserResponse();
    }
   
    private QueueBrowserGetEnumerationResponse processQueueBrowserGetEnumeration( QueueBrowserGetEnumerationQuery query ) throws JMSException
    {
        LocalQueueBrowser browser = lookupBrowser(query);
        LocalQueueBrowserEnumeration browserEnum = (LocalQueueBrowserEnumeration)browser.getEnumeration();
       
        QueueBrowserGetEnumerationResponse response = new QueueBrowserGetEnumerationResponse();
        response.setEnumId(browserEnum.getId());

        return response;
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.