Package org.infinispan.remoting.transport.jgroups

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


      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 = (DELAY) ps.findProtocol(DELAY.class);
      if (delay==null) {
         delay = new DELAY();
         ps.insertProtocol(delay, ProtocolStack.ABOVE, TP.class);
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

   @Override
   public Channel getChannel()
   {
      if (this.cache == null) return null;
     
      JGroupsTransport transport = (JGroupsTransport) this.cache.getAdvancedCache().getRpcManager().getTransport();
     
      return transport.getChannel();
   }
View Full Code Here

   @Override
   public Channel getChannel()
   {
      if (this.cache == null) return null;
     
      JGroupsTransport transport = (JGroupsTransport) this.cache.getAdvancedCache().getRpcManager().getTransport();
     
      return transport.getChannel();
   }
View Full Code Here

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

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

                entry = new LockManagerEntry(transport.getChannel());

                debug("Started lock manager for \"%s\" container", containerName);

                container.addListener(entry);
View Full Code Here

      waitForClusterToForm();
   }

   private void replaceOn(Cache cache, InboundInvocationHandler replacement) {
      replaceComponent(cache.getCacheManager(), InboundInvocationHandler.class, replacement, true);
      JGroupsTransport t = (JGroupsTransport) extractComponent(cache, Transport.class);
      CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher();
      replaceField(replacement, "inboundInvocationHandler", card, CommandAwareRpcDispatcher.class);
   }
View Full Code Here

TOP

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

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.