Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::lifecycle_listener Class Referencefinal

Listener object for listening lifecycle events of hazelcast instance. More...

#include <lifecycle_listener.h>

Public Member Functions

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listeneron_starting (Handler &&h) &
 Set an handler function to be invoked when the client is starting. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener && on_starting (Handler &&h) &&
 Set an handler function to be invoked when the client is starting. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listeneron_started (Handler &&h) &
 Set an handler function to be invoked when the client has started. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener && on_started (Handler &&h) &&
 Set an handler function to be invoked when the client has started. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listeneron_shutting_down (Handler &&h) &
 Set an handler function to be invoked when the client is shutting down. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener && on_shutting_down (Handler &&h) &&
 Set an handler function to be invoked when the client is shutting down. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listeneron_shutdown (Handler &&h) &
 Set an handler function to be invoked when the client's shutdown has completed. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener && on_shutdown (Handler &&h) &&
 Set an handler function to be invoked when the client's shutdown has completed. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listeneron_connected (Handler &&h) &
 Set an handler function to be invoked when the client is connected to the cluster. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener && on_connected (Handler &&h) &&
 Set an handler function to be invoked when the client is connected to the cluster. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listeneron_disconnected (Handler &&h) &
 Set an handler function to be invoked when client is disconnected from the cluster. More...
 
template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener && on_disconnected (Handler &&h) &&
 Set an handler function to be invoked when client is disconnected from the cluster. More...
 

Friends

class spi::lifecycle_service
 

Detailed Description

Listener object for listening lifecycle events of hazelcast instance.

Warning
1 - If listener should do a time consuming operation, off-load the operation to another thread. otherwise it will slow down the system.
2 - Do not make a call to hazelcast. It can cause a deadlock.
See also
LifecycleEvent
hazelcast_client::addlifecycle_listener

Definition at line 48 of file lifecycle_listener.h.

Member Function Documentation

◆ on_connected() [1/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener& hazelcast::client::lifecycle_listener::on_connected ( Handler &&  h) &
inline

Set an handler function to be invoked when the client is connected to the cluster.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 145 of file lifecycle_listener.h.

145  {
146  connected_ = std::forward<Handler>(h);
147  return *this;
148  }

◆ on_connected() [2/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener&& hazelcast::client::lifecycle_listener::on_connected ( Handler &&  h) &&
inline

Set an handler function to be invoked when the client is connected to the cluster.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 155 of file lifecycle_listener.h.

155  {
156  on_connected(std::forward<Handler>(h));
157  return std::move(*this);
158  }
lifecycle_listener & on_connected(Handler &&h) &
Set an handler function to be invoked when the client is connected to the cluster.

◆ on_disconnected() [1/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener& hazelcast::client::lifecycle_listener::on_disconnected ( Handler &&  h) &
inline

Set an handler function to be invoked when client is disconnected from the cluster.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 167 of file lifecycle_listener.h.

167  {
168  disconnected_ = std::forward<Handler>(h);
169  return *this;
170  }

◆ on_disconnected() [2/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener&& hazelcast::client::lifecycle_listener::on_disconnected ( Handler &&  h) &&
inline

Set an handler function to be invoked when client is disconnected from the cluster.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 177 of file lifecycle_listener.h.

177  {
178  on_disconnected(std::forward<Handler>(h));
179  return std::move(*this);
180  }
lifecycle_listener & on_disconnected(Handler &&h) &
Set an handler function to be invoked when client is disconnected from the cluster.

◆ on_shutdown() [1/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener& hazelcast::client::lifecycle_listener::on_shutdown ( Handler &&  h) &
inline

Set an handler function to be invoked when the client's shutdown has completed.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 123 of file lifecycle_listener.h.

123  {
124  shutdown_ = std::forward<Handler>(h);
125  return *this;
126  }

◆ on_shutdown() [2/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener&& hazelcast::client::lifecycle_listener::on_shutdown ( Handler &&  h) &&
inline

Set an handler function to be invoked when the client's shutdown has completed.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 133 of file lifecycle_listener.h.

133  {
134  on_shutdown(std::forward<Handler>(h));
135  return std::move(*this);
136  }
lifecycle_listener & on_shutdown(Handler &&h) &
Set an handler function to be invoked when the client's shutdown has completed.

◆ on_shutting_down() [1/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener& hazelcast::client::lifecycle_listener::on_shutting_down ( Handler &&  h) &
inline

Set an handler function to be invoked when the client is shutting down.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 101 of file lifecycle_listener.h.

101  {
102  shutting_down_ = std::forward<Handler>(h);
103  return *this;
104  }

◆ on_shutting_down() [2/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener&& hazelcast::client::lifecycle_listener::on_shutting_down ( Handler &&  h) &&
inline

Set an handler function to be invoked when the client is shutting down.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 111 of file lifecycle_listener.h.

111  {
112  on_shutting_down(std::forward<Handler>(h));
113  return std::move(*this);
114  }
lifecycle_listener & on_shutting_down(Handler &&h) &
Set an handler function to be invoked when the client is shutting down.

◆ on_started() [1/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener& hazelcast::client::lifecycle_listener::on_started ( Handler &&  h) &
inline

Set an handler function to be invoked when the client has started.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 79 of file lifecycle_listener.h.

79  {
80  started_ = std::forward<Handler>(h);
81  return *this;
82  }

◆ on_started() [2/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener&& hazelcast::client::lifecycle_listener::on_started ( Handler &&  h) &&
inline

Set an handler function to be invoked when the client has started.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 89 of file lifecycle_listener.h.

89  {
90  on_started(std::forward<Handler>(h));
91  return std::move(*this);
92  }
lifecycle_listener & on_started(Handler &&h) &
Set an handler function to be invoked when the client has started.

◆ on_starting() [1/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener& hazelcast::client::lifecycle_listener::on_starting ( Handler &&  h) &
inline

Set an handler function to be invoked when the client is starting.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 57 of file lifecycle_listener.h.

57  {
58  starting_ = std::forward<Handler>(h);
59  return *this;
60  }

◆ on_starting() [2/2]

template<typename Handler , typename = util::enable_if_rvalue_ref_t<Handler &&>>
lifecycle_listener&& hazelcast::client::lifecycle_listener::on_starting ( Handler &&  h) &&
inline

Set an handler function to be invoked when the client is starting.

Parameters
ha void function object that is callable without any parameters.
Returns
*this

Definition at line 67 of file lifecycle_listener.h.

67  {
68  on_starting(std::forward<Handler>(h));
69  return std::move(*this);
70  }
lifecycle_listener & on_starting(Handler &&h) &
Set an handler function to be invoked when the client is starting.

The documentation for this class was generated from the following file: