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

E26041-01

coherence/util/ConverterCollections.hpp

00001 /*
00002 * ConverterCollections.hpp
00003 *
00004 * Copyright (c) 2000, 2013, 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_CONVERTER_COLLECTIONS_HPP
00017 #define COH_CONVERTER_COLLECTIONS_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 
00022 #include "coherence/net/cache/CacheEvent.hpp"
00023 #include "coherence/net/cache/CacheMap.hpp"
00024 #include "coherence/net/CacheService.hpp"
00025 #include "coherence/net/NamedCache.hpp"
00026 #include "coherence/util/Collection.hpp"
00027 #include "coherence/util/ConcurrentMap.hpp"
00028 #include "coherence/util/Converter.hpp"
00029 #include "coherence/util/Filter.hpp"
00030 #include "coherence/util/InvocableMap.hpp"
00031 #include "coherence/util/Iterator.hpp"
00032 #include "coherence/util/MapEvent.hpp"
00033 #include "coherence/util/ObservableMap.hpp"
00034 #include "coherence/util/Set.hpp"
00035 #include "coherence/util/WrapperCollections.hpp"
00036 
00037 COH_OPEN_NAMESPACE2(coherence,util)
00038 
00039 using coherence::net::cache::CacheEvent;
00040 using coherence::net::cache::CacheMap;
00041 using coherence::net::CacheService;
00042 using coherence::net::NamedCache;
00043 
00044 /**
00045 * A collection of Collection implementation classes that use the Converter
00046 * interface to convert the items stored in underlying Collection objects.
00047 *
00048 * @author mf  2007.07.05
00049 */
00050 class COH_EXPORT ConverterCollections
00051     {
00052     // ----- ConverterCollections interface ---------------------------------
00053     public:
00054         /**
00055         * Return a new lang#ObjectArray whose contents are the converted
00056         * contents of the supplied array.
00057         *
00058         * @param hArray  the supplied array
00059         * @param vConvUp the converter to use
00060         *
00061         * @return a handle to the converted array
00062         */
00063         static ObjectArray::Handle convertArray(ObjectArray::Handle hArray,
00064                                                 Converter::View vConvUp);
00065 
00066         /**
00067         * Return a new lang#ObjectArray whose contents are the converted
00068         * contents of the supplied array.
00069         *
00070         * @param vArray  the supplied array
00071         * @param vConvUp the converter to use
00072         *
00073         * @return a view of the converted array
00074         */
00075         static ObjectArray::View convertArray(ObjectArray::View vArray,
00076                                               Converter::View vConvUp);
00077 
00078 
00079     // ----- inner classes --------------------------------------------------
00080 
00081     public:
00082         /**
00083         * A ConverterIterator views an underlying Iterator through a
00084         * Converter.
00085         */
00086         class COH_EXPORT ConverterIterator
00087             : public cloneable_spec<ConverterIterator,
00088                 extends<WrapperCollections::AbstractWrapperIterator> >
00089             {
00090             friend class factory<ConverterIterator>;
00091 
00092             // ----- constructor ----------------------------------------
00093 
00094             protected:
00095                 /**
00096                 * Create a WrapperCollections#AbstractWrapperIterator which
00097                 * delegates to the specified Iterator.
00098                 *
00099                 * @param hiterDelegate the specified Iterator
00100                 * @param vConvUp       the Converter to view through
00101                 */
00102                 ConverterIterator(Iterator::Handle hiterDelegate,
00103                                   Converter::View vConvUp);
00104 
00105                 /**
00106                 * Copy constructor.
00107                 */
00108                 ConverterIterator(const ConverterIterator& that);
00109 
00110             // ----- Iterator interface ---------------------------------
00111 
00112             public:
00113                 /**
00114                 * {@inheritDoc}
00115                 */
00116                 virtual Object::Holder next();
00117 
00118 
00119             // ----- data members ---------------------------------------
00120 
00121             protected:
00122                 /**
00123                 * The Converter from the underlying container
00124                 */
00125                 FinalView<Converter> f_vConvUp;
00126             };
00127 
00128 
00129         /**
00130         * A ConverterCollection views an underlying Collection through a
00131         * Converter.
00132         */
00133         class COH_EXPORT ConverterCollection
00134             : public cloneable_spec<ConverterCollection,
00135                 extends<WrapperCollections::AbstractWrapperCollection> >
00136             {
00137             friend class factory<ConverterCollection>;
00138 
00139             // ----- constructors ---------------------------------------
00140 
00141             protected:
00142                 /**
00143                 * Create a WrapperCollections#AbstractWrapperCollection which
00144                 * delegates to the specified Collection.
00145                 *
00146                 * @param hcollDelegate the specified collection
00147                 * @param vConvUp       the converter from the underlying
00148                 *                      Collection
00149                 * @param vConvDown     the converter to the underlying
00150                 *                      Collection
00151                 */
00152                 ConverterCollection(Collection::Handle hcollDelegate,
00153                                     Converter::View vConvUp,
00154                                     Converter::View vConvDown);
00155 
00156                 /**
00157                 * Create a WrapperCollections#AbstractWrapperCollection which
00158                 * delegates to the specified Collection.
00159                 *
00160                 * @param vcollDelegate the specified collection
00161                 * @param vConvUp       the converter from the underlying
00162                 *                      Collection
00163                 * @param vConvDown     the converter to the underlying
00164                 *                      Collection
00165                 */
00166                 ConverterCollection(Collection::View vcollDelegate,
00167                                     Converter::View vConvUp,
00168                                     Converter::View vConvDown);
00169 
00170                 /**
00171                 * Copy constructor.
00172                 */
00173                 ConverterCollection(const ConverterCollection& that);
00174 
00175 
00176             // ----- Collection interface -------------------------------
00177 
00178             public:
00179                 /**
00180                 * {@inheritDoc}
00181                 */
00182                 virtual bool contains(Object::View v) const;
00183 
00184                 /**
00185                 * {@inheritDoc}
00186                 */
00187                 virtual Iterator::Handle iterator() const;
00188 
00189                 /**
00190                 * {@inheritDoc}
00191                 */
00192                 virtual Muterator::Handle iterator();
00193 
00194                 /**
00195                 * {@inheritDoc}
00196                 */
00197                 virtual ObjectArray::Handle toArray(
00198                         ObjectArray::Handle hao = NULL) const;
00199 
00200                 /**
00201                 * {@inheritDoc}
00202                 */
00203                 virtual bool add(Object::Holder oh);
00204 
00205                 /**
00206                 * {@inheritDoc}
00207                 */
00208                 virtual bool remove(Object::View v);
00209 
00210                 /**
00211                 * {@inheritDoc}
00212                 */
00213                 virtual bool containsAll(Collection::View vc) const;
00214 
00215                 /**
00216                 * {@inheritDoc}
00217                 */
00218                 virtual bool addAll(Collection::View vc);
00219 
00220                 /**
00221                 * {@inheritDoc}
00222                 */
00223                 virtual bool removeAll(Collection::View vc);
00224 
00225                 /**
00226                 * {@inheritDoc}
00227                 */
00228                 virtual bool retainAll(Collection::View vc);
00229 
00230             // ----- Object interface -----------------------------------
00231 
00232             public:
00233                 /**
00234                 * {@inheritDoc}
00235                 */
00236                 virtual bool equals(Object::View that) const;
00237 
00238                 /**
00239                 * {@inheritDoc}
00240                 */
00241                 virtual size32_t hashCode() const;
00242 
00243                 /**
00244                 * {@inheritDoc}
00245                 */
00246                 virtual void toStream(std::ostream& out) const;
00247 
00248             // ----- data members ---------------------------------------
00249 
00250             protected:
00251                 /**
00252                 * The Converter from the underlying container
00253                 */
00254                 FinalView<Converter> f_vConvUp;
00255 
00256                 /**
00257                 * The Converter to the underlying container
00258                 */
00259                 FinalView<Converter> f_vConvDown;
00260             };
00261 
00262 
00263         /**
00264         * A ConverterSet views an underlying Set through a Converter.
00265         */
00266         class COH_EXPORT ConverterSet
00267             : public cloneable_spec<ConverterSet,
00268                 extends<WrapperCollections::AbstractWrapperSet> >
00269             {
00270             friend class factory<ConverterSet>;
00271 
00272             // ----- constructors ---------------------------------------
00273 
00274             protected:
00275                 /**
00276                 * Create a WrapperCollections#AbstractWrapperSet which
00277                 * delegates to the specified Set.
00278                 *
00279                 * @param hSet      the specified Set
00280                 * @param vConvUp   the Converter from the underlying Set
00281                 * @param vConvDown the Converter to the underlying Set
00282                 */
00283                 ConverterSet(Set::Handle hsetDelegate,
00284                              Converter::View vConvUp,
00285                              Converter::View vConvDown);
00286 
00287                 /**
00288                 * Create a WrapperCollections#AbstractWrapperSet which
00289                 * delegates to the specified Set.
00290                 *
00291                 * @param vSet      the specified Set
00292                 * @param vConvUp   the Converter from the underlying Set
00293                 * @param vConvDown the Converter to the underlying Set
00294                 */
00295                 ConverterSet(Set::View vsetDelegate,
00296                              Converter::View vConvUp,
00297                              Converter::View vConvDown);
00298 
00299                 /**
00300                 * Copy constructor.
00301                 */
00302                 ConverterSet(const ConverterSet& that);
00303 
00304             // ----- Set interface --------------------------------------
00305 
00306             public:
00307 
00308                 /**
00309                 * {@inheritDoc}
00310                 */
00311                 virtual bool contains(Object::View v) const;
00312 
00313                 /**
00314                 * {@inheritDoc}
00315                 */
00316                 virtual Iterator::Handle iterator() const;
00317 
00318                 /**
00319                 * {@inheritDoc}
00320                 */
00321                 virtual Muterator::Handle iterator();
00322 
00323                 /**
00324                 * {@inheritDoc}
00325                 */
00326                 virtual ObjectArray::Handle toArray(
00327                         ObjectArray::Handle hoa = NULL) const;
00328 
00329                 /**
00330                 * {@inheritDoc}
00331                 */
00332                 virtual bool add(Object::Holder oh);
00333 
00334                 /**
00335                 * {@inheritDoc}
00336                 */
00337                 virtual bool remove(Object::View v);
00338 
00339                 /**
00340                 * {@inheritDoc}
00341                 */
00342                 virtual bool containsAll(Collection::View vc) const;
00343 
00344                 /**
00345                 * {@inheritDoc}
00346                 */
00347                 virtual bool addAll(Collection::View vc);
00348 
00349                 /**
00350                 * {@inheritDoc}
00351                 */
00352                 virtual bool removeAll(Collection::View vc);
00353 
00354                 /**
00355                 * {@inheritDoc}
00356                 */
00357                 virtual bool retainAll(Collection::View vc);
00358 
00359             // ----- Object interface -----------------------------------
00360 
00361             public:
00362                 /**
00363                 * {@inheritDoc}
00364                 */
00365                 virtual bool equals(Object::View that) const;
00366 
00367                 /**
00368                 * {@inheritDoc}
00369                 */
00370                 virtual size32_t hashCode() const;
00371 
00372                 /**
00373                 * {@inheritDoc}
00374                 */
00375                 virtual void toStream(std::ostream& out) const;
00376 
00377             // ----- data members ---------------------------------------
00378 
00379             protected:
00380                 /**
00381                 * The Converter from the underlying Set
00382                 */
00383                 FinalView<Converter> f_vConvUp;
00384 
00385                 /**
00386                 * The Converter to the underlying Set
00387                 */
00388                 FinalView<Converter> f_vConvDown;
00389             };
00390 
00391 
00392         /**
00393         * Map::Entry Converter, supporting key and value conversion.
00394         */
00395         class COH_EXPORT EntryConverter
00396             : public class_spec<EntryConverter,
00397                 extends<Object>,
00398                 implements<Converter> >
00399             {
00400             friend class factory<EntryConverter>;
00401 
00402             // ----- constructor ----------------------------------------
00403 
00404             public:
00405                 /**
00406                 * Create a Map entry Converter.
00407                 *
00408                 * @param vConvKey   the key Converter
00409                 * @param vConvVal   the value Converter
00410                 */
00411                 EntryConverter(Converter::View vConvKey,
00412                         Converter::View vConvVal);
00413 
00414                 /**
00415                 * Copy constructor.
00416                 */
00417                 EntryConverter(const EntryConverter& that);
00418 
00419             // ----- Converter interface --------------------------------
00420 
00421             public:
00422                 /**
00423                 * {@inheritDoc}
00424                 */
00425                 virtual Object::Holder convert(Object::Holder oh) const;
00426 
00427             // ----- EntryConverter interface ---------------------------
00428 
00429             public:
00430                 /**
00431                 * @return a view of the key Converter
00432                 */
00433                 virtual Converter::View getKeyConverter() const;
00434 
00435                 /**
00436                 * @return a view of the value Converter
00437                 */
00438                 virtual Converter::View getValueConverter() const;
00439 
00440             // ----- static helper methods ------------------------------
00441 
00442             public:
00443                 /**
00444                 * @param vConvert the EntryConverter
00445                 *
00446                 * @return a view of the vConvert's key Converter
00447                 */
00448                 static Converter::View getKeyConverter
00449                     (EntryConverter::View vConvert);
00450 
00451                 /**
00452                 * @param vConvert the EntryConverter
00453                 *
00454                 * @return a view of the vConvert's value Converter
00455                 */
00456                 static Converter::View getValueConverter
00457                     (EntryConverter::View vConvert);
00458 
00459                 /**
00460                 * Convert the key of the map entry referenced by the
00461                 * supplied handle using the supplied EntryConverter.
00462                 *
00463                 * @param vConvert a view of the EntryConverter to use
00464                 * @param vKey     a view to the key to convert
00465                 *
00466                 * @return a handle to the key, or the unconverted key
00467                 *         if the vConvert is NULL
00468                 */
00469                 static Object::View convertKey
00470                     (EntryConverter::View vConvert, Object::View vKey);
00471 
00472                 /**
00473                 * Convert the value of the map entry referenced by
00474                 * the supplied view using the supplied
00475                 * EntryConverter.
00476                 *
00477                 * @param vConvert  a view of the EntryConverter to
00478                 *                  use
00479                 * @param ohValue   a holder to the value to convert
00480                 *
00481                 * @return a view of the value, or the unconverted
00482                 *         value if the vConvert is NULL
00483                 */
00484                 static Object::Holder convertValue
00485                     (EntryConverter::View vConvert, Object::Holder ohValue);
00486 
00487             // ----- data members ---------------------------------------
00488 
00489             protected:
00490                 /**
00491                 * The key Converter.
00492                 */
00493                 FinalView<Converter> f_vConvKey;
00494 
00495                 /**
00496                 * The value Converter.
00497                 */
00498                 FinalView<Converter> f_vConvVal;
00499             };
00500 
00501 
00502         /**
00503         * A ConverterMap views an underlying Map through a Converter.
00504         */
00505         class COH_EXPORT ConverterMap
00506             : public cloneable_spec<ConverterMap,
00507                 extends<WrapperCollections::AbstractWrapperMap> >
00508             {
00509             friend class factory<ConverterMap>;
00510 
00511             // ----- constructors ---------------------------------------
00512 
00513             protected:
00514                 /**
00515                 * Create a WrapperCollections#AbstractWrapperMap which
00516                 * delegates to the specified Map.
00517                 *
00518                 * @param hMap      the specified Map
00519                 * @param vConvUp   the EntryConverter from the underlying Map
00520                 * @param vConvDown the EntryConverter to the underlying Map
00521                 */
00522                 ConverterMap(Map::Handle hMapDelegate,
00523                              EntryConverter::View vConvUp,
00524                              EntryConverter::View vConvDown);
00525 
00526                 /**
00527                 * Create a WrapperCollections#AbstractWrapperMap which
00528                 * delegates to the specified Map.
00529                 *
00530                 * @param vMap      the specified Map
00531                 * @param vConvUp   the EntryConverter from the underlying Map
00532                 * @param vConvDown the EntryConverter to the underlying Map
00533                 */
00534                 ConverterMap(Map::View vMapDelegate,
00535                              EntryConverter::View vConvUp,
00536                              EntryConverter::View vConvDown);
00537 
00538                 /**
00539                 * Copy constructor.
00540                 */
00541                 ConverterMap(const ConverterMap& that);
00542 
00543             // ----- Map interface --------------------------------------
00544 
00545             public:
00546                 /**
00547                 * {@inheritDoc}
00548                 */
00549                 virtual bool containsKey(Object::View vKey) const;
00550 
00551                 /**
00552                 * {@inheritDoc}
00553                 */
00554                 virtual bool containsValue(Object::View vValue) const;
00555 
00556                 /**
00557                 * {@inheritDoc}
00558                 */
00559                 virtual Object::Holder get(Object::View vKey) const;
00560 
00561                 /**
00562                 * {@inheritDoc}
00563                 */
00564                 using Map::get;
00565 
00566                 /**
00567                 * {@inheritDoc}
00568                 */
00569                 virtual Object::Holder put(Object::View vKey,
00570                                          Object::Holder ohValue);
00571 
00572                 /**
00573                 * {@inheritDoc}
00574                 */
00575                 virtual Object::Holder remove(Object::View vKey);
00576 
00577                 /**
00578                 * {@inheritDoc}
00579                 */
00580                 virtual void putAll(Map::View vMap);
00581 
00582                 /**
00583                 * {@inheritDoc}
00584                 */
00585                 virtual Set::View keySet() const;
00586 
00587                 /**
00588                 * {@inheritDoc}
00589                 */
00590                 virtual Set::Handle keySet();
00591 
00592                 /**
00593                 * {@inheritDoc}
00594                 */
00595                 virtual Collection::View values() const;
00596 
00597                 /**
00598                 * {@inheritDoc}
00599                 */
00600                 virtual Collection::Handle values();
00601 
00602                 /**
00603                 * {@inheritDoc}
00604                 */
00605                 virtual Set::View entrySet() const;
00606 
00607                 /**
00608                 * {@inheritDoc}
00609                 */
00610                 virtual Set::Handle entrySet();
00611 
00612             // ----- Object interface -----------------------------------
00613 
00614             public:
00615                 /**
00616                 * {@inheritDoc}
00617                 */
00618                 virtual bool equals(Object::View that) const;
00619 
00620                 /**
00621                 * {@inheritDoc}
00622                 */
00623                 virtual size32_t hashCode() const;
00624 
00625                 /**
00626                 * {@inheritDoc}
00627                 */
00628                 virtual void toStream(std::ostream& out) const;
00629 
00630             // ----- accessors ------------------------------------------
00631 
00632             public:
00633                 /**
00634                 * Get the up converter, which is used to convert from the
00635                 * underlying entries in the Map.
00636                 *
00637                 * @return the up converter
00638                 */
00639                 virtual EntryConverter::View getUpConverter() const;
00640 
00641                 /**
00642                 * Get the down converter, which is used to convert to the
00643                 * underlying entries in the Map.
00644                 *
00645                 * @return the down converter
00646                 */
00647                 virtual EntryConverter::View getDownConverter() const;
00648 
00649             // ----- data members ---------------------------------------
00650 
00651             protected:
00652                 /**
00653                 * The Converter from the underlying entries in the Map
00654                 */
00655                 FinalView<EntryConverter> f_vConvUp;
00656 
00657                 /**
00658                 * The Converter to the underlying entries in the Map
00659                 */
00660                 FinalView<EntryConverter> f_vConvDown;
00661             };
00662 
00663 
00664         /**
00665         * A ConverterEntry views an underlying Map#Entry through a Converter.
00666         */
00667         class COH_EXPORT ConverterEntry
00668             : public cloneable_spec<ConverterEntry,
00669                 extends<WrapperCollections::AbstractWrapperEntry> >
00670             {
00671             friend class factory<ConverterEntry>;
00672 
00673             // ----- constructors ---------------------------------------
00674 
00675             protected:
00676                 /**
00677                 * Create a WrapperCollections::AbstractWrapperEntry which
00678                 * delegates to the specified Map#Entry.
00679                 *
00680                 * @param hMapEntry  a handle to the specified Map#Entry
00681                 * @param vConvUp    the EntryConverter from the underlying
00682                 *                   Map
00683                 * @param vConvDown  the EntryConverter to the underlying Map
00684                 */
00685                 ConverterEntry(Map::Entry::Handle hMapDelegate,
00686                              EntryConverter::View vConvUp,
00687                              EntryConverter::View vConvDown);
00688 
00689                 /**
00690                 * Create a WrapperCollections::AbstractWrapperEntry which
00691                 * delegates to the specified Map#Entry.
00692                 *
00693                 * @param vMapEntry  a view of the specified Map#Entry
00694                 * @param vConvUp    the EntryConverter from the underlying
00695                 *                   Map
00696                 * @param vConvDown  the EntryConverter to the underlying Map
00697                 */
00698                 ConverterEntry(Map::Entry::View vMapDelegate,
00699                              EntryConverter::View vConvUp,
00700                              EntryConverter::View vConvDown);
00701 
00702                 /**
00703                 * Copy constructor.
00704                 */
00705                 ConverterEntry(const ConverterEntry& that);
00706 
00707 
00708             // ----- Map::Entry interface -------------------------------
00709 
00710             public:
00711                 /**
00712                 * {@inheritDoc}
00713                 */
00714                 virtual Object::View getKey() const;
00715 
00716                 /**
00717                 * {@inheritDoc}
00718                 */
00719                 virtual Object::Holder getValue() const;
00720 
00721                 /**
00722                 * {@inheritDoc}
00723                 */
00724                 using Map::Entry::getValue;
00725 
00726                 /**
00727                 * {@inheritDoc}
00728                 */
00729                 virtual Object::Holder setValue(Object::Holder ohValue);
00730 
00731             // ----- Object interface -----------------------------------
00732 
00733             public:
00734                 /**
00735                 * {@inheritDoc}
00736                 */
00737                 virtual bool equals(Object::View that) const;
00738 
00739                 /**
00740                 * {@inheritDoc}
00741                 */
00742                 virtual size32_t hashCode() const;
00743 
00744 
00745                 /**
00746                 * {@inheritDoc}
00747                 */
00748                 virtual void toStream(std::ostream& out) const;
00749 
00750             // ----- data members ---------------------------------------
00751 
00752             protected:
00753                 /**
00754                 * The Converter from the underlying Entry.
00755                 */
00756                 FinalView<EntryConverter> f_vConvUp;
00757 
00758                 /**
00759                 * The Converter from the underlying Entry.
00760                 */
00761                 FinalView<EntryConverter> f_vConvDown;
00762             };
00763 
00764 
00765         // ----- inner class: ConverterCacheEvent ---------------------------
00766 
00767         /**
00768         * A Converter CacheEvent views an underlying CacheEvent through a set
00769         * of key and value Converters.
00770         */
00771         class COH_EXPORT ConverterCacheEvent
00772             : public class_spec<ConverterCacheEvent,
00773                 extends<CacheEvent> >
00774             {
00775             friend class factory<ConverterCacheEvent>;
00776 
00777             // ----- constructors ---------------------------------------
00778 
00779             protected:
00780                 /**
00781                 * Create a ConverterCacheEvent.
00782                 *
00783                 * @param hMap      the new event's source
00784                 * @param vEvent    the underlying CacheEvent
00785                 * @param vConvKey  the Converter to view the underlying
00786                 *                  CacheEvent's key
00787                 * @param vConvVal  the Converter to view the underlying
00788                 *                  CacheEvent's values
00789                 */
00790                 ConverterCacheEvent(ObservableMap::Handle hMap,
00791                         CacheEvent::View vEvent, Converter::View vConvKey,
00792                         Converter::View vConvVal);
00793 
00794             // ----- MapEvent interface ---------------------------------
00795 
00796             public:
00797                 /**
00798                 * {@inheritDoc}
00799                 */
00800                 virtual Object::View getKey() const;
00801 
00802                 /**
00803                 * {@inheritDoc}
00804                 */
00805                 virtual Object::View getOldValue() const;
00806 
00807                 /**
00808                 * {@inheritDoc}
00809                 */
00810                 virtual Object::View getNewValue() const;
00811 
00812             // ----- accessors ------------------------------------------
00813 
00814             public:
00815                 /**
00816                 * Return the underlying CacheEvent.
00817                 *
00818                 * @return the underlying CacheEvent
00819                 */
00820                 virtual CacheEvent::View getCacheEvent() const;
00821 
00822                 /**
00823                 * Return the Converter used to view the underlying
00824                 * CacheEvent's key through.
00825                 *
00826                 * @return the Converter from the underlying CacheEvent's key
00827                 */
00828                 virtual Converter::View getConverterKeyUp() const;
00829 
00830                 /**
00831                 * Return the Converter used to view the underlying
00832                 * CacheEvent's value through.
00833                 *
00834                 * @return the Converter from the underlying CacheEvent's
00835                 *         value
00836                 */
00837                 virtual Converter::View getConverterValueUp() const;
00838 
00839                 /**
00840                 * Set the cached converted old value associated with this
00841                 * event.
00842                 *
00843                 * @param voValue the new converted "old" value
00844                 */
00845                 virtual void setOldValue(Object::View voValue);
00846 
00847                 /**
00848                 * Set the cached converted new value associated with this
00849                 * event.
00850                 *
00851                 * @param voValue the new converted "new" value
00852                 */
00853                 virtual void setNewValue(Object::View voValue);
00854 
00855             // ----- data members ---------------------------------------
00856 
00857             protected:
00858                 /**
00859                 * The underlying CacheEvent.
00860                 */
00861                 FinalView<CacheEvent> f_vEvent;
00862 
00863                 /**
00864                 * The Converter to view the underlying CacheEvent's key.
00865                 */
00866                 FinalView<Converter> f_vConvKey;
00867 
00868                 /**
00869                 * The Converter to view the underlying CacheEvent's value.
00870                 */
00871                 FinalView<Converter> f_vConvVal;
00872             };
00873 
00874 
00875         // ----- inner class: ConverterMapEvent -----------------------------
00876 
00877         /**
00878         * A Converter MapEvent views an underlying MapEvent through a set of
00879         * key and value Converters.
00880         */
00881         class COH_EXPORT ConverterMapEvent
00882             : public class_spec<ConverterMapEvent,
00883                 extends<MapEvent> >
00884             {
00885             friend class factory<ConverterMapEvent>;
00886 
00887             // ----- constructors ---------------------------------------
00888 
00889             protected:
00890                 /**
00891                 * Create a ConverterMapEvent.
00892                 *
00893                 * @param hMap      the new event's source
00894                 * @param vEvent    the underlying MapEvent
00895                 * @param vConvKey  the Converter to view the underlying
00896                 *                  MapEvent's key
00897                 * @param vConvVal  the Converter to view the underlying
00898                 *                  MapEvent's values
00899                 */
00900                 ConverterMapEvent(ObservableMap::Handle hMap,
00901                         MapEvent::View vEvent, Converter::View vConvKey,
00902                         Converter::View vConvVal);
00903 
00904             // ----- MapEvent interface ---------------------------------
00905 
00906             public:
00907                 /**
00908                 * {@inheritDoc}
00909                 */
00910                 virtual Object::View getKey() const;
00911 
00912                 /**
00913                 * {@inheritDoc}
00914                 */
00915                 virtual Object::View getOldValue() const;
00916 
00917                 /**
00918                 * {@inheritDoc}
00919                 */
00920                 virtual Object::View getNewValue() const;
00921 
00922             // ----- accessors ------------------------------------------
00923 
00924             public:
00925                 /**
00926                 * Return the underlying MapEvent.
00927                 *
00928                 * @return the underlying MapEvent
00929                 */
00930                 virtual MapEvent::View getMapEvent() const;
00931 
00932                 /**
00933                 * Return the Converter used to view the underlying MapEvent's
00934                 * key through.
00935                 *
00936                 * @return the Converter from the underlying MapEvent's key
00937                 */
00938                 virtual Converter::View getConverterKeyUp() const;
00939 
00940                 /**
00941                 * Return the Converter used to view the underlying MapEvent's
00942                 * value through.
00943                 *
00944                 * @return the Converter from the underlying MapEvent's value
00945                 */
00946                 virtual Converter::View getConverterValueUp() const;
00947 
00948                 /**
00949                 * Set the cached converted key associated with this event.
00950                 *
00951                 * @param voKey the converted key value
00952                 */
00953                 virtual void setKey(Object::View voKey);
00954 
00955                 /**
00956                 * Set the cached converted old value associated with this
00957                 * event.
00958                 *
00959                 * @param voValue the new converted "old" value
00960                 */
00961                 virtual void setOldValue(Object::View voValue);
00962 
00963                 /**
00964                 * Set the cached converted new value associated with this
00965                 * event.
00966                 *
00967                 * @param voValue the new converted "new" value
00968                 */
00969                 virtual void setNewValue(Object::View voValue);
00970 
00971                 /**
00972                 * Check if the event's key has been converted.
00973                 *
00974                 * @return true iff the key has been converted
00975                 */
00976                 virtual bool isKeyConverted() const;
00977 
00978                 /**
00979                 * Check if the event's old value has been converted.
00980                 *
00981                 * @return true iff the old value has been converted
00982                 */
00983                 virtual bool isOldValueConverted() const;
00984 
00985                 /**
00986                 * Check if the event's new value has been converted.
00987                 *
00988                 * @return true iff the new value has been converted
00989                 */
00990                 virtual bool isNewValueConverted() const;
00991 
00992             // ----- data members ---------------------------------------
00993 
00994             protected:
00995                 /**
00996                 * The underlying MapEvent.
00997                 */
00998                 FinalView<MapEvent> f_vEvent;
00999 
01000                 /**
01001                 * The Converter to view the underlying MapEvent's key.
01002                 */
01003                 FinalView<Converter> f_vConvKey;
01004 
01005                 /**
01006                 * The Converter to view the underlying MapEvent's value.
01007                 */
01008                 FinalView<Converter> f_vConvVal;
01009             };
01010 
01011 
01012         // ----- inner class: ConverterMapListener --------------------------
01013 
01014         /**
01015         * A converter MapListener that converts events of the underlying
01016         * MapListener for the underlying map.
01017         */
01018         class COH_EXPORT ConverterMapListener
01019             : public class_spec<ConverterMapListener,
01020                 extends<Object>,
01021                 implements<MapListener> >
01022             {
01023             friend class factory<ConverterMapListener>;
01024 
01025             // ----- constructors ---------------------------------------
01026 
01027             protected:
01028                 /**
01029                 * Create a ConverterMapListener that converts events of the
01030                 * underlying MapListener for the underlying map.
01031                 */
01032                 ConverterMapListener(ObservableMap::Handle hMap,
01033                         MapListener::Handle hListener, Converter::View vConvKey,
01034                         Converter::View vConvVal);
01035 
01036             // ----- MapListener interface ------------------------------
01037 
01038             public:
01039                 /**
01040                 * {@inheritDoc}
01041                 */
01042                 virtual void entryInserted(MapEvent::View vEvent);
01043 
01044                 /**
01045                 * {@inheritDoc}
01046                 */
01047                 virtual void entryUpdated(MapEvent::View vEvent);
01048 
01049                 /**
01050                 * {@inheritDoc}
01051                 */
01052                 virtual void entryDeleted(MapEvent::View vEvent);
01053 
01054             // ----- Object interface -----------------------------------
01055 
01056             public:
01057                 /**
01058                 * {@inheritDoc}
01059                 */
01060                 virtual bool equals(Object::View v) const;
01061 
01062                 /**
01063                 * {@inheritDoc}
01064                 */
01065                 virtual size32_t hashCode() const;
01066 
01067             // ----- accessors ------------------------------------------
01068 
01069             public:
01070                 /**
01071                 * Get the underlying ObservableMap.
01072                 *
01073                 * @return the underlying map
01074                 */
01075                 virtual ObservableMap::Handle getObservableMap();
01076 
01077                 /**
01078                 * Get the underlying ObservableMap.
01079                 *
01080                 * @return the underlying map
01081                 */
01082                 virtual ObservableMap::View getObservableMap() const;
01083 
01084                 /**
01085                 * Get the underling MapListener.
01086                 *
01087                 * @return the underlying listener
01088                 */
01089                 virtual MapListener::Handle getMapListener();
01090 
01091                 /**
01092                 * Get the underling MapListener.
01093                 *
01094                 * @return the underlying listener
01095                 */
01096                 virtual MapListener::View getMapListener() const;
01097 
01098                 /**
01099                 * Get the Converter used to view an underlying CacheEvent's
01100                 * key through.
01101                 *
01102                 * @return the Converter used to view an underlying
01103                 *         CacheEvent's key
01104                 */
01105                 virtual Converter::View getConverterKeyUp() const;
01106 
01107                 /**
01108                 * Get the Converter used to view an underlying CacheEvent's
01109                 * value through.
01110                 *
01111                 * @return the Converter used to view an underlying
01112                 *         CacheEvent's value
01113                 */
01114                 virtual Converter::View getConverterValueUp() const;
01115 
01116             // ----- data members -------------------------------------------
01117 
01118             protected:
01119                 /**
01120                 * The converting Map the will be the source of converted
01121                 * events.
01122                 */
01123                 FinalHandle<ObservableMap> f_hMap;
01124 
01125                 /**
01126                 * The underlying MapListener.
01127                 */
01128                 FinalHandle<MapListener> f_hListener;
01129 
01130                 /**
01131                 * The Converter to view an underlying CacheEvent's key.
01132                 */
01133                 FinalView<Converter> f_vConvKey;
01134 
01135                 /**
01136                 * The Converter to view an underlying CacheEvent's value.
01137                 */
01138                 FinalView<Converter> f_vConvVal;
01139             };
01140 
01141 
01142         // ----- inner class: ConverterObservableMap ------------------------
01143 
01144         /**
01145         * A Converter ObservableMap views an underlying ObservableMap through
01146         * a set of key and value Converters.
01147         */
01148         class COH_EXPORT ConverterObservableMap
01149             : public class_spec<ConverterObservableMap,
01150                 extends<ConverterMap>,
01151                 implements<ObservableMap> >
01152             {
01153             friend class factory<ConverterObservableMap>;
01154 
01155             // ----- constructors ---------------------------------------
01156 
01157             protected:
01158                 /**
01159                 * Create a ConverterObservableMap which delegates to the
01160                 * specified ObservableMap.
01161                 *
01162                 * @param hMap      underlying ObservableMap
01163                 * @param vConvUp   EntryConverter from the underlying Map
01164                 * @param vConvDown EntryConverter to the underlying Map
01165                 */
01166                 ConverterObservableMap(ObservableMap::Handle hMap,
01167                         EntryConverter::View vConvUp,
01168                         EntryConverter::View vConvDown);
01169 
01170                 /**
01171                 * Create a ConverterObservableMap which delegates to the
01172                 * specified ObservableMap.
01173                 *
01174                 * @param vMap      underlying ObservableMap
01175                 * @param vConvUp   EntryConverter from the underlying Map
01176                 * @param vConvDown EntryConverter to the underlying Map
01177                 */
01178                 ConverterObservableMap(ObservableMap::View vMap,
01179                         EntryConverter::View vConvUp,
01180                         EntryConverter::View vConvDown);
01181 
01182             // ----- ObservableMap interface ----------------------------
01183 
01184             public:
01185                 /**
01186                 * {@inheritDoc}
01187                 */
01188                 virtual void addKeyListener(MapListener::Handle hListener,
01189                         Object::View vKey, bool fLite);
01190 
01191                 /**
01192                 * {@inheritDoc}
01193                 */
01194                 virtual void removeKeyListener(MapListener::Handle hListener,
01195                         Object::View vKey);
01196 
01197                 /**
01198                 * {@inheritDoc}
01199                 */
01200                 virtual void addFilterListener(MapListener::Handle hListener,
01201                         Filter::View vFilter, bool fLite);
01202 
01203                 /**
01204                 * {@inheritDoc}
01205                 */
01206                 virtual void removeFilterListener(
01207                         MapListener::Handle hListener, Filter::View vFilter);
01208 
01209             // ----- helper methods -------------------------------------
01210 
01211             protected:
01212                 /**
01213                 * Create a converter listener for the specified listener.
01214                 *
01215                 * @param hListener  the underlying listener
01216                 *
01217                 * @return the converting listener
01218                 */
01219                 virtual MapListener::Handle getConverterListener(
01220                         MapListener::Handle hListener);
01221 
01222             // ----- accessors ------------------------------------------
01223 
01224             public:
01225                 /**
01226                 * Return the underlying ObservableMap.
01227                 *
01228                 * @return the underlying ObservableMap
01229                 */
01230                 virtual ObservableMap::Handle getObservableMap();
01231 
01232                 /**
01233                 * Return the underlying ObservableMap.
01234                 *
01235                 * @return the underlying ObservableMap
01236                 */
01237                 virtual ObservableMap::View getObservableMap() const;
01238             };
01239 
01240 
01241         // ----- inner class: ConverterCacheMap -----------------------------
01242 
01243         /**
01244         * A ConverterCacheMap views an underlying CacheMap through a set
01245         * of key and value Converters.
01246         */
01247         class COH_EXPORT ConverterCacheMap
01248             : public class_spec<ConverterCacheMap,
01249                 extends<ConverterObservableMap>,
01250                 implements<CacheMap> >
01251             {
01252             friend class factory<ConverterCacheMap>;
01253 
01254             // ----- constructors ---------------------------------------
01255 
01256             protected:
01257                 /**
01258                 * Create a ConverterCacheMap which delegates to the specified
01259                 * CacheMap.
01260                 *
01261                 * @param hMap      the specified CacheMap
01262                 * @param vConvUp   the EntryConverter from the underlying
01263                 *                  Map
01264                 * @param vConvDown the EntryConverter to the underlying
01265                 *                  Map
01266                 */
01267                 ConverterCacheMap(CacheMap::Handle hMapDelegate,
01268                              EntryConverter::View vConvUp,
01269                              EntryConverter::View vConvDown);
01270 
01271                 /**
01272                 * Create a ConverterCacheMap which delegates to the specified
01273                 * CacheMap.
01274                 *
01275                 * @param vMap      the specified CacheMap
01276                 * @param vConvUp   the EntryConverter from the underlying
01277                 *                  Map
01278                 * @param vConvDown the EntryConverter to the underlying
01279                 *                  Map
01280                 */
01281                 ConverterCacheMap(CacheMap::View vMapDelegate,
01282                              EntryConverter::View vConvUp,
01283                              EntryConverter::View vConvDown);
01284 
01285             // ----- CacheMap interface -----------------------------
01286 
01287             public:
01288                 /**
01289                 * {@inheritDoc}
01290                 */
01291                 virtual Map::View getAll(Collection::View vKeys) const;
01292 
01293                 /**
01294                 * {@inheritDoc}
01295                 */
01296                 using ConverterMap::put;
01297 
01298                 /**
01299                 * {@inheritDoc}
01300                 */
01301                 virtual Object::Holder put(Object::View vKey,
01302                         Object::Holder ohValue, int64_t cMillis);
01303 
01304             // ----- Map interface ----------------------------------
01305 
01306             public:
01307                 /**
01308                 * {@inheritDoc}
01309                 */
01310                virtual void putAll(Map::View vMap);
01311 
01312 
01313             // ----- accessors --------------------------------------
01314 
01315             public:
01316                 /**
01317                 * Return the underlying CacheMap.
01318                 *
01319                 * @return the underlying CacheMap
01320                 */
01321                 virtual CacheMap::View getCacheMap() const;
01322 
01323                 /**
01324                 * Return the underlying CacheMap.
01325                 *
01326                 * @return the underlying CacheMap
01327                 */
01328                 virtual CacheMap::Handle getCacheMap();
01329             };
01330 
01331         /**
01332         * A Converter ConverterConcurrentMap views an underlying
01333         * ConcurrentMap through a set of key and value Converters.
01334         */
01335         class COH_EXPORT ConverterConcurrentMap
01336             : public class_spec<ConverterConcurrentMap,
01337                 extends<ConverterMap>,
01338                 implements<ConcurrentMap> >
01339             {
01340             friend class factory<ConverterConcurrentMap>;
01341 
01342             // ----- constructors ---------------------------------------
01343 
01344             protected:
01345                 /**
01346                 * Create a ConverterConcurrentMap which delegates to the
01347                 * specified ConcurrentMap.
01348                 *
01349                 * @param hMap      the specified ConcurrentMap
01350                 * @param vConvUp   the EntryConverter from the underlying
01351                 *                  Map
01352                 * @param vConvDown the EntryConverter to the underlying
01353                 *                  Map
01354                 */
01355                 ConverterConcurrentMap(ConcurrentMap::Handle hMapDelegate,
01356                              EntryConverter::View vConvUp,
01357                              EntryConverter::View vConvDown);
01358 
01359                 /**
01360                 * Create a ConverterConcurrentMap which delegates to the
01361                 * specified ConcurrentMap.
01362                 *
01363                 * @param vMap      the specified ConcurrentMap
01364                 * @param vConvUp   the EntryConverter from the underlying
01365                 *                  Map
01366                 * @param vConvDown the EntryConverter to the underlying
01367                 *                  Map
01368                 */
01369                 ConverterConcurrentMap(ConcurrentMap::View vMapDelegate,
01370                              EntryConverter::View vConvUp,
01371                              EntryConverter::View vConvDown);
01372 
01373             // ----- ConcurrentMap interface ----------------------------
01374 
01375             public:
01376                 /**
01377                 * {@inheritDoc}
01378                 */
01379                 virtual bool lock(Object::View vKey, int64_t cWait) const;
01380 
01381                 /**
01382                 * {@inheritDoc}
01383                 */
01384                 virtual bool lock(Object::View vKey) const;
01385 
01386                 /**
01387                 * {@inheritDoc}
01388                 */
01389                 virtual bool unlock(Object::View vKey) const;
01390 
01391             // ----- accessors ------------------------------------------
01392 
01393             public:
01394                 /**
01395                 * Return the underlying ConcurrentMap.
01396                 *
01397                 * @return the underlying ConcurrentMap
01398                 */
01399                 virtual ConcurrentMap::View getConcurrentMap() const;
01400 
01401                 /**
01402                 * Return the underlying ConcurrentMap.
01403                 *
01404                 * @return the underlying ConcurrentMap
01405                 */
01406                 virtual ConcurrentMap::Handle getConcurrentMap();
01407 
01408             };
01409 
01410         /**
01411         * A ConverterInvocable views an underlying InvocableMap through a set
01412         * of key and value Converters.
01413         */
01414         class COH_EXPORT ConverterInvocableMap
01415             : public class_spec<ConverterInvocableMap,
01416                 extends<ConverterMap>,
01417                 implements<InvocableMap> >
01418             {
01419             friend class factory<ConverterInvocableMap>;
01420 
01421             // ----- constructors ---------------------------------------
01422 
01423             protected:
01424                 /**
01425                 * Create a ConverterInvocableMap which delegates to the s
01426                 * pecified InvocableMap.
01427                 *
01428                 * @param hMap      the specified InvocableMap
01429                 * @param vConvUp   the EntryConverter from the underlying
01430                 *                  Map
01431                 * @param vConvDown the EntryConverter to the underlying
01432                 *                  Map
01433                 */
01434                 ConverterInvocableMap(InvocableMap::Handle hMapDelegate,
01435                              EntryConverter::View vConvUp,
01436                              EntryConverter::View vConvDown);
01437 
01438                 /**
01439                 * Create a ConverterInvocableMap which delegates to the s
01440                 * pecified InvocableMap.
01441                 *
01442                 * @param vMap      the specified InvocableMap
01443                 * @param vConvUp   the EntryConverter from the underlying
01444                 *                  Map
01445                 * @param vConvDown the EntryConverter to the underlying
01446                 *                  Map
01447                 */
01448                 ConverterInvocableMap(InvocableMap::View vMapDelegate,
01449                              EntryConverter::View vConvUp,
01450                              EntryConverter::View vConvDown);
01451 
01452             // ----- InvocableMap interface -----------------------------
01453 
01454             public:
01455                 /**
01456                 * {@inheritDoc}
01457                 */
01458                 virtual Object::Holder invoke(Object::View vKey,
01459                         InvocableMap::EntryProcessor::Handle hAgent);
01460 
01461                 /**
01462                 * {@inheritDoc}
01463                 */
01464                 virtual Map::View invokeAll(Collection::View vCollKeys,
01465                         InvocableMap::EntryProcessor::Handle hAgent);
01466 
01467                 /**
01468                 * {@inheritDoc}
01469                 */
01470                 virtual Map::View invokeAll(Filter::View vFilter,
01471                         InvocableMap::EntryProcessor::Handle hAgent);
01472 
01473                 /**
01474                 * {@inheritDoc}
01475                 */
01476                 virtual Object::Holder aggregate(Collection::View vCollKeys,
01477                         InvocableMap::EntryAggregator::Handle hAgent) const;
01478 
01479                 /**
01480                 * {@inheritDoc}
01481                 */
01482                 virtual Object::Holder aggregate(Filter::View vFilter,
01483                         InvocableMap::EntryAggregator::Handle hAgent) const;
01484 
01485             // ----- accessors ------------------------------------------
01486 
01487             public:
01488                 /**
01489                 * Return the underlying InvocableMap.
01490                 *
01491                 * @return the underlying InvocableMap
01492                 */
01493                 virtual InvocableMap::View getInvocableMap() const;
01494 
01495                 /**
01496                 * Return the underlying CacheMap.
01497                 *
01498                 * @return the underlying CacheMap
01499                 */
01500                 virtual InvocableMap::Handle getInvocableMap();
01501             };
01502 
01503 
01504         // ----- inner class: ConverterQueryMap -----------------------------
01505 
01506         /**
01507         * A Converter QueryMap views an underlying QueryMap through a set of
01508         * key and value Converters.
01509         */
01510         class COH_EXPORT ConverterQueryMap
01511             : public class_spec<ConverterQueryMap,
01512                 extends<ConverterMap>,
01513                 implements<QueryMap> >
01514             {
01515             friend class factory<ConverterQueryMap>;
01516 
01517             // ----- constructors -----------------------------------
01518 
01519             protected:
01520                 /**
01521                 * Create a ConverterQueryMap which delegates to the specified
01522                 * QueryMap.
01523                 *
01524                 * @param hMap      the specified InvocableMap
01525                 * @param vConvUp   the EntryConverter from the underlying
01526                 *                  Map
01527                 * @param vConvDown the EntryConverter to the underlying
01528                 *                  Map
01529                 */
01530                 ConverterQueryMap(QueryMap::Handle hMapDelegate,
01531                              EntryConverter::View vConvUp,
01532                              EntryConverter::View vConvDown);
01533 
01534                 /**
01535                 * Create a ConverterQueryMap which delegates to the s
01536                 * pecified QueryMap.
01537                 *
01538                 * @param vMap      the specified InvocableMap
01539                 * @param vConvUp   the EntryConverter from the underlying
01540                 *                  Map
01541                 * @param vConvDown the EntryConverter to the underlying
01542                 *                  Map
01543                 */
01544                 ConverterQueryMap(QueryMap::View vMapDelegate,
01545                              EntryConverter::View vConvUp,
01546                              EntryConverter::View vConvDown);
01547 
01548             // ----- QueryMap interface ---------------------------------
01549 
01550             public:
01551                 /**
01552                 * {@inheritDoc}
01553                 */
01554                 virtual Set::View keySet(Filter::View vFilter) const;
01555 
01556                 /**
01557                 * {@inheritDoc}
01558                 */
01559                 virtual Set::View entrySet(Filter::View vFilter) const;
01560 
01561                 /**
01562                 * {@inheritDoc}
01563                 */
01564                 virtual Set::View entrySet(Filter::View vFilter,
01565                         Comparator::View vComparator) const;
01566 
01567                 /**
01568                 * {@inheritDoc}
01569                 */
01570                 virtual void addIndex(ValueExtractor::View vExtractor,
01571                         bool fOrdered, Comparator::View vComparator);
01572 
01573                 /**
01574                 * {@inheritDoc}
01575                 */
01576                 virtual void removeIndex(ValueExtractor::View vExtractor);
01577 
01578             // ----- Map interface --------------------------------------
01579 
01580             public:
01581                 /**
01582                 * {@inheritDoc}
01583                 */
01584                 using Map::keySet;
01585 
01586                 /**
01587                 * {@inheritDoc}
01588                 */
01589                 using Map::entrySet;
01590 
01591             // ----- accessors ----------------------------------------------
01592 
01593             public:
01594                 /**
01595                 * Return the underlying InvocableMap.
01596                 *
01597                 * @return the underlying InvocableMap
01598                 */
01599                 virtual QueryMap::View getQueryMap() const;
01600 
01601                 /**
01602                 * Return the underlying CacheMap.
01603                 *
01604                 * @return the underlying CacheMap
01605                 */
01606                 virtual QueryMap::Handle getQueryMap();
01607             };
01608 
01609 
01610         /**
01611         * A ConverterNamedCache views an underlying NamedCache through a set
01612         * of key and value Converters.
01613         */
01614         class COH_EXPORT ConverterNamedCache
01615             : public class_spec<ConverterNamedCache,
01616                 extends<ConverterCacheMap>,
01617                 implements<NamedCache> >
01618             {
01619             friend class factory<ConverterNamedCache>;
01620 
01621             // ----- constructors -----------------------------------
01622 
01623             protected:
01624                 /**
01625                 * Create a ConverterQueryMap which delegates to the s
01626                 * pecified QueryMap.
01627                 *
01628                 * @param hMap      the specified InvocableMap
01629                 * @param vConvUp   the EntryConverter from the underlying
01630                 *                  Map
01631                 * @param vConvDown the EntryConverter to the underlying
01632                 *                  Map
01633                 */
01634                 ConverterNamedCache(NamedCache::Handle hMapDelegate,
01635                              EntryConverter::View vConvUp,
01636                              EntryConverter::View vConvDown);
01637 
01638                 /**
01639                 * Create a ConverterQueryMap which delegates to the s
01640                 * pecified QueryMap.
01641                 *
01642                 * @param vMap      the specified InvocableMap
01643                 * @param vConvUp   the EntryConverter from the underlying
01644                 *                  Map
01645                 * @param vConvDown the EntryConverter to the underlying
01646                 *                  Map
01647                 */
01648                 ConverterNamedCache(NamedCache::View vMapDelegate,
01649                              EntryConverter::View vConvUp,
01650                              EntryConverter::View vConvDown);
01651 
01652             // ----- NamedCache interface -------------------------------
01653 
01654             public:
01655                 /**
01656                 * Return the cache name.
01657                 *
01658                 * @return the cache name
01659                 */
01660                 virtual String::View getCacheName() const;
01661 
01662                 /**
01663                 * Return the CacheService that this NamedCache is a part of.
01664                 *
01665                 * @return the CacheService
01666                 */
01667                 virtual CacheService::Handle getCacheService();
01668 
01669                 /**
01670                 * Return the CacheService that this NamedCache is a part of.
01671                 *
01672                 * @return the CacheService
01673                 */
01674                 virtual CacheService::View getCacheService() const;
01675 
01676                 /**
01677                 * Specifies whether or not the NamedCache is active.
01678                 *
01679                 * @return true if the NamedCache is active; false otherwise
01680                 */
01681                 virtual bool isActive() const;
01682 
01683                 /**
01684                 * Release local resources associated with this instance of
01685                 * NamedCache.
01686                 *
01687                 * Releasing a cache makes it no longer usable, but does not
01688                 * affect the cache itself. In other words, all other
01689                 * references to the cache will still be valid, and the cache
01690                 * data is not affected by releasing the reference. Any
01691                 * attempt to use this reference afterword will result in an
01692                 * exception.
01693                 *
01694                 * @see CacheService#releaseCache
01695                 */
01696                 virtual void release();
01697 
01698                 /**
01699                 * Release and destroy this instance of NamedCache.
01700                 *
01701                 * <b>Warning:</b> This method is used to completely destroy
01702                 * the specified cache across the cluster. All references in
01703                 * the entire cluster to this cache will be invalidated, the
01704                 * cached data will be cleared, and all resources will be
01705                 * released.
01706                 *
01707                 * @see CacheService#destroyCache
01708                 */
01709                 virtual void destroy();
01710 
01711             // ----- ConcurrentMap interface ----------------------------
01712 
01713             public:
01714                 /**
01715                 * {@inheritDoc}
01716                 */
01717                 virtual bool lock(Object::View vKey, int64_t cWait) const;
01718 
01719                 /**
01720                 * {@inheritDoc}
01721                 */
01722                 virtual bool lock(Object::View vKey) const;
01723 
01724                 /**
01725                 * {@inheritDoc}
01726                 */
01727                 virtual bool unlock(Object::View vKey) const;
01728 
01729             // ----- InvocableMap interface -----------------------------
01730 
01731             public:
01732                 /**
01733                 * {@inheritDoc}
01734                 */
01735                 virtual Object::Holder invoke(Object::View vKey,
01736                         InvocableMap::EntryProcessor::Handle hAgent);
01737 
01738                 /**
01739                 * {@inheritDoc}
01740                 */
01741                 virtual Map::View invokeAll(Collection::View vCollKeys,
01742                         InvocableMap::EntryProcessor::Handle hAgent);
01743 
01744                 /**
01745                 * {@inheritDoc}
01746                 */
01747                 virtual Map::View invokeAll(Filter::View vFilter,
01748                         InvocableMap::EntryProcessor::Handle hAgent);
01749 
01750                 /**
01751                 * {@inheritDoc}
01752                 */
01753                 virtual Object::Holder aggregate(Collection::View vCollKeys,
01754                         InvocableMap::EntryAggregator::Handle hAgent) const;
01755 
01756                 /**
01757                 * {@inheritDoc}
01758                 */
01759                 virtual Object::Holder aggregate(Filter::View vFilter,
01760                         InvocableMap::EntryAggregator::Handle hAgent) const;
01761 
01762             // ----- QueryMap interface ---------------------------------
01763 
01764             public:
01765                 /**
01766                 * {@inheritDoc}
01767                 */
01768                 virtual Set::View keySet(Filter::View vFilter) const;
01769 
01770                 /**
01771                 * {@inheritDoc}
01772                 */
01773                 virtual Set::View entrySet(Filter::View vFilter) const;
01774 
01775                 /**
01776                 * {@inheritDoc}
01777                 */
01778                 virtual Set::View entrySet(Filter::View vFilter,
01779                         Comparator::View vComparator) const;
01780 
01781                 /**
01782                 * {@inheritDoc}
01783                 */
01784                 virtual void addIndex(ValueExtractor::View vExtractor,
01785                         bool fOrdered, Comparator::View vComparator);
01786 
01787                 /**
01788                 * {@inheritDoc}
01789                 */
01790                 virtual void removeIndex(ValueExtractor::View vExtractor);
01791 
01792             // ----- Map interface --------------------------------------
01793 
01794             public:
01795                 /**
01796                 * {@inheritDoc}
01797                 */
01798                 using Map::keySet;
01799 
01800                 /**
01801                 * {@inheritDoc}
01802                 */
01803                 using Map::entrySet;
01804 
01805             // ----- accessors ------------------------------------------
01806 
01807             public:
01808                 /**
01809                 * Return the underlying InvocableMap.
01810                 *
01811                 * @return the underlying InvocableMap
01812                 */
01813                 virtual NamedCache::View getNamedCache() const;
01814 
01815                 /**
01816                 * Return the underlying CacheMap.
01817                 *
01818                 * @return the underlying CacheMap
01819                 */
01820                 virtual NamedCache::Handle getNamedCache();
01821 
01822                 /**
01823                 * Return the underlying ConcurrentMap.
01824                 *
01825                 * @return the underlying ConcurrentMap
01826                 */
01827                 virtual ConcurrentMap::View getConcurrentMap() const;
01828 
01829                 /**
01830                 * Return the underlying ConcurrentMap.
01831                 *
01832                 * @return the underlying ConcurrentMap
01833                 */
01834                 virtual ConcurrentMap::Handle getConcurrentMap();
01835 
01836                 /**
01837                 * Return the underlying InvocableMap.
01838                 *
01839                 * @return the underlying InvocableMap
01840                 */
01841                 virtual InvocableMap::View getInvocableMap() const;
01842 
01843                 /**
01844                 * Return the underlying InvocableMap.
01845                 *
01846                 * @return the underlying InvocableMap
01847                 */
01848                 virtual InvocableMap::Handle getInvocableMap();
01849 
01850                 /**
01851                 * Return the underlying QueryMap.
01852                 *
01853                 * @return the underlying QueryMap
01854                 */
01855                 virtual QueryMap::View getQueryMap() const;
01856 
01857                 /**
01858                 * Return the underlying QueryMap.
01859                 *
01860                 * @return the underlying QueryMap
01861                 */
01862                 virtual QueryMap::Handle getQueryMap();
01863 
01864             // ---- data members ----------------------------------------
01865 
01866             protected:
01867                 /**
01868                 * A Converter ConcurrentMap around the underlying NamedCache.
01869                 */
01870                 FinalHolder<ConverterConcurrentMap> f_ohMapConcurrent;
01871 
01872                 /**
01873                 * A Converter InvocableMap around the underlying NamedCache.
01874                 */
01875                 FinalHolder<ConverterInvocableMap> f_ohMapInvocable;
01876 
01877                 /**
01878                 * A Converter QueryMap around the underlying NamedCache.
01879                 */
01880                 FinalHolder<ConverterQueryMap> f_ohMapQuery;
01881             };
01882 
01883 
01884         // ----- inner class: UnsupportedConverter --------------------------
01885 
01886         /**
01887         * Converter which always throws an UnsupportedOperationException.
01888         */
01889         class COH_EXPORT UnsupportedConverter
01890             : public class_spec<UnsupportedConverter,
01891                 extends<Object>,
01892                 implements<Converter> >
01893             {
01894             friend class factory<UnsupportedConverter>;
01895 
01896             // ----- constructor ----------------------------------------
01897 
01898             public:
01899                 /**
01900                 * Create an UnsupportedConverter
01901                 *
01902                 * return a handle to the new UnsupportedConverter
01903                 */
01904                 UnsupportedConverter();
01905 
01906             // ----- Converter interface --------------------------------
01907 
01908             public:
01909                 /**
01910                 * {@inheritDoc}
01911                 *
01912                 * @throws UnsupportedOperationException always
01913                 */
01914                 virtual Object::Holder convert(Object::Holder oh) const;
01915 
01916                 /**
01917                 * Return a singleton instance of the UnsupportedConverter.
01918                 */
01919                 static UnsupportedConverter::View getInstance();
01920             };
01921     };
01922 
01923 COH_CLOSE_NAMESPACE2
01924 
01925 #endif // COH_CONVERTER_COLLECTIONS_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.