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

E90870-01

coherence/util/extractor/AbstractUpdater.hpp

00001 /*
00002 * AbstractUpdater.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_ABSTRACT_UPDATER_HPP
00017 #define COH_ABSTRACT_UPDATER_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/InvocableMap.hpp"
00022 #include "coherence/util/ValueUpdater.hpp"
00023 
00024 COH_OPEN_NAMESPACE3(coherence,util,extractor)
00025 
00026 
00027 /**
00028 * Abstract base for ValueUpdater implementations.
00029 * <p/>
00030 * Starting with Coherence 3.6, when used to update information stored in a Map,
00031 * subclasses have the additional ability to operate against the Map::Entry
00032 * instead of just the value. This allows an updater implementation to update a
00033 * desired value using all available information on the corresponding Map::Entry
00034 * object and is intended to be used in advanced custom scenarios, when
00035 * application code needs to look at both key and value at the same time or can
00036 * make some very specific assumptions regarding to the implementation details of
00037 * the underlying Entry object (e.g. BinaryEntry).
00038 * To maintain full backwards compatibility, the default behavior remains to
00039 * update the Value property of the Map.Entry.
00040 * <p/>
00041 * <b>Note:</b> subclasses are responsible for POF and/or Lite serialization of
00042 * the updater.
00043 *
00044 * @author gg 2009.09.11
00045 * @since Coherence 3.6
00046 */
00047 class COH_EXPORT AbstractUpdater
00048     : public abstract_spec<AbstractUpdater,
00049         extends<Object>,
00050         implements<ValueUpdater> >
00051     {
00052     // ----- ValueUpdater interface -----------------------------------------
00053 
00054     public:
00055         /**
00056         * {@inheritDoc}
00057         */
00058         virtual void update(Object::Handle hTarget, Object::Holder ohValue) const;
00059 
00060 
00061     // ----- subclassing support --------------------------------------------
00062 
00063     public:
00064         /**
00065         * Update the state of the passed entry using the passed value.
00066         * <p/>
00067         * By overriding this method, an updater implementation is able to update
00068         * the entry's value using all available information on the corresponding
00069         * Map::Entry object and is intended to be used in advanced custom scenarios,
00070         * when application code needs to look at both key and value at the same time
00071         * or can make some very specific assumptions regarding to the implementation
00072         * details of the underlying Entry object.
00073         *
00074         * @param hEntry   the Entry object whose value is to be updated
00075         * @param ohValue  the new value to update the entry with;  for intrinsic
00076         *                 types, the specified value is expected to be a standard
00077         *                 wrapper type in the same manner that reflection works
00078         *                 (e.g. an int value would be passed as a Integer32)
00079         */
00080         virtual void updateEntry(Map::Entry::Handle hEntry, Object::Holder ohValue) const;
00081     };
00082 
00083 COH_CLOSE_NAMESPACE3
00084 
00085 #endif // COH_ABSTRACT_UPDATER_HPP
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.