Examples of DynamicCustomEventLogListener


Examples of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener

         remote.removeClientListener(eventListener);
      }
   }

   public void testCustomEventsDynamic() {
      DynamicCustomEventLogListener eventListener = new DynamicCustomEventLogListener();
      Cache<Integer, String> embedded = cacheFactory.getEmbeddedCache();
      RemoteCache<Integer, String> remote = cacheFactory.getHotRodCache();
      remote.addClientListener(eventListener, null, new Object[]{2});
      try {
         eventListener.expectNoEvents();
         remote.put(1, "one");
         assertEquals("one", embedded.get(1));
         eventListener.expectOnlyCreatedCustomEvent(1, "one");
         remote.put(2, "two");
         assertEquals("two", embedded.get(2));
         eventListener.expectOnlyCreatedCustomEvent(2, null);
         remote.remove(1);
         assertNull(embedded.get(1));
         eventListener.expectOnlyRemovedCustomEvent(1, null);
         remote.remove(2);
         assertNull(embedded.get(2));
         eventListener.expectOnlyRemovedCustomEvent(2, null);
      } finally {
         remote.removeClientListener(eventListener);
      }
   }
View Full Code Here

Examples of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener

      NonExistingConverterFactoryListener eventListener = new NonExistingConverterFactoryListener();
      withClientListener(eventListener, new RemoteCacheManagerCallable(remoteCacheManager));
   }

   public void testParameterBasedConversion() {
      final DynamicCustomEventLogListener eventListener = new DynamicCustomEventLogListener();
      withClientListener(eventListener, null, new Object[]{2}, new RemoteCacheManagerCallable(remoteCacheManager) {
         @Override
         public void call() {
            RemoteCache<Integer, String> cache = rcm.getCache();
            eventListener.expectNoEvents();
            cache.put(1, "one");
            eventListener.expectOnlyCreatedCustomEvent(1, "one");
            cache.put(2, "two");
            eventListener.expectOnlyCreatedCustomEvent(2, null);
         }
      });
   }
View Full Code Here

Examples of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener

         @Override
         public void call() {
            staticEventListener.expectOnlyCreatedCustomEvent(1, "one");
         }
      });
      final DynamicCustomEventLogListener dynamicEventListener = new DynamicCustomEventLogListener();
      cache.put(2, "two");
      withClientListener(dynamicEventListener, null, new Object[]{2}, new RemoteCacheManagerCallable(remoteCacheManager) {
         @Override
         public void call() {
            dynamicEventListener.expectOnlyCreatedCustomEvent(2, null);
         }
      });
   }
View Full Code Here

Examples of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener

      NonExistingConverterFactoryListener eventListener = new NonExistingConverterFactoryListener();
      withClientListener(eventListener, new RemoteCacheManagerCallable(remoteCacheManager));
   }

   public void testParameterBasedConversion() {
      final DynamicCustomEventLogListener eventListener = new DynamicCustomEventLogListener();
      withClientListener(eventListener, null, new Object[]{2}, new RemoteCacheManagerCallable(remoteCacheManager) {
         @Override
         public void call() {
            RemoteCache<Integer, String> cache = rcm.getCache();
            eventListener.expectNoEvents();
            cache.put(1, "one");
            eventListener.expectOnlyCreatedCustomEvent(1, "one");
            cache.put(2, "two");
            eventListener.expectOnlyCreatedCustomEvent(2, null);
         }
      });
   }
View Full Code Here

Examples of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener

         @Override
         public void call() {
            staticEventListener.expectNoEvents();
         }
      });
      final DynamicCustomEventLogListener dynamicEventListener = new DynamicCustomEventLogListener();
      cache.put(2, "two");
      withClientListener(dynamicEventListener, null, new Object[]{2}, new RemoteCacheManagerCallable(remoteCacheManager) {
         @Override
         public void call() {
            staticEventListener.expectNoEvents();
View Full Code Here

Examples of org.infinispan.client.hotrod.event.CustomEventLogListener.DynamicCustomEventLogListener

         remote.removeClientListener(eventListener);
      }
   }

   public void testCustomEventsDynamic() {
      DynamicCustomEventLogListener eventListener = new DynamicCustomEventLogListener();
      Cache<Integer, String> embedded = cacheFactory.getEmbeddedCache();
      RemoteCache<Integer, String> remote = cacheFactory.getHotRodCache();
      remote.addClientListener(eventListener, null, new Object[]{2});
      try {
         eventListener.expectNoEvents();
         remote.put(1, "one");
         assertEquals("one", embedded.get(1));
         eventListener.expectOnlyCreatedCustomEvent(1, "one");
         remote.put(2, "two");
         assertEquals("two", embedded.get(2));
         eventListener.expectOnlyCreatedCustomEvent(2, null);
         remote.remove(1);
         assertNull(embedded.get(1));
         eventListener.expectOnlyRemovedCustomEvent(1, null);
         remote.remove(2);
         assertNull(embedded.get(2));
         eventListener.expectOnlyRemovedCustomEvent(2, null);
      } finally {
         remote.removeClientListener(eventListener);
      }
   }
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.