Class CacheManager


  • public final class CacheManager
    extends java.lang.Object
    Provides and manages the instance of Cache
    • Constructor Detail

      • CacheManager

        public CacheManager()
    • Method Detail

      • getCaches

        public static CacheCollection getCaches()
        Returns CacheCollection of the caches initialized within the same application domain.
        Returns:
        The collection of caches within the same application domain.
      • setConfigPath

        public static void setConfigPath​(java.lang.String path)
        hidden
        Parameters:
        path -
      • getCache

        public static Cache getCache​(java.lang.String cacheName)
                              throws java.lang.Exception
        Returns an instance of Cache for this application.
        Parameters:
        cacheName - The identifier for the Cache.
        Returns:
        Instance of Cache.
        Throws:
        java.lang.Exception
      • getCache

        public static Cache getCache​(java.lang.String cacheName,
                                     CacheConnectionOptions cacheConnectionOptions)
                              throws java.lang.Exception
        Returns an instance of Cache for this application.
        Parameters:
        cacheName - The identifier for the Cache.
        cacheConnectionOptions - CacheConnectionOptions parameters for cache connection.
        Returns:
        Instance of Cache.
        Throws:
        java.lang.Exception
      • getCache

        public static Cache getCache​(java.lang.String cacheName,
                                     CacheConnectionOptions cacheConnectionOptions,
                                     java.lang.String clientCacheName,
                                     CacheConnectionOptions clientCacheConnectionOptions)
                              throws java.lang.Exception
        Returns an instance of Cache for this application.
        Parameters:
        cacheName - The identifier for the Cache.
        cacheConnectionOptions - CacheConnectionOptions parameters for cache connection.
        clientCacheName - The identifier for the ClientCache.
        clientCacheConnectionOptions - CacheConnectionOptions parameters for ClientCache connection.
        Returns:
        Instance of Cache.
        Throws:
        java.lang.Exception
      • startCache

        public static void startCache​(java.lang.String cacheName,
                                      CacheConnection connection)
                               throws Alachisoft.NCache.Common.Exceptions.ManagementException,
                                      java.net.UnknownHostException,
                                      ConfigurationException
        Starts an out-proc cache. The end result is the same as that of starting the cache using NCache Manager. It starts the cache on the specified cache server. If the Cache Server could not be contacted then it throws a ManagementException exception. It tries to get the Security Parameters from the client.ncconf.
        Parameters:
        cacheName - The identifier for the Cache.
        connection - CacheConnection parameters for connection to Cache.
        Throws:
        Alachisoft.NCache.Common.Exceptions.ManagementException
        java.net.UnknownHostException
        ConfigurationException
      • stopCache

        public static void stopCache​(java.lang.String cacheName,
                                     CacheConnection connection,
                                     boolean gracefullyShutDownNode)
                              throws Alachisoft.NCache.Common.Exceptions.ManagementException,
                                     java.net.UnknownHostException,
                                     ConfigurationException
        Stops an out-proc cache. The end result is the same as that of stoping the cache using NCache Manager. It stops the cache only on the same server where the client application is running. If the Cache Server could not be contacted then it throws a ManagementException exception. It tries to get the Security Parameters from the client.ncconf.
        Parameters:
        cacheName - The identifier for the Cache.
        connection - CacheConnection parameters for connection to Cache.
        gracefullyShutDownNode - The flag for graceful node shutdown.
        Throws:
        Alachisoft.NCache.Common.Exceptions.ManagementException
        java.net.UnknownHostException
        ConfigurationException