Examples of SimpleCondition


Examples of com.taobao.top.analysis.statistics.data.impl.SimpleCondition

    Attribute attr = start.getAttributeByName(new QName("", "condition"));
    if (attr != null) {
      conditions.append("&" + attr.getValue());
    }
    if (conditions.length() > 0) {
      entry.setCondition(new SimpleCondition(conditions.toString(), aliasPool));
    }
    String filter = null;
    if (start.getAttributeByName(new QName("", "valuefilter")) != null) {
      if (globalValuefilter != null && globalValuefilter.length() > 0)
        filter = new StringBuilder(globalValuefilter)
View Full Code Here

Examples of org.apache.cassandra.utils.SimpleCondition

        throw new CloneNotSupportedException();
    }

    protected MessagingService()
    {
        listenGate = new SimpleCondition();
        verbHandlers_ = new HashMap<StorageService.Verb, IVerbHandler>();
        /*
         * Leave callbacks in the cachetable long enough that any related messages will arrive
         * before the callback is evicted from the table. The concurrency level is set at 128
         * which is the sum of the threads in the pool that adds shit into the table and the
View Full Code Here

Examples of org.apache.cassandra.utils.SimpleCondition

        throw new CloneNotSupportedException();
    }

    protected MessagingService()
    {
        listenGate = new SimpleCondition();
        verbHandlers_ = new HashMap<StorageService.Verb, IVerbHandler>();

        Function<String, ?> timeoutReporter = new Function<String, Object>()
        {
            public Object apply(String messageId)
View Full Code Here

Examples of org.apache.cassandra.utils.concurrent.SimpleCondition

        {
            droppedMessages.put(verb, new DroppedMessageMetrics(verb));
            lastDroppedInternal.put(verb, 0);
        }

        listenGate = new SimpleCondition();
        verbHandlers = new EnumMap<Verb, IVerbHandler>(Verb.class);
        Runnable logDropped = new Runnable()
        {
            public void run()
            {
View Full Code Here

Examples of org.jboss.test.messaging.core.SimpleCondition

            createClusteredPostOffice(3, "testgroup", sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
            office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue3", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
            office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);

         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);

         //This will make it fail after casting but before persisting the message in the db
         office1.setFail(true, false, false);

         Transaction tx = tr.createTransaction();

         final int NUM_MESSAGES = 10;

         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            Message msg = CoreMessageFactory.createCoreMessage(i, true, null);

            MessageReference ref = ms.reference(msg);

            office1.route(ref, new SimpleCondition("topic1"), tx);
         }

         Thread.sleep(1000);

         List msgs = receiver1.getMessages();
View Full Code Here

Examples of org.jboss.test.messaging.core.SimpleCondition

            createClusteredPostOffice(3, "testgroup", sc, ms, pm, tr);

         LocalClusteredQueue queue1 =
            new LocalClusteredQueue(office1, 1, "queue1", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office1.bindClusteredQueue(new SimpleCondition("topic1"), queue1);

         LocalClusteredQueue queue2 =
            new LocalClusteredQueue(office2, 2, "queue2", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office2.bindClusteredQueue(new SimpleCondition("topic1"), queue2);

         LocalClusteredQueue queue3 =
            new LocalClusteredQueue(office3, 3, "queue3", channelIDManager.getID(), ms, pm,
                                    true, true, -1, null, tr);
         office3.bindClusteredQueue(new SimpleCondition("topic1"), queue3);

         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);

         //This will make it fail after casting and persisting the message in the db
         office1.setFail(false, true, false);

         Transaction tx = tr.createTransaction();

         final int NUM_MESSAGES = 10;

         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            Message msg = CoreMessageFactory.createCoreMessage(i, true, null);

            MessageReference ref = ms.reference(msg);

            office1.route(ref, new SimpleCondition("topic1"), tx);
         }

         Thread.sleep(1000);

         List msgs = receiver1.getMessages();
View Full Code Here

Examples of org.jboss.test.messaging.core.SimpleCondition

         office = createPostOffice();
        
         PagingFilteredQueue queue1 = new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding1 =
            office.bindQueue(new SimpleCondition("condition1"), queue1);
        
         PagingFilteredQueue queue2 = new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding2 =
            office.bindQueue(new SimpleCondition("condition1"), queue2);
        
         PagingFilteredQueue queue3 = new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding3 =
            office.bindQueue(new SimpleCondition("condition1"), queue3);
        
         PagingFilteredQueue queue4 = new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding4 =
            office.bindQueue(new SimpleCondition("condition1"), queue4);
        
         PagingFilteredQueue queue5 = new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding5 =
            office.bindQueue(new SimpleCondition("condition2"), queue5);
        
         PagingFilteredQueue queue6 = new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding6 =
            office.bindQueue(new SimpleCondition("condition2"), queue6);
        
         PagingFilteredQueue queue7 = new PagingFilteredQueue("queue7", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding7 =
            office.bindQueue(new SimpleCondition("condition2"), queue7);
        
         PagingFilteredQueue queue8 = new PagingFilteredQueue("queue8", channelIDManager.getID(), ms, pm, true, false, -1, null);
        
         Binding binding8 =
            office.bindQueue(new SimpleCondition("condition2"), queue8);
        
        
         Collection bindings = office.getBindingsForCondition(new SimpleCondition("dummy"));
         assertNotNull(bindings);
         assertTrue(bindings.isEmpty());
        
         //We don't match on substrings
         bindings = office.getBindingsForCondition(new SimpleCondition("condition123"));
         assertNotNull(bindings);
         assertTrue(bindings.isEmpty());
        
         //We don't currently support hierarchies
         bindings = office.getBindingsForCondition(new SimpleCondition("condition1.subcondition"));
         assertNotNull(bindings);
         assertTrue(bindings.isEmpty());
        
         //We currently just do an exact match
         bindings = office.getBindingsForCondition(new SimpleCondition("condition1"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         Iterator iter = bindings.iterator();
         assertEquivalent((Binding)iter.next(), binding1);
         assertEquivalent((Binding)iter.next(), binding2);
         assertEquivalent((Binding)iter.next(), binding3);
         assertEquivalent((Binding)iter.next(), binding4);
        
         bindings = office.getBindingsForCondition(new SimpleCondition("condition2"));
         assertNotNull(bindings);
         assertEquals(4, bindings.size());
        
         iter = bindings.iterator();
         assertEquivalent((Binding)iter.next(), binding5);
View Full Code Here

Examples of org.jboss.test.messaging.core.SimpleCondition

        
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
        
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
        
         PagingFilteredQueue queue3 =
            new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
        
         PagingFilteredQueue queue4 =
            new PagingFilteredQueue("queue4", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue4);
        
         PagingFilteredQueue queue5 =
            new PagingFilteredQueue("queue5", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue5);
        
         PagingFilteredQueue queue6 =
            new PagingFilteredQueue("queue6", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic2"), queue6);
     
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
         SimpleReceiver receiver4 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue4.add(receiver4);
         SimpleReceiver receiver5 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue5.add(receiver5);
         SimpleReceiver receiver6 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue6.add(receiver6);
        
         queue1.deactivate();
         queue2.deactivate();
         queue5.deactivate();
         queue6.deactivate();
        
         assertFalse(queue1.isActive());     
         assertFalse(queue2.isActive());
         assertFalse(queue5.isActive());
         assertFalse(queue6.isActive());
         assertTrue(queue3.isActive());
         assertTrue(queue4.isActive());     
        
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
        
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver2.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver3.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
         Message msgRec = (Message)msgs.get(0);
         assertTrue(msg1 == msgRec);
         receiver3.acknowledge(msgRec, null);
         msgs = queue3.browse();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty())
        
         msgs = receiver4.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver5.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         msgs = receiver6.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
        
         receiver3.clear();
                    
         Message msg2 = CoreMessageFactory.createCoreMessage(2);     
         MessageReference ref2 = ms.reference(msg2);
        
         routed = postOffice.route(ref2, new SimpleCondition("topic2"), null);     
         assertTrue(routed);
        
         msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertTrue(msgs.isEmpty());
View Full Code Here

Examples of org.jboss.test.messaging.core.SimpleCondition

        
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("condition1"), queue1);
             
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);;
         queue1.add(receiver1);
  
         assertTrue(queue1.isActive());
  
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);
        
         boolean routed =
            postOffice.route(ref1, new SimpleCondition("this won't match anything"), null);
        
         assertFalse(routed);
              
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
View Full Code Here

Examples of org.jboss.test.messaging.core.SimpleCondition

     
         PagingFilteredQueue queue1 =
            new PagingFilteredQueue("queue1", channelIDManager.getID(), ms, pm, true, false,
                                    -1, filter);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue1);
        
         PagingFilteredQueue queue2 =
            new PagingFilteredQueue("queue2", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue2);
        
         PagingFilteredQueue queue3 =
            new PagingFilteredQueue("queue3", channelIDManager.getID(), ms, pm, true, false,
                                    -1, null);
        
         postOffice.bindQueue(new SimpleCondition("topic1"), queue3);
        
         SimpleReceiver receiver1 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue1.add(receiver1);
         SimpleReceiver receiver2 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue2.add(receiver2);
         SimpleReceiver receiver3 = new SimpleReceiver("blah", SimpleReceiver.ACCEPTING);
         queue3.add(receiver3);
        
         Message msg1 = CoreMessageFactory.createCoreMessage(1);     
         MessageReference ref1 = ms.reference(msg1);        
         boolean routed = postOffice.route(ref1, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
         Message msg2 = CoreMessageFactory.createCoreMessage(2);     
         MessageReference ref2 = ms.reference(msg2);        
         routed = postOffice.route(ref2, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
         Message msg3 = CoreMessageFactory.createCoreMessage(3);     
         MessageReference ref3 = ms.reference(msg3);        
         routed = postOffice.route(ref3, new SimpleCondition("topic1"), null);     
         assertTrue(routed);
        
         List msgs = receiver1.getMessages();
         assertNotNull(msgs);
         assertEquals(1, msgs.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.