Infinispan HotRod C++ Client
8.3.1.Final
|
#include <RemoteCacheManager.h>
Public Member Functions | |
RemoteCacheManager (bool start_=true) | |
RemoteCacheManager (const std::map< std::string, std::string > &configuration, bool start_=true) | |
RemoteCacheManager (const Configuration &configuration, bool start=true) | |
~RemoteCacheManager () | |
void | start () |
void | stop () |
bool | isStarted () |
const Configuration & | getConfiguration () |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (bool forceReturnValue) |
template<class K , class V > | |
RemoteCache< K, V > & | getCache () |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (const std::string &name, bool forceReturnValue) |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (const std::string &name) |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), bool forceReturnValue) |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *)) |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), const std::string &name, bool forceReturnValue) |
template<class K , class V > | |
RemoteCache< K, V > & | getCache (Marshaller< K > *km, void(*kd)(Marshaller< K > *), Marshaller< V > *vm, void(*vd)(Marshaller< V > *), const std::string &name) |
bool | switchToDefaultCluster () |
bool | switchToCluster (std::string clusterName) |
RemoteCounterManager & | getCounterManager () |
std::shared_ptr < RemoteCacheManagerAdmin > | administration () |
std::set< std::string > | getCacheNames () |
TransactionManager & | getTransactionManager () const |
Factory for RemoteCache objects.
Lifecycle:
In order to be able to use an instance of RemoteCache, the RemoteCacheManager must be started first. Beside other things, this instantiates connections to Hot Rod server(s). Starting the RemoteCacheManager can be done either at creation by passing start==true to constructor or after construction by calling start() method.
RemoteCacheManager is an "expensive" object, as it manages a set of persistent TCP connections to the Hot Rod servers. It is recommended to only have one instance of it per runtime and to cache it between calls to the server (i.e. remoteCache operations).
After you are done with RemoteCacheManager stop needs to be called explicitly in order to release all the resources (e.g. threads, TCP connections).
Configuration:
The cache manager is configured through a Configuration object passed to the constructor.
|
explicit |
Creates a new instance of RemoteCacheManager using the default Configuration object an an optional boolean parameter indicating whether to also start this RemoteCacheManager as well.
start_ | optional boolean parameter indicating whether to start this RemoteCacheManager |
|
inlineexplicit |
|
explicit |
Creates a new instance of RemoteCacheManager given an accompanying Configuration object an an optional boolean parameter indicating whether to also start this RemoteCacheManager as well.
configuration | the Configuration reference to use for configuration of this RemoteCacheManager |
start | optional boolean parameter indicating whether to start this RemoteCacheManager |
infinispan::hotrod::RemoteCacheManager::~RemoteCacheManager | ( | ) |
|
inline |
Get the administrative interface
|
inline |
Returns a RemoteCache instance connected to the default cache
forceReturnValue | if true, force all the HotRod operation that have optional return to always return a value |
|
inline |
Returns a RemoteCache instance connected to the default cache
The Configuration.forceReturnValue policy will be used
|
inline |
Returns a RemoteCache instance connected to the cache with the given name
name | the cache name |
forceReturnValue | if true, force all the HotRod operation that have optional return to always return a value |
|
inline |
Returns a RemoteCache instance connected to the cache with the given name
The Configuration.forceReturnValue policy will be used
name | the cache name |
|
inline |
Returns a RemoteCache instance connected to the default cache
km | the key marshaller |
kd | function used as key marshaller destructor after this is no longer needed |
vm | the value marshaller |
vd | function used as value marshaller destructor after this is no longer needed |
forceReturnValue | if true, force all the HotRod operation that have optional return to always return a value |
|
inline |
Returns a RemoteCache instance connected to the default cache
The Configuration.forceReturnValue policy will be used
km | the key marshaller |
kd | function used as key marshaller destructor after this is no longer needed |
vm | the value marshaller |
vd | function used as value marshaller destructor after this is no longer needed will indeed return a value. |
|
inline |
Returns a RemoteCache instance connected to the cache with the given name
km | the key marshaller |
kd | function used as key marshaller destructor after this is no longer needed |
vm | the value marshaller |
vd | function used as value marshaller destructor after this is no longer needed |
name | the cache name to connect to on a remote Infinispan server |
forceReturnValue | if true, force all the HotRod operation that have optional return to always return a value |
|
inline |
Returns a RemoteCache instance connected to the cache with the given name
km | the key marshaller |
kd | function used as key marshaller destructor after this is no longer needed |
vm | the value marshaller |
vd | function used as value marshaller destructor after this is no longer needed |
name | the cache name to connect to on a remote Infinispan server |
std::set<std::string> infinispan::hotrod::RemoteCacheManager::getCacheNames | ( | ) |
const Configuration& infinispan::hotrod::RemoteCacheManager::getConfiguration | ( | ) |
Returns the Configuration instance used for configuration of this RemoteCacheManager
RemoteCounterManager& infinispan::hotrod::RemoteCacheManager::getCounterManager | ( | ) |
|
inline |
bool infinispan::hotrod::RemoteCacheManager::isStarted | ( | ) |
Returns true if this RemoteCacheManager has already been started
void infinispan::hotrod::RemoteCacheManager::start | ( | ) |
Starts this RemoteCacheManager if it already has not been started
void infinispan::hotrod::RemoteCacheManager::stop | ( | ) |
Stops this RemoteCacheManager and releases all related resource
bool infinispan::hotrod::RemoteCacheManager::switchToCluster | ( | std::string | clusterName | ) |
Switch the client on the main cluster
bool infinispan::hotrod::RemoteCacheManager::switchToDefaultCluster | ( | ) |
Switch the client on the main cluster