Oracle® Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.2.1.4.0)

E90870-01

coherence/net/cache/WrapperNamedCache.hpp

00001 /*
00002 * WrapperNamedCache.hpp
00003 *
00004 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_WRAPPER_NAMED_CACHE_HPP
00017 #define COH_WRAPPER_NAMED_CACHE_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/net/CacheService.hpp"
00022 #include "coherence/net/NamedCache.hpp"
00023 #include "coherence/util/Comparator.hpp"
00024 #include "coherence/util/Filter.hpp"
00025 #include "coherence/util/MapListener.hpp"
00026 #include "coherence/util/Set.hpp"
00027 #include "coherence/util/ValueExtractor.hpp"
00028 
00029 COH_OPEN_NAMESPACE3(coherence,net,cache)
00030 
00031 using coherence::net::CacheService;
00032 using coherence::net::NamedCache;
00033 using coherence::util::Collection;
00034 using coherence::util::Comparator;
00035 using coherence::util::Filter;
00036 using coherence::util::MapListener;
00037 using coherence::util::Set;
00038 using coherence::util::ValueExtractor;
00039 
00040 /**
00041  * A wrapper for the given NamedCache.
00042  *
00043  * @author lh  2012.06.18
00044  * @since Coherence 12.1.2
00045  */
00046 class COH_EXPORT WrapperNamedCache
00047     : public class_spec<WrapperNamedCache,
00048         extends<Object>,
00049         implements<NamedCache> >
00050     {
00051     friend class factory<WrapperNamedCache>;
00052 
00053     // ----- constructors ---------------------------------------------------
00054 
00055     protected:
00056         /**
00057          * Create a new WrapperNamedCache.
00058          *
00059          * @param hCache  the NamedCache that will be wrapped by this 
00060          *                WrapperNamedCache
00061          */
00062         WrapperNamedCache(NamedCache::Handle hCache);
00063 
00064     // ----- Map interface --------------------------------------------------
00065 
00066     public:
00067         /**
00068          * {@inheritDoc}
00069          */
00070         virtual size32_t size() const;
00071 
00072         /**
00073          * {@inheritDoc}
00074          */
00075         virtual bool isEmpty() const;
00076 
00077         /**
00078          * {@inheritDoc}
00079          */
00080         virtual bool containsKey(Object::View vKey) const;
00081 
00082         /**
00083          * {@inheritDoc}
00084          */
00085         virtual bool containsValue(Object::View vValue) const;
00086 
00087         /**
00088          * {@inheritDoc}
00089          */
00090         virtual Object::Holder get(Object::View vKey) const;
00091 
00092         /**
00093          * {@inheritDoc}
00094          */
00095         virtual Object::Holder get(Object::View vKey);
00096 
00097         /**
00098          * {@inheritDoc}
00099          */
00100         virtual Object::Holder put(Object::View vKey, Object::Holder ohValue);
00101 
00102         /**
00103          * {@inheritDoc}
00104          */
00105         virtual Object::Holder remove(Object::View vKey);
00106         using Map::remove;
00107 
00108         /**
00109          * {@inheritDoc}
00110          */
00111         virtual void putAll(Map::View vMap);
00112 
00113         /**
00114          * {@inheritDoc}
00115          */
00116         virtual void clear();
00117 
00118         /**
00119          * {@inheritDoc}
00120          */
00121         virtual Set::View keySet() const;
00122 
00123         /**
00124          * {@inheritDoc}
00125          */
00126         virtual Set::Handle keySet();
00127 
00128         /**
00129          * {@inheritDoc}
00130          */
00131         virtual Collection::View values() const;
00132 
00133         /**
00134          * {@inheritDoc}
00135          */
00136         virtual Collection::Handle values();
00137 
00138         /**
00139          * {@inheritDoc}
00140          */
00141         virtual Set::View entrySet() const;
00142 
00143         /**
00144          * {@inheritDoc}
00145          */
00146         virtual Set::Handle entrySet();
00147 
00148     // ----- CacheMap interface ---------------------------------------------
00149 
00150     public:
00151         /**
00152          * {@inheritDoc}
00153          */
00154         virtual Map::View getAll(Collection::View vKeys) const;
00155 
00156         /**
00157          * {@inheritDoc}
00158          */
00159         virtual Object::Holder put(Object::View vKey, Object::Holder ohValue,
00160                 int64_t cMillis);
00161 
00162     // ----- NamedCache interface -------------------------------------------
00163 
00164     public:
00165         /**
00166          * {@inheritDoc}
00167          */
00168         virtual void release();
00169 
00170         /**
00171          * {@inheritDoc}
00172          */
00173         virtual void destroy();
00174 
00175         /**
00176          * {@inheritDoc}
00177          */
00178         virtual void truncate();
00179 
00180         /**
00181          * {@inheritDoc}
00182          */
00183         virtual String::View getCacheName() const;
00184 
00185         /**
00186          * {@inheritDoc}
00187          */
00188         virtual bool isActive() const;
00189 
00190         /**
00191          * {@inheritDoc}
00192          */
00193         virtual NamedCache::CacheServiceHandle getCacheService();
00194 
00195         /**
00196          * {@inheritDoc}
00197          */
00198         virtual NamedCache::CacheServiceView getCacheService() const;
00199 
00200     // ----- ConcurrentMap interface ----------------------------------------
00201 
00202     public:
00203         /**
00204          * {@inheritDoc}
00205          */
00206         virtual bool lock(Object::View vKey, int64_t cWait) const;
00207 
00208         /**
00209          * {@inheritDoc}
00210          */
00211         virtual bool lock(Object::View vKey) const;
00212 
00213         /**
00214          * {@inheritDoc}
00215          */
00216         virtual bool unlock(Object::View vKey) const;
00217 
00218     // ----- InvocableMap interface -----------------------------------------
00219 
00220     public:
00221         /**
00222          * {@inheritDoc}
00223          */
00224         virtual Object::Holder invoke(Object::View vKey,
00225                 EntryProcessor::Handle hAgent);
00226 
00227         /**
00228          * {@inheritDoc}
00229          */
00230         virtual Map::View invokeAll(Collection::View vCollKeys,
00231                 EntryProcessor::Handle hAgent);
00232 
00233         /**
00234          * {@inheritDoc}
00235          */
00236         virtual Map::View invokeAll(Filter::View vFilter,
00237                 EntryProcessor::Handle hAgent);
00238 
00239         /**
00240          * {@inheritDoc}
00241          */
00242         virtual Object::Holder aggregate(Collection::View vCollKeys,
00243                 EntryAggregator::Handle hAgent) const;
00244 
00245         /**
00246          * {@inheritDoc}
00247          */
00248         virtual Object::Holder aggregate(Filter::View vFilter,
00249                 EntryAggregator::Handle hAgent) const;
00250 
00251     // ----- QueryMap interface ---------------------------------------------
00252 
00253     public:
00254         /**
00255          * {@inheritDoc}
00256          */
00257         virtual Set::View keySet(Filter::View vFilter) const;
00258 
00259         /**
00260          * {@inheritDoc}
00261          */
00262         virtual Set::View entrySet(Filter::View vFilter) const;
00263 
00264         /**
00265          * {@inheritDoc}
00266          */
00267         virtual Set::View entrySet(Filter::View vFilter,
00268                 Comparator::View vComparator) const;
00269 
00270         /**
00271          * {@inheritDoc}
00272          */
00273         virtual void addIndex(ValueExtractor::View vExtractor, bool fOrdered,
00274                 Comparator::View vComparator);
00275 
00276         /**
00277          * {@inheritDoc}
00278          */
00279         virtual void removeIndex(ValueExtractor::View vExtractor);
00280 
00281     // ----- ObservableMap interface ----------------------------------------
00282 
00283     public:
00284         /**
00285          * {@inheritDoc}
00286          */
00287         virtual void addKeyListener(MapListener::Handle hListener,
00288                 Object::View vKey, bool fLite);
00289 
00290         /**
00291          * {@inheritDoc}
00292          */
00293         virtual void removeKeyListener(MapListener::Handle hListener,
00294                 Object::View vKey);
00295 
00296         /**
00297          * {@inheritDoc}
00298          */
00299         virtual void addMapListener(MapListener::Handle hListener);
00300 
00301         /**
00302         * {@inheritDoc}
00303         */
00304         virtual void removeMapListener(MapListener::Handle hListener);
00305         
00306         /**
00307          * {@inheritDoc}
00308          */
00309         virtual void addFilterListener(MapListener::Handle hListener,
00310                 Filter::View vFilter = NULL, bool fLite = false);
00311 
00312         /**
00313          * {@inheritDoc}
00314          */
00315         virtual void removeFilterListener(MapListener::Handle hListener,
00316                 Filter::View vFilter = NULL);
00317 
00318     // ----- Object interface -----------------------------------------------
00319 
00320     public:
00321         /**
00322          * {@inheritDoc}
00323          */
00324         virtual TypedHandle<const String> toString() const;
00325 
00326     // ----- property getters/setters ---------------------------------------
00327 
00328     public:
00329         /**
00330          * Get the actual (wrapped) named cache.
00331          *
00332          * @return the wrapped cache
00333          */
00334         virtual NamedCache::Handle getNamedCache();
00335 
00336         /**
00337          * Get the actual (wrapped) named cache.
00338          *
00339          * @return the wrapped cache
00340          */
00341         virtual NamedCache::View getNamedCache() const;
00342 
00343     // ----- data members ---------------------------------------------------
00344 
00345     protected:
00346         /**
00347          * Actual (wrapped) NamedCache.
00348          */
00349         FinalHandle<NamedCache> f_hNamedCache;
00350 };
00351 
00352 COH_CLOSE_NAMESPACE3
00353 
00354 #endif // COH_WRAPPER_NAMED_CACHE_HPP
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.