public abstract class GridConnection
extends java.lang.Object
Represents connection(s) to one or more servers in a ScaleOut in-memory data grid.
A GridConnection instance is thread-safe, long-lived, and maintains a pool of TCP connections to a ScaleOut in-memory data grid.
Multiple Cache
instances should use the same GridConnection instance if they are connecting to the same
ScaleOut in-memory data grid.
Multiple GridConnection
's can be used for a single client to connect to many ScaleOut in-memory data grids.
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_connectionString
The connection string.
|
protected com.scaleout.client.messaging.GridMessagingService |
_messagingService
The messaging service.
|
Modifier | Constructor and Description |
---|---|
protected |
GridConnection()
Protected, hidden constructor.
|
protected |
GridConnection(java.lang.String connectionString)
private, hidden constructor.
|
Modifier and Type | Method and Description |
---|---|
static GridConnection |
connect(java.lang.String connectionString)
Connects to a ScaleOut in-memory data grid, returning a
GridConnection
instance that can be used with a CacheBuilder to create a Cache and access objects in the ScaleOut in-memory data grid. |
static GridConnection |
connect(java.lang.String connectionString,
BootstrapGatewayProvider bootstrapGatewayProvider)
Connects to a ScaleOut in-memory data grid, returning a
GridConnection
instance that can be used with a CacheBuilder to create a Cache and access objects in the ScaleOut in-memory data grid. |
abstract java.util.List<java.net.InetSocketAddress> |
getActiveGateways() |
protected java.lang.String _connectionString
protected com.scaleout.client.messaging.GridMessagingService _messagingService
protected GridConnection()
protected GridConnection(java.lang.String connectionString)
connectionString
- the connection string.public static GridConnection connect(java.lang.String connectionString) throws GridConnectException
Connects to a ScaleOut in-memory data grid, returning a GridConnection
instance that can be used with a CacheBuilder
to create a Cache
and access objects in the ScaleOut in-memory data grid.
connectionString
- String containing parameters for connecting to ScaleOut host(s).GridConnection
instanceGridConnectException
- if an error occurs when connecting to a host, invalid parameters in the connection string,
or there are no ScaleOut hosts available.public static GridConnection connect(java.lang.String connectionString, BootstrapGatewayProvider bootstrapGatewayProvider) throws GridConnectException
Connects to a ScaleOut in-memory data grid, returning a GridConnection
instance that can be used with a CacheBuilder
to create a Cache
and access objects in the ScaleOut in-memory data grid.
connectionString
- String containing parameters for connecting to ScaleOut host(s).bootstrapGatewayProvider
- an implementation of the BootstrapGatewayProvider. EC2 and GCP providers available.GridConnection
instanceGridConnectException
- if an error occurs when connecting to a host, invalid parameters in the connection string,
or there are no ScaleOut hosts available.public abstract java.util.List<java.net.InetSocketAddress> getActiveGateways()