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

E26041-01

coherence/net/ConfigurableCacheFactory.hpp

00001 /*
00002 * ConfigurableCacheFactory.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_CONFIGURABLE_CACHE_FACTORY_HPP
00017 #define COH_CONFIGURABLE_CACHE_FACTORY_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/net/NamedCache.hpp"
00022 #include "coherence/net/Service.hpp"
00023 #include "coherence/run/xml/XmlConfigurable.hpp"
00024 
00025 COH_OPEN_NAMESPACE2(coherence,net)
00026 
00027 using coherence::run::xml::XmlConfigurable;
00028 
00029 /**
00030 * An interface for XML driven %cache factory.
00031 *
00032 * @see DefaultConfigurableCacheFactory
00033 */
00034 class COH_EXPORT ConfigurableCacheFactory
00035     : public interface_spec<ConfigurableCacheFactory,
00036         implements<XmlConfigurable> >
00037     {
00038     // ----- ConfigurableCacheFactory interface -----------------------------
00039 
00040     public:
00041         /**
00042         * Ensure a %cache for the given name using the corresponding XML
00043         * configuration.
00044         *
00045         * @param vsCacheName the %cache name
00046         *
00047         * @return a handle to a NamedCache created according to the
00048         *         configuration XML
00049         */
00050         virtual NamedCache::Handle ensureCache(String::View vsCacheName) = 0;
00051 
00052         /**
00053         * Releases and destroys the specified NamedCache.
00054         *
00055         * <b>Warning:</b> This method is used to completely destroy the
00056         * specified %cache across the cluster. All references in the entire
00057         * cluster to this %cache will be invalidated, the cached data will be
00058         * cleared, and all resources will be released.
00059         *
00060         * @param hCache the NamedCache object to be destroyed
00061         *
00062         * @see releaseCache
00063         */
00064         virtual void destroyCache(NamedCache::Handle hCache) = 0;
00065 
00066         /**
00067         * Release local resources associated with the specified instance of
00068         * the %cache.
00069         *
00070         * Releasing a NamedCache reference makes it no longer usable, but
00071         * does not affect the content of the %cache. In other words, all other
00072         * references to the %cache will still be valid, and the %cache data is
00073         * not affected by releasing the reference.
00074         *
00075         * The reference that is released using this method can no longer be
00076         * used; any attempt to use the reference will result in an exception.
00077         *
00078         * @param hCache the NamedCache object to be released
00079         *
00080         * @see destroyCache
00081         */
00082         virtual void releaseCache(NamedCache::Handle hCache) = 0;
00083 
00084         /**
00085         * Ensure a service for the given name using the corresponding XML
00086         * configuration.
00087         *
00088         * @param vsServiceName the service name
00089         *
00090         * @return a handle to a service created according to the
00091         *         configuration XML
00092         */
00093         virtual Service::Handle ensureService(String::View vsServiceName) = 0;
00094 
00095         /**
00096         * Shutdown all services related to this ConfigurableCacheFactory.
00097         */
00098         virtual void shutdown() = 0;
00099     };
00100 
00101 COH_CLOSE_NAMESPACE2
00102 
00103 #endif // COH_CONFIGURABLE_CACHE_FACTORY_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.