Search in sources :

Example 1 with Configuration

use of org.infinispan.client.hotrod.configuration.Configuration in project hazelcast-simulator by hazelcast.

the class InfinispanDriver method startVendorInstance.

@Override
public void startVendorInstance() throws Exception {
    String workerType = get("WORKER_TYPE");
    if ("javaclient".equals(workerType)) {
        Properties hotrodProperties = new Properties();
        hotrodProperties.setProperty("infinispan.client.hotrod.server_list", get("server_list"));
        Configuration configuration = new ConfigurationBuilder().withProperties(hotrodProperties).build();
        RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration);
        this.cacheContainer = remoteCacheManager;
        remoteCacheManager.start();
    } else {
        DefaultCacheManager defaultCacheManager = new DefaultCacheManager("infinispan.xml");
        this.cacheContainer = defaultCacheManager;
        defaultCacheManager.start();
        HotRodServerConfiguration hotRodServerConfiguration = new HotRodServerConfigurationBuilder().host(get("PRIVATE_ADDRESS")).port(11222).build();
        this.hotRodServer = new HotRodServer();
        hotRodServer.start(hotRodServerConfiguration, defaultCacheManager);
    }
}
Also used : ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) DefaultCacheManager(org.infinispan.manager.DefaultCacheManager) Configuration(org.infinispan.client.hotrod.configuration.Configuration) HotRodServerConfiguration(org.infinispan.server.hotrod.configuration.HotRodServerConfiguration) HotRodServer(org.infinispan.server.hotrod.HotRodServer) HotRodServerConfiguration(org.infinispan.server.hotrod.configuration.HotRodServerConfiguration) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) Properties(java.util.Properties)

Example 2 with Configuration

use of org.infinispan.client.hotrod.configuration.Configuration in project wildfly by wildfly.

the class RemoteCacheContainerServiceConfigurator method get.

@Override
public RemoteCacheManager get() {
    Configuration configuration = this.configuration.get();
    RemoteCacheManager container = new RemoteCacheManager(this.name, configuration, this.registrar);
    container.start();
    InfinispanLogger.ROOT_LOGGER.remoteCacheContainerStarted(this.name);
    return container;
}
Also used : RemoteCacheManager(org.wildfly.clustering.infinispan.client.manager.RemoteCacheManager) Configuration(org.infinispan.client.hotrod.configuration.Configuration)

Example 3 with Configuration

use of org.infinispan.client.hotrod.configuration.Configuration in project wildfly by wildfly.

the class RemoteCacheContainerConfigurationServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<Configuration> configuration = new CompositeDependency(this.loader, this.modules, this.connectionPool, this.security, this.server).register(builder).provides(this.getServiceName());
    for (Dependency dependency : this.threadPools.values()) {
        dependency.register(builder);
    }
    for (List<SupplierDependency<OutboundSocketBinding>> dependencies : this.clusters.values()) {
        for (Dependency dependency : dependencies) {
            dependency.register(builder);
        }
    }
    Service service = new FunctionalService<>(configuration, Function.identity(), this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : SecurityConfiguration(org.infinispan.client.hotrod.configuration.SecurityConfiguration) ExecutorFactoryConfiguration(org.infinispan.client.hotrod.configuration.ExecutorFactoryConfiguration) ConnectionPoolConfiguration(org.infinispan.client.hotrod.configuration.ConnectionPoolConfiguration) Configuration(org.infinispan.client.hotrod.configuration.Configuration) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) FunctionalService(org.wildfly.clustering.service.FunctionalService) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) SupplierDependency(org.wildfly.clustering.service.SupplierDependency) ServiceSupplierDependency(org.wildfly.clustering.service.ServiceSupplierDependency) Dependency(org.wildfly.clustering.service.Dependency) SupplierDependency(org.wildfly.clustering.service.SupplierDependency) ServiceSupplierDependency(org.wildfly.clustering.service.ServiceSupplierDependency)

Aggregations

Configuration (org.infinispan.client.hotrod.configuration.Configuration)3 Properties (java.util.Properties)1 RemoteCacheManager (org.infinispan.client.hotrod.RemoteCacheManager)1 ConfigurationBuilder (org.infinispan.client.hotrod.configuration.ConfigurationBuilder)1 ConnectionPoolConfiguration (org.infinispan.client.hotrod.configuration.ConnectionPoolConfiguration)1 ExecutorFactoryConfiguration (org.infinispan.client.hotrod.configuration.ExecutorFactoryConfiguration)1 SecurityConfiguration (org.infinispan.client.hotrod.configuration.SecurityConfiguration)1 DefaultCacheManager (org.infinispan.manager.DefaultCacheManager)1 HotRodServer (org.infinispan.server.hotrod.HotRodServer)1 HotRodServerConfiguration (org.infinispan.server.hotrod.configuration.HotRodServerConfiguration)1 HotRodServerConfigurationBuilder (org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder)1 Service (org.jboss.msc.Service)1 RemoteCacheManager (org.wildfly.clustering.infinispan.client.manager.RemoteCacheManager)1 CompositeDependency (org.wildfly.clustering.service.CompositeDependency)1 Dependency (org.wildfly.clustering.service.Dependency)1 FunctionalService (org.wildfly.clustering.service.FunctionalService)1 ServiceSupplierDependency (org.wildfly.clustering.service.ServiceSupplierDependency)1 SupplierDependency (org.wildfly.clustering.service.SupplierDependency)1