Hazelcast C++ Client
|
Hazelcast cluster interface. More...
#include <Cluster.h>
Public Member Functions | |
Cluster (spi::ClientClusterService &clusterService) | |
Constructor. | |
void | addMembershipListener (MembershipListener *listener) |
std::string | addMembershipListener (const boost::shared_ptr< MembershipListener > &listener) |
Adds MembershipListener to listen for membership updates. More... | |
std::string | addMembershipListener (InitialMembershipListener *listener) |
std::string | addMembershipListener (const boost::shared_ptr< InitialMembershipListener > &listener) |
Adds MembershipListener to listen for membership updates. More... | |
bool | removeMembershipListener (MembershipListener *listener) |
bool | removeMembershipListener (const std::string ®istrationId) |
Removes the specified MembershipListener. More... | |
std::vector< Member > | getMembers () |
Set of current members of the cluster. More... | |
Hazelcast cluster interface.
void hazelcast::client::Cluster::addMembershipListener | ( | MembershipListener * | listener | ) |
Adds MembershipListener to listen for membership updates.
Warning 1: If listener should do a time consuming operation, off-load the operation to another thread. otherwise it will slow down the system.
Warning 2: Do not make a call to hazelcast. It can cause deadlock.
listener | MembershipListener |
std::string hazelcast::client::Cluster::addMembershipListener | ( | const boost::shared_ptr< MembershipListener > & | listener | ) |
Adds MembershipListener to listen for membership updates.
The addMembershipListener method returns a register ID. This ID is needed to remove the MembershipListener using the removeMembershipListener(String) method.
If the MembershipListener implements the InitialMembershipListener interface, it will also receive the InitialMembershipEvent.
There is no check for duplicate registrations, so if you register the listener twice, it will get events twice.
listener | membership listener |
NullPointerException | if listener is null |
std::string hazelcast::client::Cluster::addMembershipListener | ( | InitialMembershipListener * | listener | ) |
Adds InitialMembershipListener to listen for membership updates.
Warning 1: If listener should do a time consuming operation, off-load the operation to another thread. otherwise it will slow down the system.
Warning 2: Do not make a call to hazelcast. It can cause deadlock.
listener | InitialMembershipListener |
std::string hazelcast::client::Cluster::addMembershipListener | ( | const boost::shared_ptr< InitialMembershipListener > & | listener | ) |
Adds MembershipListener to listen for membership updates.
The addMembershipListener method returns a register ID. This ID is needed to remove the MembershipListener using the removeMembershipListener(String) method.
If the MembershipListener implements the InitialMembershipListener interface, it will also receive the InitialMembershipEvent.
There is no check for duplicate registrations, so if you register the listener twice, it will get events twice.
listener | membership listener |
NullPointerException | if listener is null |
std::vector< Member > hazelcast::client::Cluster::getMembers | ( | ) |
Set of current members of the cluster.
Returning set instance is not modifiable. Every member in the cluster has the same member list in the same order. First member is the oldest member.
bool hazelcast::client::Cluster::removeMembershipListener | ( | MembershipListener * | listener | ) |
Removes the specified membership listener.
listener | MembershipListener * to be removed |
bool hazelcast::client::Cluster::removeMembershipListener | ( | const std::string & | registrationId | ) |
Removes the specified MembershipListener.
If the same MembershipListener is registered multiple times, it needs to be removed multiple times.
This method can safely be called multiple times for the same registration ID; subsequent calls are ignored.
registrationId | the registrationId of MembershipListener to remove |