Refine search
@Override public Configuration get() { ConfigurationBuilder builder = new ConfigurationBuilder() .marshaller(new HotRodMarshaller(this.module.get())) .connectionTimeout(this.connectionTimeout) return builder.build();
public static RemoteCache<String,String> getExecCache() { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("127.0.0.1").port(11222); RemoteCacheManager cacheManager = new RemoteCacheManager(builder.build()); return cacheManager.getCache(); }
/** * Overrides the default remote cache manager. */ @Produces @ApplicationScoped public static RemoteCacheManager defaultRemoteCacheManager() { return new RemoteCacheManager( new org.infinispan.client.hotrod.configuration.ConfigurationBuilder() .addServers("127.0.0.1:" + hotRodServer.getPort()).build()); }
/** * Overrides the default remote cache manager. */ @Produces @ApplicationScoped public static RemoteCacheManager defaultRemoteCacheManager() { return new RemoteCacheManager( new org.infinispan.client.hotrod.configuration.ConfigurationBuilder() .addServers("127.0.0.1:" + hotRodServer.getPort()).build()); }
/** * @see InitializingBean#afterPropertiesSet() */ @Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.withProperties(configurationPropertiesToUse); this.nativeRemoteCacheManager = new RemoteCacheManager(clientBuilder.build(), this.startAutomatically); this.logger.info("Finished creating new instance of RemoteCacheManager"); }
public static RemoteCache<String,String> getDataCache() { // Create a configuration for a locally-running server ConfigurationBuilder builder = new ConfigurationBuilder(); builder .addServer().host("127.0.0.1").port(11222) .marshaller(UTF8StringMarshaller.class); RemoteCacheManager cacheManager = new RemoteCacheManager(builder.build()); final RemoteCache<String, String> cache = cacheManager.getCache(); cache.clear(); return cache; }
public static void main(String[] args) { // Create a configuration for a locally-running server ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("127.0.0.1").port(ConfigurationProperties.DEFAULT_HOTROD_PORT); // Connect to the server RemoteCacheManager cacheManager = new RemoteCacheManager(builder.build()); // Obtain the remote cache RemoteCache<String, String> cache = cacheManager.getCache(); /// Store a value cache.put("key", "value"); // Retrieve the value and print it out System.out.printf("key = %s\n", cache.get("key")); // Stop the cache manager and release all resources cacheManager.stop(); }
/** * Produces a specific cache manager for the small cache. * * @see Small */ @Small @Produces @ApplicationScoped public static RemoteCacheManager smallRemoteCacheManager() { return new RemoteCacheManager( new org.infinispan.client.hotrod.configuration.ConfigurationBuilder() .addServers("127.0.0.1:" + hotRodServer.getPort()).build()); }
public static RemoteCacheManager createNoAuth(InetAddress ip, int port) { ConfigurationBuilder clientBuilder = new ConfigurationBuilder(); clientBuilder = withIpAndPort(clientBuilder, ip, port); clientBuilder = withSingleConnection(clientBuilder); return new RemoteCacheManager(clientBuilder.build()); }
private void buildScriptCacheManager() throws ResourceException { try { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServers(remoteServerList); builder.marshaller(new GenericJBossMarshaller()); handleSecurity(builder); // note this object is expensive, so there needs to only one // instance for the JVM, in this case one per RA instance. this.scriptCacheManager = new RemoteCacheManager(builder.build()); this.scriptCacheManager.start(); } catch (Throwable e) { throw new ResourceException(e); } }
public RemoteCacheManager build() { ConfigurationBuilder builder = new ConfigurationBuilder() .classLoader( HotRodClientBuilder.class.getClassLoader() ) .withProperties( config.getClientProperties() ) .marshaller( this.marshaller ); if ( platform != null && !TransactionMode.NONE.equals( transactionMode ) ) { builder.transaction().transactionMode( transactionMode ); builder.transaction().transactionManagerLookup( new TransactionManagerLookupDelegator( platform ) ); } return new RemoteCacheManager( builder.build() ); }
public InfinispanConfiguration build() { ConfigurationBuilder builder = new ConfigurationBuilder(); if (this.infinispanConfiguration.getConfigurationProperties() != null) builder.withProperties(this.infinispanConfiguration.getConfigurationProperties()); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(builder.build()); BasicCache<Object, Object> basicCache = this.infinispanConfiguration.getCacheName() == null ? remoteCacheManager.getCache() : remoteCacheManager.getCache(this.infinispanConfiguration.getCacheName()); this.infinispanConfiguration.setCache(basicCache); return this.infinispanConfiguration; }
public InfinispanConfiguration build() { ConfigurationBuilder builder = new ConfigurationBuilder(); if (this.infinispanConfiguration.getConfigurationProperties() != null) builder.withProperties(this.infinispanConfiguration.getConfigurationProperties()); RemoteCacheManager remoteCacheManager = new RemoteCacheManager(builder.build()); BasicCache<Object, Object> basicCache = this.infinispanConfiguration.getCacheName() == null ? remoteCacheManager.getCache() : remoteCacheManager.getCache(this.infinispanConfiguration.getCacheName()); this.infinispanConfiguration.setCache(basicCache); return this.infinispanConfiguration; }
public static RemoteCacheManager createWithSni(InetAddress ip, int port, String sniHostName, String trustorePath, char[] password) { ConfigurationBuilder clientBuilder = new ConfigurationBuilder(); clientBuilder = withIpAndPort(clientBuilder, ip, port); clientBuilder = withSni(clientBuilder, sniHostName, trustorePath, password); clientBuilder = withSingleConnection(clientBuilder); return new RemoteCacheManager(clientBuilder.build()); }
public static RemoteCacheManager createWithSsl(InetAddress ip, int port, String trustorePath, char[] password) { ConfigurationBuilder clientBuilder = new ConfigurationBuilder(); clientBuilder = withIpAndPort(clientBuilder, ip, port); clientBuilder = withSsl(clientBuilder, trustorePath, password); clientBuilder = withSingleConnection(clientBuilder); return new RemoteCacheManager(clientBuilder.build()); }
public InfinispanRemoteCacheManager(KiWiConfiguration configuration) { this.configuration = configuration; Configuration remoteCfg = new ConfigurationBuilder() .addServer() .host(configuration.getClusterAddress()) .port(configuration.getClusterPort()) .marshaller(new CustomJBossMarshaller()) .socketTimeout(configuration.getClusterTimeout()) .connectionTimeout(configuration.getClusterTimeout()) .build(); cacheManager = new RemoteCacheManager(remoteCfg); log.info("initialised Infinispan remote cache manager (servers: {})", configuration.getClusterAddress()); }
@BeforeClass public void setupRemoteCacheFactory() { hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19733); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
@BeforeClass public void setupRemoteCacheFactory() { hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 19733); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
@BeforeClass public void setupRemoteCacheFactory() { hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, 0); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host("localhost").port(hotrodServer.getPort()); remoteCacheManager = new RemoteCacheManager(builder.build()); }
private void createHotRodCache(HotRodServer server) { hotrod = server; hotrodClient = new RemoteCacheManager(new ConfigurationBuilder() .addServers("localhost:" + hotrod.getPort()) .addJavaSerialWhiteList(".*Person.*", ".*CustomEvent.*") .marshaller(marshaller) .build()); hotrodCache = cacheName.isEmpty() ? hotrodClient.getCache() : hotrodClient.getCache(cacheName); }