Examples of InboundInvocationHandler


Examples of org.infinispan.remoting.InboundInvocationHandler

      assertNotNull(stm0.getCacheTopology().getPendingCH());
      assertEquals(Arrays.asList(address(0), address(1), address(2)), stm0.getCacheTopology().getPendingCH().locateOwners("k1"));

      // Cache 0 didn't manage to request any segments yet, but it has registered all the inbound transfer tasks.
      // We'll pretend it got a StateResponseCommand with an older topology id.
      InboundInvocationHandler iih = TestingUtil.extractGlobalComponent(manager(0), InboundInvocationHandler.class);
      StateChunk stateChunk0 = new StateChunk(0, Arrays.<InternalCacheEntry>asList(new ImmortalCacheEntry("k0", "v0")), true);
      StateChunk stateChunk1 = new StateChunk(1, Arrays.<InternalCacheEntry>asList(new ImmortalCacheEntry("k0", "v0")), true);
      StateResponseCommand stateResponseCommand = new StateResponseCommand(CacheContainer.DEFAULT_CACHE_NAME,
            address(1), initialTopologyId, Arrays.asList(stateChunk0, stateChunk1));
      // Call with preserveOrder = true to force the execution in the same thread
      iih.handle(stateResponseCommand, address(3), null, true);

      sequencer.exit("st:simulate_old_response");

      waitForRehashToComplete(cache(0), cache(1), cache(2), cache(3));
View Full Code Here

Examples of org.infinispan.remoting.InboundInvocationHandler

   }

   private void replaceInboundInvocationHandler() {
      if (ourHandler == null) {
         GlobalComponentRegistry globalComponentRegistry = cacheManager.getGlobalComponentRegistry();
         InboundInvocationHandler handler = globalComponentRegistry.getComponent(InboundInvocationHandler.class);
         ourHandler = new SequencerInboundInvocationHandler(handler, stateSequencer, matcher);
         TestingUtil.replaceComponent(cacheManager, InboundInvocationHandler.class, ourHandler, true);
         JGroupsTransport t = (JGroupsTransport) globalComponentRegistry.getComponent(Transport.class);
         CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
         TestingUtil.replaceField(ourHandler, "inboundInvocationHandler", card, CommandAwareRpcDispatcher.class);
View Full Code Here

Examples of org.infinispan.remoting.InboundInvocationHandler

      final Object key = new MagicKey(cache(0), cache(1));
      final Cache<Object, Object> futureBackupOwnerCache = cache(2);

      cache(0).put(key, INITIAL_VALUE);

      final InboundInvocationHandler spyHandler = spyInvocationHandler(futureBackupOwnerCache);
      final EntryFactory spyEntryFactory = spyEntryFactory(futureBackupOwnerCache);

      //it blocks the StateResponseCommand.class
      final CountDownLatch latch1 = new CountDownLatch(1);
      final CountDownLatch latch2 = new CountDownLatch(1);
View Full Code Here

Examples of org.infinispan.remoting.InboundInvocationHandler

      TestingUtil.replaceComponent(cache, EntryFactory.class, spy, true);
      return spy;
   }

   private InboundInvocationHandler spyInvocationHandler(Cache cache) {
      InboundInvocationHandler spy = Mockito.spy(extractComponent(cache, InboundInvocationHandler.class));
      JGroupsTransport t = (JGroupsTransport) extractComponent(cache, Transport.class);
      CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
      replaceField(spy, "inboundInvocationHandler", card, CommandAwareRpcDispatcher.class);
      return spy;
   }
View Full Code Here

Examples of org.infinispan.remoting.InboundInvocationHandler

         }
      });

      // Cache 0 didn't manage to send any StateRequestCommand yet.
      // We'll pretend it got a StateResponseCommand with an older topology id.
      InboundInvocationHandler iih = TestingUtil.extractGlobalComponent(manager(0), InboundInvocationHandler.class);
      StateChunk stateChunk = new StateChunk(0, Collections.<InternalCacheEntry>emptyList(), true);
      StateResponseCommand stateResponseCommand = new StateResponseCommand(CacheContainer.DEFAULT_CACHE_NAME,
            address(3), initialTopologyId, Arrays.asList(stateChunk));
      iih.handle(stateResponseCommand, address(3), null, false);

      crm.stopBlocking();

      TestingUtil.waitForRehashToComplete(cache(0), cache(1), cache(2));
View Full Code Here

Examples of org.infinispan.remoting.InboundInvocationHandler

   }

   private void replaceInvocationHandler(final CheckPoint checkPoint, final EmbeddedCacheManager manager,
                                         Class<? extends CacheRpcCommand> commandClass)
         throws Throwable {
      final InboundInvocationHandler handler = TestingUtil.extractGlobalComponent(manager,
            InboundInvocationHandler.class);
      InboundInvocationHandler mockHandler = mock(InboundInvocationHandler.class);
      doAnswer(new Answer<Object>() {
               @Override
               public Object answer(InvocationOnMock invocation) throws Throwable {
                  CacheRpcCommand command = (CacheRpcCommand) invocation.getArguments()[0];
                  Address source = (Address) invocation.getArguments()[1];
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.