public class DefaultClientConnectionStrategy extends ClientConnectionStrategy
clientConnectionStrategyConfig, clientContext, logger| Constructor and Description | 
|---|
DefaultClientConnectionStrategy()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
beforeConnectToCluster(Address target)
If a cluster connection is established, this method will be called. 
 | 
void | 
beforeGetConnection(Address target)
The purpose of this method is to validate a connection request by target, and exit the blocking invocation. 
 | 
void | 
beforeOpenConnection(Address target)
If a new connection is required to open by  
ClientConnectionManager,
 this method will be called. | 
void | 
onConnect(ClientConnection connection)
If the  
ClientConnectionManager opens a new connection to a member,
 this method will be called with the connection parameter | 
void | 
onConnectToCluster()
If a cluster connection is established, this method will be called. 
 | 
void | 
onDisconnect(ClientConnection connection)
If a connection is disconnected, this method will be called with the connection parameter 
 | 
void | 
onDisconnectFromCluster()
If the cluster connection is lost for any reason, this method will be called. 
 | 
void | 
shutdown()
The  
ClientConnectionManager will call this method as a last step of its shutdown. | 
void | 
start()
Called after  
ClientConnectionManager started. | 
initpublic void start()
ClientConnectionStrategyClientConnectionManager started.
 Connecting to cluster can be triggered from this method using one of
 ClientConnectionManager.connectToCluster() or
 ClientConnectionManager.connectToClusterAsync()start in class ClientConnectionStrategypublic void beforeGetConnection(Address target)
ClientConnectionStrategyClientConnectionManager this method will be called.
 The build in retry mechanism can be stopped by throwing an instance of non retryable exceptions;
 IOException, HazelcastInstanceNotActiveException or
 RetryableException
 The thrown exception will be received on the blocking user. Any blocking invocation will exit by that exception.beforeGetConnection in class ClientConnectionStrategytarget - address of the requested connectionpublic void beforeOpenConnection(Address target)
ClientConnectionStrategyClientConnectionManager,
 this method will be called.
 This request can be rejected by throwing an instance of non retryable exceptions;
 IOException, HazelcastInstanceNotActiveException or
 RetryableExceptionbeforeOpenConnection in class ClientConnectionStrategytarget - address of the requested connectionpublic void beforeConnectToCluster(Address target)
ClientConnectionStrategybeforeConnectToCluster in class ClientConnectionStrategytarget - address of the requested connectionpublic void onConnectToCluster()
ClientConnectionStrategyonConnectToCluster in class ClientConnectionStrategypublic void onDisconnectFromCluster()
ClientConnectionStrategyonDisconnectFromCluster in class ClientConnectionStrategypublic void onConnect(ClientConnection connection)
ClientConnectionStrategyClientConnectionManager opens a new connection to a member,
 this method will be called with the connection parameteronConnect in class ClientConnectionStrategyconnection - the new established connectionpublic void onDisconnect(ClientConnection connection)
ClientConnectionStrategyonDisconnect in class ClientConnectionStrategyconnection - the closed connectionpublic void shutdown()
ClientConnectionStrategyClientConnectionManager will call this method as a last step of its shutdown.shutdown in class ClientConnectionStrategyCopyright © 2019 Hazelcast, Inc.. All Rights Reserved.