public static HotRodServer startHotRodServer(EmbeddedCacheManager manager, int port, int idleTimeout, String proxyHost, int proxyPort, long delay, String defaultCacheName) { HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); builder.proxyHost(proxyHost).proxyPort(proxyPort).idleTimeout(idleTimeout).defaultCacheName(defaultCacheName); return startHotRodServer(manager, port, delay, builder); }
private void configureProtocolServerTopology(OperationContext context, HotRodServerConfigurationBuilder builder, ModelNode config) throws OperationFailedException { if (config.hasDefined(ModelKeys.TOPOLOGY_STATE_TRANSFER) && config.get(ModelKeys.TOPOLOGY_STATE_TRANSFER, ModelKeys.TOPOLOGY_STATE_TRANSFER_NAME).isDefined()) { config = config.get(ModelKeys.TOPOLOGY_STATE_TRANSFER, ModelKeys.TOPOLOGY_STATE_TRANSFER_NAME); if (config.hasDefined(ModelKeys.LOCK_TIMEOUT)) { builder.topologyLockTimeout(TopologyStateTransferResource.LOCK_TIMEOUT.resolveModelAttribute(context, config).asLong()); } if (config.hasDefined(ModelKeys.REPLICATION_TIMEOUT)) { builder.topologyReplTimeout(TopologyStateTransferResource.REPLICATION_TIMEOUT.resolveModelAttribute(context, config).asLong()); } if (config.hasDefined(ModelKeys.EXTERNAL_HOST)) { builder.proxyHost(TopologyStateTransferResource.EXTERNAL_HOST.resolveModelAttribute(context, config).asString()); } if (config.hasDefined(ModelKeys.EXTERNAL_PORT)) { builder.proxyPort(TopologyStateTransferResource.EXTERNAL_PORT.resolveModelAttribute(context, config).asInt()); } if (config.hasDefined(ModelKeys.LAZY_RETRIEVAL)) { builder.topologyStateTransfer(!TopologyStateTransferResource.LAZY_RETRIEVAL.resolveModelAttribute(context, config).asBoolean()); } if (config.hasDefined(ModelKeys.AWAIT_INITIAL_RETRIEVAL)) { builder.topologyAwaitInitialTransfer(TopologyStateTransferResource.AWAIT_INITIAL_RETRIEVAL.resolveModelAttribute(context, config).asBoolean()); } } } }
public static HotRodServerConfigurationBuilder getDefaultHotRodConfiguration() { HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); int port = serverPort(); builder.host(host()).port(port).proxyHost(host()).proxyPort(port); return builder; }
@Override protected HotRodServer createStartHotRodServer(EmbeddedCacheManager cacheManager) { HotRodServerConfigurationBuilder builder = new HotRodServerConfigurationBuilder(); builder.proxyHost(host()).proxyPort(serverPort()).idleTimeout(0); builder.ssl().enable() .keyStoreFileName(keyStoreFileName) .keyStorePassword("secret".toCharArray()) .keyStoreType("pkcs12") .trustStoreFileName(trustStoreFileName) .trustStorePassword("secret".toCharArray()) .trustStoreType("pkcs12"); return startHotRodServer(cacheManager, serverPort(), -1, builder); }