public class ClientStateListener extends Object implements LifecycleListener
| Constructor and Description | 
|---|
ClientStateListener(ClientConfig clientConfig)
Registers this instance with the provided client configuration 
 | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
awaitConnected()
Waits until the client is connected to cluster. 
 | 
boolean | 
awaitConnected(long timeout,
              TimeUnit unit)
Waits until the client is connected to cluster or the timeout expires. 
 | 
boolean | 
awaitDisconnected()
Waits until the client is disconnected from the cluster. 
 | 
boolean | 
awaitDisconnected(long timeout,
                 TimeUnit unit)
Waits until the client is disconnected from the cluster or the timeout expires. 
 | 
LifecycleEvent.LifecycleState | 
getCurrentState()  | 
boolean | 
isConnected()  | 
boolean | 
isShutdown()  | 
boolean | 
isStarted()  | 
void | 
stateChanged(LifecycleEvent event)
Called when instance's state changes. 
 | 
public ClientStateListener(ClientConfig clientConfig)
clientConfig - The client configuration to which this listener will be registeredpublic void stateChanged(LifecycleEvent event)
LifecycleListenerstateChanged in interface LifecycleListenerevent - the Lifecycle eventpublic boolean awaitConnected(long timeout,
                              TimeUnit unit)
                       throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argumentisShutdown getCurrentStateInterruptedExceptionpublic boolean awaitConnected()
                       throws InterruptedException
awaitConnected(long timeout, TimeUnit unit) returns.InterruptedExceptionpublic boolean awaitDisconnected(long timeout,
                                 TimeUnit unit)
                          throws InterruptedException
timeout - the maximum time to waitunit - the time unit of the timeout argumentisShutdown getCurrentStateInterruptedExceptionpublic boolean awaitDisconnected()
                          throws InterruptedException
awaitDisconnected(long timeout, TimeUnit unit) returns.InterruptedExceptionpublic boolean isConnected()
public boolean isShutdown()
public boolean isStarted()
public LifecycleEvent.LifecycleState getCurrentState()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.