Package net.timewalker.ffmq3.common.message.selector.expression

Examples of net.timewalker.ffmq3.common.message.selector.expression.SelectorNode


        }
    }
   
    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


          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

        super(session,destination,messageSelector,noLocal,consumerId);
        this.engine = engine;
        this.session = session;
        this.parsedSelector =
            StringTools.isNotEmpty(messageSelector) ?
                new MessageSelector(messageSelector) : null;
        this.traceEnabled = log.isTraceEnabled();
        this.transactionSet = session.getTransactionSet();
        this.notificationProxy = session.getNotificationProxy();
        this.prefetchCapacity = this.prefetchSize = engine.getSetup().getConsumerPrefetchSize();
        this.logListenersFailures = getSettings().getBooleanProperty(FFMQCoreSettings.DELIVERY_LOG_LISTENERS_FAILURES, false);
View Full Code Here

          throw new FFMQException("Consumer should not be accessed by more than one thread","ILLEGAL_USAGE");
       
        receiving = true;
        try
        {
          MessageSelector selector = getReceiveSelector();
         
          // No-wait simplified case
          if (timeout == 0)
          {
            if (!connection.isStarted())
View Full Code Here

        for (int n = 0 ; n < INVALID_SELECTORS.length; n++)
        {
            System.out.print("TESTING invalid ["+INVALID_SELECTORS[n]+"] ");
            try
            {
              SelectorNode node = new MessageSelectorParser(INVALID_SELECTORS[n]).parse();
              System.out.println(node);
              fail("Should have failed : "+INVALID_SELECTORS[n]);
            }
            catch (InvalidSelectorException e)
            {
View Full Code Here

     */
    public SelectorNode parse() throws InvalidSelectorException
    {
        if (isEndOfExpression())
            return null;
        SelectorNode expr = parseExpression();
        if (!isEndOfExpression())
            throw new InvalidSelectorException("Unexpected token : "+currentToken);
        if (!(expr instanceof ConditionalExpression))   
            throw new InvalidSelectorException("Selector expression is not a boolean expression");
       
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.common.message.selector.expression.SelectorNode

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.