@Override public NodeFactory<Address> getMemberFactory() { return this.factory.get(); } }
@Override public Cache<Address, Map.Entry<K, V>> getCache() { return this.cache.get(); } }
@Override public NodeFactory<Address> getMemberFactory() { return this.group.get(); } }
@SuppressWarnings("unchecked") @Override public <K, V> Cache<K, V> getCache() { return (Cache<K, V>) this.cache.get(); }
@Override public ChannelFactory get() { List<ProtocolConfiguration<? extends Protocol>> protocols = new ArrayList<>(this.protocols.size()); for (Supplier<ProtocolConfiguration<? extends Protocol>> protocolDependency : this.protocols) { protocols.add(protocolDependency.get()); } return new ForkChannelFactory(this.parentChannel.get(), this.parentFactory.get(), protocols); }
@Override public Map<String, SocketBinding> getSocketBindings() { Map<String, SocketBinding> bindings = new HashMap<>(); SocketBinding binding = this.getSocketBinding(); for (String serviceName : Arrays.asList("jgroups.udp.mcast_sock", "jgroups.udp.sock", "jgroups.tcp.server", "jgroups.nio.server", "jgroups.tunnel.ucast_sock")) { bindings.put(serviceName, binding); } if (this.diagnosticsSocketBinding != null) { bindings.put("jgroups.tp.diag.mcast_sock", this.diagnosticsSocketBinding.get()); } return bindings; }
@Override public void accept(Configuration configuration) { this.container.get().undefineConfiguration(this.cacheName); } }
@Override public void accept(AUTH protocol) { protocol.setAuthToken(this.token.get()); } }
@Override public Cache<K, V> createCache(IdentifierFactory<K> identifierFactory, StatefulObjectFactory<V> factory, PassivationListener<V> passivationListener) { BeanManager<K, V, Batch> manager = this.factory.get().createBeanManager(identifierFactory, passivationListener, new RemoveListenerAdapter<>(factory)); return new DistributableCache<>(manager, factory, this.tsr.get()); } }
@Override public void accept(HotRodStoreConfigurationBuilder builder) { builder.cacheConfiguration(this.cacheConfiguration) .remoteCacheContainer(this.remoteCacheContainer.get()) ; } }
@Override public Cache<K, V> get() { Cache<K, V> cache = this.container.get().getCache(this.cacheName); cache.start(); return cache; }
@Override public Configuration get() { ConfigurationBuilder builder = new ConfigurationBuilder(); this.consumer.accept(builder); Configuration configuration = builder.build(); this.container.get().defineConfiguration(this.cacheName, configuration); return configuration; }
@Override public void accept(JdbcStringBasedStoreConfigurationBuilder builder) { builder.table().read(this.table.get()); for (TwoWayKey2StringMapper mapper : ServiceLoader.load(TwoWayKey2StringMapper.class, this.module.get().getClassLoader())) { builder.key2StringMapper(mapper.getClass()); break; } builder.dialect(this.dialect).connectionFactory(DataSourceConnectionFactoryConfigurationBuilder.class).setDataSourceDependency(this.dataSource); } }
@Override public RemoteCacheManager get() { Configuration configuration = this.configuration.get(); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration); remoteCacheManager.start(); InfinispanLogger.ROOT_LOGGER.remoteCacheContainerStarted(this.name); return remoteCacheManager; }
@Override public void accept(ChannelFactory factory) { ProtocolStack stack = this.parentChannel.get().getProtocolStack(); FORK fork = (FORK) stack.findProtocol(FORK.class); fork.remove(this.address.getLastElement().getValue()); }
@Override public void accept(ConfigurationBuilder builder) { super.accept(builder); HashConfigurationBuilder hash = builder.clustering().hash().numSegments(this.segments); // ConsistentHashStrategy.INTER_CACHE is Infinispan's default behavior if (this.consistentHashStrategy == ConsistentHashStrategy.INTRA_CACHE) { hash.consistentHashFactory(this.global.get().transport().hasTopologyInfo() ? new TopologyAwareConsistentHashFactory() : new DefaultConsistentHashFactory()); } } }