Package org.infinispan.remoting

Examples of org.infinispan.remoting.ReplicationQueueImpl


   @SuppressWarnings("unchecked")
   public <T> T construct(Class<T> componentType) {
      ClusteringConfiguration clustering = configuration.clustering();
      if ((!clustering.cacheMode().isSynchronous()) && clustering.async().useReplQueue()) {
         ReplicationQueue replQueue = clustering.async().replQueue();
         return replQueue != null ? componentType.cast(replQueue) : (T) new ReplicationQueueImpl();
      } else {
         return null;
      }
   }
View Full Code Here


   @SuppressWarnings("unchecked")
   public <T> T construct(Class<T> componentType) {
      if ((!configuration.getCacheMode().isSynchronous()) && configuration.isUseReplQueue()) {
         String type = configuration.getReplQueueClass();
         if (type == null || type.equals(ReplicationQueueImpl.class.getName()))
            return componentType.cast(new ReplicationQueueImpl());
         else
            try {
               return componentType.cast(Util.loadClass(type, configuration.getClassLoader()).newInstance());
            } catch (Exception e) {
               throw new ConfigurationException(e);
View Full Code Here

@Test(testName = "replication.ReplQueueRestartTest", groups = "unit")
public class ReplQueueRestartTest extends AbstractInfinispanTest {

   @SuppressWarnings("unchecked")
   public void testReplQueueImpl() {
      ReplicationQueueImpl rqi = new ReplicationQueueImpl();
      ScheduledFuture sf = mock(ScheduledFuture.class);
      when(sf.cancel(eq(true))).thenReturn(true);

      ScheduledExecutorService ses = mock(ScheduledExecutorService.class);
      when(ses.scheduleWithFixedDelay(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class)))
         .thenReturn(sf);

      RpcManager rpc = mock(RpcManager.class);
      CommandsFactory commandsFactory = mock(CommandsFactory.class);

      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.clustering().cacheMode(CacheMode.REPL_ASYNC)
            .async().useReplQueue(true);

      rqi.injectDependencies(ses, rpc, builder.build(), commandsFactory, "");

      rqi.start();

      rqi.stop();
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   public <T> T construct(Class<T> componentType) {
      ClusteringConfiguration clustering = configuration.clustering();
      if ((!clustering.cacheMode().isSynchronous()) && clustering.async().useReplQueue()) {
         ReplicationQueue replQueue = clustering.async().replQueue();
         return replQueue != null ? componentType.cast(replQueue) : (T) new ReplicationQueueImpl();
      } else {
         return null;
      }
   }
View Full Code Here

@Test(testName = "replication.ReplQueueRestartTest", groups = "unit")
public class ReplQueueRestartTest extends AbstractInfinispanTest {

   @SuppressWarnings("unchecked")
   public void testReplQueueImpl() {
      ReplicationQueueImpl rqi = new ReplicationQueueImpl();
      ScheduledFuture sf = mock(ScheduledFuture.class);
      when(sf.cancel(eq(true))).thenReturn(true);

      ScheduledExecutorService ses = mock(ScheduledExecutorService.class);
      when(ses.scheduleWithFixedDelay(any(Runnable.class), anyLong(), anyLong(), any(TimeUnit.class)))
         .thenReturn(sf);

      RpcManager rpc = mock(RpcManager.class);
      CommandsFactory commandsFactory = mock(CommandsFactory.class);

      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.clustering().cacheMode(CacheMode.REPL_ASYNC)
            .async().useReplQueue(true);

      rqi.injectDependencies(ses, rpc, builder.build(), commandsFactory, "");

      rqi.start();

      rqi.stop();
   }
View Full Code Here

TOP

Related Classes of org.infinispan.remoting.ReplicationQueueImpl

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.