public class ConfigurationBuilder extends Object implements ConfigurationChildBuilder, Builder<Configuration>
Configuration
objects to pass to the
RemoteCacheManager.RemoteCacheManager(Configuration)
constructor.Constructor and Description |
---|
ConfigurationBuilder() |
Modifier and Type | Method and Description |
---|---|
ServerConfigurationBuilder |
addServer()
Adds a new remote server
|
ConfigurationBuilder |
addServers(String servers)
Adds a list of remote servers in the form: host1[:port][;host2[:port]]...
|
ExecutorFactoryConfigurationBuilder |
asyncExecutorFactory()
Configuration for the executor service used for asynchronous work on the Transport, including
asynchronous marshalling and Cache 'async operations' such as Cache.putAsync().
|
ConfigurationBuilder |
balancingStrategy(Class<? extends RequestBalancingStrategy> balancingStrategy)
For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the
servers according to this strategy.
|
ConfigurationBuilder |
balancingStrategy(String balancingStrategy)
For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the
servers according to this strategy.
|
Configuration |
build()
Builds a configuration object
|
Configuration |
build(boolean validate) |
ConfigurationBuilder |
classLoader(ClassLoader cl) |
ConnectionPoolConfigurationBuilder |
connectionPool()
Configures the connection pool
|
ConfigurationBuilder |
connectionTimeout(int connectionTimeout)
This property defines the maximum socket connect timeout before giving up connecting to the
server.
|
ConfigurationBuilder |
consistentHashImpl(int version,
Class<? extends ConsistentHash> consistentHashClass)
Defines the
ConsistentHash implementation to use for the specified version. |
ConfigurationBuilder |
consistentHashImpl(int version,
String consistentHashClass)
Defines the
ConsistentHash implementation to use for the specified version. |
Configuration |
create()
Create the configuration bean
|
ConfigurationBuilder |
forceReturnValues(boolean forceReturnValues)
Whether or not to implicitly FORCE_RETURN_VALUE for all calls.
|
ConfigurationBuilder |
keySizeEstimate(int keySizeEstimate)
This hint allows sizing of byte buffers when serializing and deserializing keys, to minimize array resizing.
|
ConfigurationBuilder |
marshaller(Class<? extends Marshaller> marshaller)
Allows you to specify a custom
Marshaller implementation to
serialize and deserialize user objects. |
ConfigurationBuilder |
marshaller(Marshaller marshaller)
Allows you to specify an instance of
Marshaller to serialize
and deserialize user objects. |
ConfigurationBuilder |
marshaller(String marshaller)
Allows you to specify a custom
Marshaller implementation to
serialize and deserialize user objects. |
ConfigurationBuilder |
pingOnStartup(boolean pingOnStartup)
If true, a ping request is sent to a back end server in order to fetch cluster's topology.
|
ConfigurationBuilder |
protocolVersion(String protocolVersion)
This property defines the protocol version that this client should use.
|
ConfigurationBuilder |
read(Configuration template)
Reads the configuration from an already created configuration bean into this builder.
|
ConfigurationBuilder |
socketTimeout(int socketTimeout)
This property defines the maximum socket read timeout in milliseconds before giving up waiting
for bytes from the server.
|
SslConfigurationBuilder |
ssl()
SSL Configuration
|
ConfigurationBuilder |
tcpNoDelay(boolean tcpNoDelay)
Affects TCP NODELAY on the TCP stack.
|
ConfigurationBuilder |
transportFactory(Class<? extends TransportFactory> transportFactory)
Controls which transport to use.
|
ConfigurationBuilder |
transportFactory(String transportFactory)
Controls which transport to use.
|
void |
validate()
Validate the data in this builder before building the configuration bean
|
ConfigurationBuilder |
valueSizeEstimate(int valueSizeEstimate)
This hint allows sizing of byte buffers when serializing and deserializing values, to minimize
array resizing.
|
ConfigurationBuilder |
withProperties(Properties properties)
Configures this builder using the specified properties
|
public ServerConfigurationBuilder addServer()
ConfigurationChildBuilder
addServer
in interface ConfigurationChildBuilder
public ConfigurationBuilder addServers(String servers)
ConfigurationChildBuilder
addServers
in interface ConfigurationChildBuilder
public ExecutorFactoryConfigurationBuilder asyncExecutorFactory()
ConfigurationChildBuilder
asyncExecutorFactory
in interface ConfigurationChildBuilder
public ConfigurationBuilder balancingStrategy(String balancingStrategy)
ConfigurationChildBuilder
balancingStrategy
in interface ConfigurationChildBuilder
public ConfigurationBuilder balancingStrategy(Class<? extends RequestBalancingStrategy> balancingStrategy)
ConfigurationChildBuilder
balancingStrategy
in interface ConfigurationChildBuilder
public ConfigurationBuilder classLoader(ClassLoader cl)
classLoader
in interface ConfigurationChildBuilder
public ConnectionPoolConfigurationBuilder connectionPool()
ConfigurationChildBuilder
connectionPool
in interface ConfigurationChildBuilder
public ConfigurationBuilder connectionTimeout(int connectionTimeout)
ConfigurationChildBuilder
connectionTimeout
in interface ConfigurationChildBuilder
public ConfigurationBuilder consistentHashImpl(int version, Class<? extends ConsistentHash> consistentHashClass)
ConfigurationChildBuilder
ConsistentHash
implementation to use for the specified version. By default,
ConsistentHashV1
is used for version 1 and ConsistentHashV2
is used for version 2.consistentHashImpl
in interface ConfigurationChildBuilder
public ConfigurationBuilder consistentHashImpl(int version, String consistentHashClass)
ConfigurationChildBuilder
ConsistentHash
implementation to use for the specified version. By default,
ConsistentHashV1
is used for version 1 and ConsistentHashV2
is used for version 2.consistentHashImpl
in interface ConfigurationChildBuilder
public ConfigurationBuilder forceReturnValues(boolean forceReturnValues)
ConfigurationChildBuilder
forceReturnValues
in interface ConfigurationChildBuilder
public ConfigurationBuilder keySizeEstimate(int keySizeEstimate)
ConfigurationChildBuilder
keySizeEstimate
in interface ConfigurationChildBuilder
public ConfigurationBuilder marshaller(String marshaller)
ConfigurationChildBuilder
Marshaller
implementation to
serialize and deserialize user objects. This method is mutually exclusive with ConfigurationChildBuilder.marshaller(Marshaller)
.marshaller
in interface ConfigurationChildBuilder
public ConfigurationBuilder marshaller(Class<? extends Marshaller> marshaller)
ConfigurationChildBuilder
Marshaller
implementation to
serialize and deserialize user objects. This method is mutually exclusive with ConfigurationChildBuilder.marshaller(Marshaller)
.marshaller
in interface ConfigurationChildBuilder
public ConfigurationBuilder marshaller(Marshaller marshaller)
ConfigurationChildBuilder
Marshaller
to serialize
and deserialize user objects. This method is mutually exclusive with ConfigurationChildBuilder.marshaller(Class)
.marshaller
in interface ConfigurationChildBuilder
public ConfigurationBuilder pingOnStartup(boolean pingOnStartup)
ConfigurationChildBuilder
pingOnStartup
in interface ConfigurationChildBuilder
public ConfigurationBuilder protocolVersion(String protocolVersion)
ConfigurationChildBuilder
protocolVersion
in interface ConfigurationChildBuilder
public ConfigurationBuilder socketTimeout(int socketTimeout)
ConfigurationChildBuilder
socketTimeout
in interface ConfigurationChildBuilder
public SslConfigurationBuilder ssl()
ConfigurationChildBuilder
ssl
in interface ConfigurationChildBuilder
public ConfigurationBuilder tcpNoDelay(boolean tcpNoDelay)
ConfigurationChildBuilder
tcpNoDelay
in interface ConfigurationChildBuilder
public ConfigurationBuilder transportFactory(String transportFactory)
ConfigurationChildBuilder
transportFactory
in interface ConfigurationChildBuilder
public ConfigurationBuilder transportFactory(Class<? extends TransportFactory> transportFactory)
ConfigurationChildBuilder
transportFactory
in interface ConfigurationChildBuilder
public ConfigurationBuilder valueSizeEstimate(int valueSizeEstimate)
ConfigurationChildBuilder
valueSizeEstimate
in interface ConfigurationChildBuilder
public ConfigurationBuilder withProperties(Properties properties)
ConfigurationChildBuilder
withProperties
in interface ConfigurationChildBuilder
public void validate()
Builder
validate
in interface Builder<Configuration>
public Configuration create()
Builder
create
in interface Builder<Configuration>
public Configuration build()
ConfigurationChildBuilder
build
in interface ConfigurationChildBuilder
public Configuration build(boolean validate)
public ConfigurationBuilder read(Configuration template)
Builder
read
in interface Builder<Configuration>
template
- the configuration from which to "clone" this config if needed.Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.