Package com.alachisoft.ncache.client
Class CacheManager
- java.lang.Object
-
- com.alachisoft.ncache.client.CacheManager
-
public final class CacheManager extends java.lang.ObjectProvides and manages the instance ofCache.
-
-
Constructor Summary
Constructors Constructor Description CacheManager()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CachegetCache(java.lang.String cacheName)Returns an instance ofCachefor this application.static CachegetCache(java.lang.String cacheName, CacheConnectionOptions cacheConnectionOptions)Returns an instance ofCachefor this application.static CachegetCache(java.lang.String cacheName, CacheConnectionOptions cacheConnectionOptions, java.lang.String clientCacheName, CacheConnectionOptions clientCacheConnectionOptions)Returns an instance ofCachefor this application.static CacheCollectiongetCaches()ReturnsCacheCollectionof the caches initialized within the same application domain.static voidsetConfigPath(java.lang.String path)hiddenstatic voidstartCache(java.lang.String cacheName, CacheConnection connection)Starts an OutProc cache.static voidstopCache(java.lang.String cacheName, CacheConnection connection, boolean gracefullyShutDownNode)Stops an OutProc cache.
-
-
-
Method Detail
-
getCaches
public static CacheCollection getCaches()
ReturnsCacheCollectionof 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 ofCachefor this application.
-
getCache
public static Cache getCache(java.lang.String cacheName, CacheConnectionOptions cacheConnectionOptions) throws java.lang.Exception
Returns an instance ofCachefor this application.- Parameters:
cacheName- The identifier for theCache.cacheConnectionOptions-CacheConnectionOptionsparameters 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 ofCachefor this application.- Parameters:
cacheName- The identifier for theCache.cacheConnectionOptions-CacheConnectionOptionsparameters for cache connection.clientCacheName- The identifier for the ClientCache.clientCacheConnectionOptions-CacheConnectionOptionsparameters 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, ConfigurationExceptionStarts an OutProc cache. The end result is the same as that of starting the cache using the NCache Manager. It starts the cache on the specified cache server. If the Cache Server could not be contacted then it throws aManagementExceptionexception. It tries to get the Security Parameters from the client.ncconf.- Parameters:
cacheName- The identifier for theCache.connection-CacheConnectionparameters for connection to cache.- Throws:
Alachisoft.NCache.Common.Exceptions.ManagementExceptionjava.net.UnknownHostExceptionConfigurationException
-
stopCache
public static void stopCache(java.lang.String cacheName, CacheConnection connection, boolean gracefullyShutDownNode) throws Alachisoft.NCache.Common.Exceptions.ManagementException, java.net.UnknownHostException, ConfigurationExceptionStops an OutProc 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 aManagementExceptionexception. It tries to get the Security Parameters from the client.ncconf.- Parameters:
cacheName- The identifier for theCache.connection-CacheConnectionparameters for connection to cache.gracefullyShutDownNode- The flag for graceful node shutdown.- Throws:
Alachisoft.NCache.Common.Exceptions.ManagementExceptionjava.net.UnknownHostExceptionConfigurationException
-
-