Examples of JGroupsTransport


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

      {
         LockManagerEntry entry = lockManagers.get(key);
        
         if (entry == null)
         {
            JGroupsTransport transport = (JGroupsTransport) cache.getAdvancedCache().getRpcManager().getTransport();

            entry = new LockManagerEntry(transport.getChannel());
           
            trace("Started lock manager for cluster %s", entry);
           
            ((EmbeddedCacheManager) container).addListener(this);
           
View Full Code Here

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

      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

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

      }
      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

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

    * @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

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

      .storeAsBinary().enable() //
      .build();
    this.manager = new DefaultCacheManager(gcb.build(), c);

    if(!local){
      JGroupsTransport transport = (JGroupsTransport) manager.getCache("first").getAdvancedCache().getRpcManager().getTransport();
      this.cacheChannel = new ForkChannel(transport.getChannel(), "drill-stack", "drill-hijacker", true, ProtocolStack.ABOVE, FRAG2.class, new COUNTER());
      this.counters = new CounterService(this.cacheChannel);
    }else{
      this.cacheChannel = null;
      this.counters = null;
    }
View Full Code Here

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

   public static GlobalConfigurationBuilder defaultClusteredBuilder() {
      GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
      builder
            .transport()
               .transport(new JGroupsTransport())
            .asyncTransportExecutor()
               .addProperty("threadNamePrefix", "asyncTransportThread");

      return builder;
   }
View Full Code Here

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

   public static GlobalConfigurationBuilder defaultClusteredBuilder() {
      GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder();
      builder
            .transport()
               .transport(new JGroupsTransport())
            .asyncTransportExecutor()
               .addProperty("threadNamePrefix", "asyncTransportThread");

      return builder;
   }
View Full Code Here

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

      List<JChannel> list = new ArrayList<JChannel>();
      if (parentChannel != null) {
         list.add(parentChannel);
         return list;
      }
      JGroupsTransport transport;
      while (service.cacheManager == null) {
         notReadyMessage("Cache manager is not ready", failOnNotReady);
         Thread.yield();
      }
      // For local caches it has there is no transport - check that we have at least one clustered cache
      boolean hasClustered = false;
      for (String cacheName : service.cacheManager.getCacheNames()) {
         if (service.isCacheClustered(service.cacheManager.getCache(cacheName))) {
            hasClustered = true;
            break;
         }
      }
      if (!hasClustered) return list;
      for (;;) {
         transport = (JGroupsTransport) ((DefaultCacheManager) service.cacheManager).getTransport();
         if (transport != null) break;
         notReadyMessage("Transport is not ready", failOnNotReady);
         Thread.yield();
      }
      JChannel channel;
      for(;;) {
         channel = (JChannel) transport.getChannel();
         if (channel != null && channel.getName() != null && channel.isOpen()) break;
         notReadyMessage("Channel " + channel + " is not ready", failOnNotReady);
         Thread.yield();
      }
      list.add(channel);
View Full Code Here

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

   protected void beforeCacheManagerStart(final DefaultCacheManager cacheManager) {
      if (jgroupsDumperEnabled) {
         scheduledExecutor.schedule(new Runnable() {
            @Override
            public void run() {
               JGroupsTransport transport = (JGroupsTransport) cacheManager.getTransport();
               if (transport == null || transport.getChannel() == null || !transport.getChannel().isOpen()) {
                  // JGroups are not initialized, wait
                  scheduledExecutor.schedule(this, 1, TimeUnit.SECONDS);
               } else {
                  jgroupsDumper = new JGroupsDumper(transport.getChannel().getProtocolStack());
                  jgroupsDumper.start();
               }
            }
         }, 0, TimeUnit.MILLISECONDS);
      }
View Full Code Here

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

      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();
      Field f = null;
      try {
         f = card.getClass().getDeclaredField("inboundInvocationHandler");
         f.setAccessible(true);
         f.set(card, lh);
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.