VMware Tanzu GemFire Native C++ Reference  10.1.5
PoolManager.hpp
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #pragma once
19 
20 #ifndef GEODE_POOLMANAGER_H_
21 #define GEODE_POOLMANAGER_H_
22 
23 #include <iosfwd>
24 #include <memory>
25 #include <string>
26 #include <unordered_map>
27 
28 #include "Cache.hpp"
29 #include "Pool.hpp"
30 #include "PoolFactory.hpp"
31 #include "Region.hpp"
32 #include "geode/HashMapOfPools.hpp"
33 #include "internal/geode_base.hpp"
34 #include "internal/geode_globals.hpp"
35 
36 namespace apache {
37 namespace geode {
38 namespace client {
39 
40 class CacheImpl;
41 class FunctionService;
42 class PoolManagerImpl;
43 class ThinClientPoolDM;
44 class Cache;
45 class Pool;
46 class PoolFactory;
47 class Region;
48 class RegionFactory;
49 
61 class APACHE_GEODE_EXPORT PoolManager {
62  public:
69 
80  const HashMapOfPools& getAll() const;
81 
89  std::shared_ptr<Pool> find(const std::string& name) const;
90 
98  std::shared_ptr<Pool> find(const std::shared_ptr<Region>& region) const;
99 
107  void close(bool keepAlive = false);
108 
109  private:
110  void removePool(const std::string& name);
111 
112  void addPool(std::string name, const std::shared_ptr<Pool>& pool);
113 
114  const std::shared_ptr<Pool>& getDefaultPool() const;
115 
116  std::shared_ptr<PoolManagerImpl> m_pimpl;
117 
118  explicit PoolManager(CacheImpl* cache);
119 
120  friend Cache;
121  friend CacheImpl;
122  friend RegionFactory;
123  friend PoolFactory;
124  friend ThinClientPoolDM;
125  friend FunctionService;
126 };
127 } // namespace client
128 } // namespace geode
129 } // namespace apache
130 
131 #endif // GEODE_POOLMANAGER_H_
apache::geode::client::PoolManager
Manages creation and access to connection pools for clients.
Definition: PoolManager.hpp:61
apache::geode::client::Cache
Caches are obtained from the create method on the CacheFactory#create class.
Definition: Cache.hpp:67
apache::geode::client::PoolManager::find
std::shared_ptr< Pool > find(const std::shared_ptr< Region > &region) const
Find the pool used by the given region.
apache::geode::client::PoolManager::createFactory
PoolFactory createFactory() const
Creates a new pool factory, which is used to configure and create new Pools.
PoolFactory.hpp
apache::geode::client::PoolManager::close
void close(bool keepAlive=false)
Unconditionally destroys all created pools that are in this manager.
apache::geode::client::FunctionService
entry point for function execution
Definition: FunctionService.hpp:45
apache::geode::client::PoolManager::getAll
const HashMapOfPools & getAll() const
Returns a map containing all the pools in this manager.
apache::geode::client::RegionFactory
Provides for the configuration and creation of instances of Region.
Definition: RegionFactory.hpp:43
apache::geode::client::PoolFactory
This interface provides for the configuration and creation of instances of Pool.
Definition: PoolFactory.hpp:68
Pool.hpp
apache::geode::client::PoolManager::find
std::shared_ptr< Pool > find(const std::string &name) const
Find by name an existing connection pool returning the existing pool or nullptr if it does not exist.
Cache.hpp

Apache Geode C++ Cache API Documentation