00001 /* 00002 * CacheLoader.hpp 00003 * 00004 * Copyright (c) 2000, 2020, 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_CACHE_LOADER_HPP 00017 #define COH_CACHE_LOADER_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/Collection.hpp" 00022 #include "coherence/util/Map.hpp" 00023 00024 COH_OPEN_NAMESPACE3(coherence,net,cache) 00025 00026 using coherence::util::Collection; 00027 using coherence::util::Map; 00028 00029 00030 /** 00031 * A cache loader. 00032 * 00033 * @author jh 2008.03.12 00034 */ 00035 class COH_EXPORT CacheLoader 00036 : public interface_spec<CacheLoader> 00037 { 00038 // ----- CacheLoader interface ------------------------------------------ 00039 00040 public: 00041 /** 00042 * Return the value associated with the specified key, or NULL if the 00043 * key does not have an associated value in the underlying store. 00044 * 00045 * @param vKey key whose associated value is to be returned 00046 * 00047 * @return the value associated with the specified key, or 00048 * <tt>NULL</tt> if no value is available for that key 00049 */ 00050 virtual Object::Holder load(Object::View vKey) = 0; 00051 00052 /** 00053 * Return the values associated with each the specified keys in the 00054 * passed collection. If a key does not have an associated value in 00055 * the underlying store, then the return map will not have an entry 00056 * for that key. 00057 * 00058 * @param vColKeys a collection of keys to load 00059 * 00060 * @return a Map of keys to associated values for the specified keys 00061 */ 00062 virtual Map::View loadAll(Collection::View vColKeys) = 0; 00063 }; 00064 00065 COH_CLOSE_NAMESPACE3 00066 00067 #endif // COH_CACHE_LOADER_HPP