Interface ConfigurableCacheFactory

    • Method Detail

      • activate

        void activate()
        Activate prepares the factory to be used within a container and should be called before any other factory method.
        Since:
        Coherence 12.1.2
      • dispose

        void dispose()
        Dispose of this factory. This will stop all services that were started by this factory and dispose of all resources registered via getResourceRegistry(). This factory may not be used after invoking dispose.
        Since:
        Coherence 12.1.2
      • isDisposed

        default boolean isDisposed()
        Return true if this factory has been disposed via invocation of dispose().
        Returns:
        true if this factory has been disposed
      • ensureCache

        default <K,​V> NamedCache<K,​V> ensureCache​(String sCacheName,
                                                              ClassLoader loader)
        Ensure an cache for the given name and classloader (using raw types).
        Parameters:
        sCacheName - the cache name
        loader - ClassLoader that should be used to deserialize objects in the cache
        Returns:
        a NamedCache created
      • ensureCache

        <K,​V> NamedCache<K,​V> ensureCache​(String sCacheName,
                                                      ClassLoader loader,
                                                      NamedMap.Option... options)
        Ensure an cache for the given name, classloader and options.
        Parameters:
        sCacheName - the cache name
        loader - ClassLoader that should be used to deserialize objects in the cache
        options - the NamedMap.Options
        Returns:
        a NamedCache created
      • ensureTypedCache

        default <K,​V> NamedCache<K,​V> ensureTypedCache​(String sCacheName,
                                                                   ClassLoader loader,
                                                                   TypeAssertion<K,​V> assertion)
        Ensure a cache for the given name satisfying the specified type assertion.
        Parameters:
        sCacheName - the cache name
        loader - the ClassLoader to use for deserializing cache entries
        assertion - the TypeAssertion for asserting the type of keys and values for the NamedCache
        Returns:
        a NamedCache created
        Since:
        Coherence 12.2.1
      • releaseCache

        void releaseCache​(NamedCache<?,​?> cache)
        Release a cache and its associated resources.

        Releasing a cache makes it no longer usable, but does not affect the cache itself. In other words, all other references to the cache will still be valid, and the cache data is not affected by releasing the reference. Any attempt to use the released cache reference afterword will result in an exception.

        Parameters:
        cache - the cache to release
        Since:
        Coherence 3.5.1
      • destroyCache

        void destroyCache​(NamedCache<?,​?> cache)
        Release and destroy this instance of NamedCache.

        Warning: This method is used to completely destroy the specified cache across the cluster. All references in the entire cluster to this cache will be invalidated, the cached data will be cleared, and all internal and associated resources will be released.

        Parameters:
        cache - the cache to release
        Since:
        Coherence 3.5.1
      • ensureTopic

        default <V> NamedTopic<V> ensureTopic​(String sName,
                                              NamedCollection.Option... options)
        Ensure an Object-based topic for the given name.
        Parameters:
        sName - the topic name
        options - the NamedCollection.Options to control any optional topic configuration
        Returns:
        a NamedTopic created
        Since:
        Coherence 14.1.1
      • ensureTopic

        <V> NamedTopic<V> ensureTopic​(String sName,
                                      ClassLoader loader,
                                      NamedCollection.Option... options)
        Ensure an Object-based topic for the given name.
        Parameters:
        sName - the topic name
        loader - ClassLoader that should be used to deserialize objects in the cache
        options - the NamedCollection.Options to control any optional topic configuration
        Returns:
        a NamedTopic created
        Since:
        Coherence 14.1.1
      • releaseTopic

        void releaseTopic​(NamedTopic<?> topic)
        Release a NamedTopic and its associated resources.

        Releasing a topic makes it no longer usable, but does not affect the topic itself. In other words, all other references to the topic will still be valid, and the topic data is not affected by releasing the reference. Any attempt to use the released topic reference afterword will result in an exception.

        Parameters:
        topic - the topic to release
        Since:
        Coherence 14.1.1
      • destroyTopic

        void destroyTopic​(NamedTopic<?> topic)
        Release and destroy this instance of NamedTopic.

        Warning: This method is used to completely destroy the specified topic across the cluster. All references in the entire cluster to this topic will be invalidated, the topic data will be cleared, and all internal and associated resources will be released.

        Parameters:
        topic - the topic to release
        Since:
        Coherence 14.1.1
      • ensureService

        Service ensureService​(String sServiceName)
        Ensure a service for the given name.
        Parameters:
        sServiceName - the service name
        Returns:
        a Service created
      • getResourceRegistry

        ResourceRegistry getResourceRegistry()
        Return the ResourceRegistry for this factory.
        Returns:
        the ResourceRegistry for this factory
        Since:
        Coherence 12.1.2
      • isCacheActive

        boolean isCacheActive​(String sCacheName,
                              ClassLoader loader)
        Validate whether a cache with the given name is active in the context of the given ClassLoader. The ClassLoader should be the same as provided to a previous call to ensureCache(String, ClassLoader, NamedCache.Option...).
        Parameters:
        sCacheName - the cache name
        loader - the ClassLoader used to originally obtain the cache
        Returns:
        true if cache is active in context of the provided ClassLoader
        Since:
        Coherence 12.2.1
      • isTopicActive

        boolean isTopicActive​(String sTopicName,
                              ClassLoader loader)
        Validate whether a topic with the given name is active in the context of the given ClassLoader. The ClassLoader should be the same as provided to a previous call to ensureTopic(String, ClassLoader, NamedTopic.Option...).
        Parameters:
        sTopicName - the topic name
        loader - the ClassLoader used to originally obtain the topic
        Returns:
        true if topic is active in context of the provided ClassLoader
        Since:
        Coherence 20.12
      • getScopeName

        default String getScopeName()
        Return the scope name of this cache factory, if available.
        Returns:
        the scope name of this cache factory, if available; null otherwise