/** * After having parsed the Infinispan configuration file, we might want to override the specified JGroups * configuration file. * * @param builderHolder * @param transportOverrideResource The alternative JGroups configuration file to be used, or null */ private void patchTransportConfiguration(ConfigurationBuilderHolder builderHolder, String transportOverrideResource) { if (transportOverrideResource != null) { builderHolder.getGlobalConfigurationBuilder().transport().addProperty("configurationFile", transportOverrideResource); } }
public static void registerChannel(GlobalConfigurationBuilder gcb, JChannel channel, String nodeName, boolean connect) { TransportConfigurationBuilder tcb = gcb.transport(); tcb.defaultTransport(); tcb.addProperty(JGroupsTransport.CHANNEL_LOOKUP, CustomChannelLookup.class.getName()); tcb.addProperty("customNodeName", nodeName); tcb.addProperty("customConnect", Boolean.toString(connect)); channelMap.put(nodeName, channel); }
.transport() .defaultTransport() .addProperty("configurationFile", jgroupsConfig);
.transport() .defaultTransport() .addProperty("configurationFile", jgroupsConfig);
.addProperty("configurationFile", "default-configs/default-jgroups-kubernetes.xml") .build();
@Override protected GlobalConfigurationBuilder createGlobalConfigurationBuilder() { GlobalConfigurationBuilder global = new GlobalConfigurationBuilder(); global.globalJmxStatistics().enable().allowDuplicateDomains(true); global.transport().defaultTransport().clusterName(repoName); global.transport().addProperty("configurationFile", "openl-jgroups-mosh-config.xml"); return global; } };
public void channelLookupTest() { when(mockChannel.getAddress()).thenReturn(a); when(mockChannel.down(isA(Event.class))).thenReturn(a); when(mockChannel.getView()).thenReturn(v); when(mockChannel.getProtocolStack()).thenReturn(ps); when(ps.getTransport()).thenReturn(new UDP()); EmbeddedCacheManager cm = null; try { GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder(); gc.transport().defaultTransport().addProperty("channelLookup", DummyLookup.class.getName()); cm = TestCacheManagerFactory.createClusteredCacheManager(gc, new ConfigurationBuilder()); cm.start(); cm.getCache(); GlobalComponentRegistry gcr = TestingUtil.extractGlobalComponentRegistry(cm); Transport t = gcr.getComponent(Transport.class); assertNotNull(t); assertTrue(t instanceof JGroupsTransport); assertNotSame(JChannel.class, ((JGroupsTransport) t).getChannel().getClass()); } finally { TestingUtil.killCacheManagers(cm); } }
builder.transport().addProperty("configurationXml", jgroupsXML);
.clusterName(config.getClusterName()) .machineId("instance-" + config.getDatacenterId()) .addProperty("configurationXml", jgroupsXml) .distributedSyncTimeout(config.getClusterTimeout()) .globalJmxStatistics()
private EmbeddedCacheManager createCacheManagerProgrammatically() { System.out.println("Starting a cache manager with a programmatic configuration"); DefaultCacheManager cacheManager = new DefaultCacheManager( GlobalConfigurationBuilder.defaultClusteredBuilder() .transport().nodeName(nodeName).addProperty("configurationFile", "jgroups.xml") .build(), new ConfigurationBuilder() .clustering() .cacheMode(CacheMode.REPL_SYNC) .build() ); // The only way to get the "repl" cache to be exactly the same as the default cache is to not define it at all cacheManager.defineConfiguration("dist", new ConfigurationBuilder() .clustering() .cacheMode(CacheMode.DIST_SYNC) .hash().numOwners(2) .build() ); return cacheManager; }
private static void amendTransport(GlobalConfigurationBuilder builder, TransportFlags flags) { String testName = TestResourceTracker.getCurrentTestName(); GlobalConfiguration gc = builder.build(); if (gc.transport().transport() != null) { // Remove any configuration file that might have been set. builder.transport().removeProperty(JGroupsTransport.CONFIGURATION_FILE); builder.transport().addProperty(JGroupsTransport.CONFIGURATION_STRING, getJGroupsConfig(testName, flags)); } }
.clusterName(config.getClusterName()) .machineId("instance-" + config.getDatacenterId()) .addProperty("configurationXml", jgroupsXml) .distributedSyncTimeout(config.getClusterTimeout()) .globalJmxStatistics()
.clusterName(clusterName) .machineId(machineName) .addProperty("configurationXml", jgroupsXml) .globalJmxStatistics() .jmxDomain("org.apache.marmotta.ldcache") .clusterName(clusterName) .machineId(machineName) .addProperty("configurationFile", "jgroups-ldcache.xml") .globalJmxStatistics() .jmxDomain("org.apache.marmotta.ldcache")
private EmbeddedCacheManager infinispanCacheManager() { // Embedded Cluster Setting! GlobalConfigurationBuilder global = GlobalConfigurationBuilder.defaultClusteredBuilder(); global.clusteredDefault() .globalJmxStatistics() .allowDuplicateDomains(true) .transport() .addProperty("configurationFile", configFile) .clusterName("metatron-discovery-v20"); ConfigurationBuilder config = new ConfigurationBuilder(); config.expiration().lifespan(5, TimeUnit.SECONDS); config.clustering().cacheMode(CacheMode.DIST_SYNC); DefaultCacheManager cacheManager = new DefaultCacheManager(global.build(), config.build()); cacheManager.addListener(new InfinispanClusterListener(2)); return cacheManager; } }
GlobalConfigurationBuilder gcb = new GlobalConfigurationBuilder(); gcb.transport().defaultTransport().nodeName(nodeName) .addProperty(JGroupsTransport.CONFIGURATION_STRING, configurator.getProtocolStackString()); BlockingThreadPoolExecutorFactory transportExecutorFactory = new BlockingThreadPoolExecutorFactory( TRANSPORT_MAX_THREADS, TRANSPORT_MAX_THREADS, TRANSPORT_QUEUE_SIZE, 60000);