Package org.infinispan.remoting.transport.jgroups

Examples of org.infinispan.remoting.transport.jgroups.JGroupsTransport$NotifyMerge


      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


      public static BackupReceiverRepositoryWrapper replaceInCache(CacheContainer cacheContainer, BackupListener listener) {
         BackupReceiverRepository delegate = extractGlobalComponent(cacheContainer, BackupReceiverRepository.class);
         BackupReceiverRepositoryWrapper wrapper = new BackupReceiverRepositoryWrapper(delegate, listener);
         replaceComponent(cacheContainer, BackupReceiverRepository.class, wrapper, true);
         JGroupsTransport t = (JGroupsTransport) extractGlobalComponent(cacheContainer, Transport.class);
         CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
         replaceField(wrapper, "backupReceiverRepository", card, CommandAwareRpcDispatcher.class);
         return wrapper;
      }
View Full Code Here

      }
      return values;
   }

   public static DISCARD getDiscardForCache(Cache<?, ?> c) throws Exception {
      JGroupsTransport jgt = (JGroupsTransport) TestingUtil.extractComponent(c, Transport.class);
      Channel ch = jgt.getChannel();
      ProtocolStack ps = ch.getProtocolStack();
      DISCARD discard = new DISCARD();
      ps.insertProtocol(discard, ProtocolStack.ABOVE, TP.class);
      return discard;
   }
View Full Code Here

    * @param out_delay_millis
    * @return a reference to the DELAY instance being used by the JGroups stack
    * @throws Exception
    */
   public static DELAY setDelayForCache(Cache<?, ?> cache, int in_delay_millis, int out_delay_millis) throws Exception {
      JGroupsTransport jgt = (JGroupsTransport) TestingUtil.extractComponent(cache, Transport.class);
      Channel ch = jgt.getChannel();
      ProtocolStack ps = ch.getProtocolStack();
      DELAY delay = new DELAY();
      delay.setInDelay(in_delay_millis);
      delay.setOutDelay(out_delay_millis);
      ps.insertProtocol(delay, ProtocolStack.ABOVE, TP.class);
View Full Code Here

        synchronized (lockManagers) {
            LockManagerEntry entry = lockManagers.get(containerName);

            if (entry == null) {
                JGroupsTransport transport = (JGroupsTransport) cache.getAdvancedCache().getRpcManager().getTransport();

                ContextClassLoaderSwitcher.SwitchContext context = this.switcher.getSwitchContext(this.getClass().getClassLoader());

                try {
                    entry = new LockManagerEntry(transport.getChannel());
                } finally {
                    context.reset();
                }

                debug("Started lock manager for \"%s\" container", containerName);
View Full Code Here

   /**
    * Simulates a node crash, discarding all the messages from/to this node and then stopping the caches.
    */
   protected void crashCacheManagers(EmbeddedCacheManager... cacheManagers) {
      for (EmbeddedCacheManager cm : cacheManagers) {
         JGroupsTransport t = (JGroupsTransport) cm.getGlobalComponentRegistry().getComponent(Transport.class);
         Channel channel = t.getChannel();
         try {
            DISCARD discard = new DISCARD();
            discard.setDiscardAll(true);
            channel.getProtocolStack().insertProtocol(discard, ProtocolStack.ABOVE, TP.class);
         } catch (Exception e) {
View Full Code Here

                                            delegate.handleStateTransferState(cmd);
                                         }
                                      };
                                   }
                                };
                                JGroupsTransport t = (JGroupsTransport) extractGlobalComponent(wrapOn, Transport.class);
                                CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
                                replaceField(delegator, "backupReceiverRepository", card, CommandAwareRpcDispatcher.class);
                                return delegator;
                             }
                          }, true);
View Full Code Here

                                            delegate.handleStateTransferState(cmd);
                                         }
                                      };
                                   }
                                };
                                JGroupsTransport t = (JGroupsTransport) extractGlobalComponent(wrapOn, Transport.class);
                                CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
                                replaceField(delegator, "backupReceiverRepository", card, CommandAwareRpcDispatcher.class);
                                return delegator;
                             }
                          }, true);
View Full Code Here

      addClusterEnabledCacheManager(configuration);
   }

   private void injectListeningHandler(CacheContainer ecm, ListeningHandler lh) {
      replaceComponent(ecm, InboundInvocationHandler.class, lh, true);
      JGroupsTransport t = (JGroupsTransport) extractComponent(cache(0), Transport.class);
      CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
      replaceField(lh, "inboundInvocationHandler", card, CommandAwareRpcDispatcher.class);
   }
View Full Code Here

      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

TOP

Related Classes of org.infinispan.remoting.transport.jgroups.JGroupsTransport$NotifyMerge

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.