|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alachisoft.ncache.web.caching.NCache
public final class NCache
Provides static methods and properties to to aid with clustered cache initialization and access. This class cannot be inherited.
Constructor Summary | |
---|---|
NCache()
|
Method Summary | |
---|---|
static CacheCollection |
getCaches()
Maintains the list of running caches. |
static java.lang.String |
getConfigPath()
|
static Cache |
initializeCache(java.lang.String cacheId)
Initializes the cache based on the cacheid. |
static Cache |
initializeCache(java.lang.String cacheId,
CacheInitParams initParams)
|
static Cache |
initializeCache(java.lang.String cacheId,
SecurityParams primary,
SecurityParams secondary)
Initializes the cache represente by the cache id. |
static Cache |
initializeCache(java.lang.String cacheId,
java.lang.String clientCacheId)
Initializes the cache represented by the cache id. |
static Cache |
initializeCache(java.lang.String cacheId,
java.lang.String server,
int port)
Initializes the cache represente by the cache id. |
static Cache |
initializeCache(java.lang.String cacheId,
java.lang.String server,
int port,
boolean balanceNodes)
Initializes the cache represent by the cache id. |
static Cache |
initializeCache(java.lang.String cacheId,
java.lang.String server,
int port,
SecurityParams primary,
SecurityParams secondary)
Initializes the cache represented by the cache id. |
static void |
setConfigPath(java.lang.String path)
Sets the directory path where the NCache configuration files are placed. |
static void |
setExceptionsEnabled(boolean value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NCache()
Method Detail |
---|
public static CacheCollection getCaches()
public static java.lang.String getConfigPath()
public static Cache initializeCache(java.lang.String cacheId) throws ConfigurationException, GeneralFailureException, CacheException
cacheId
- The id of the cache to be initialized.
CacheException
- Thrown incase of any error during intializaing the cache.
ConfigurationException
- Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
GeneralFailureException
- Thrown when an exception occurs during a clustered operation.public static Cache initializeCache(java.lang.String cacheId, CacheInitParams initParams) throws ConfigurationException, GeneralFailureException, CacheException
cacheId
- The cache id to initialize.initParams
- initialization parameters, Security Credentials and other properties are provided here, if null is provided, default instance of CacheInitParams is used.
ConfigurationException
GeneralFailureException
CacheException
CacheInitParams
public static Cache initializeCache(java.lang.String cacheId, SecurityParams primary, SecurityParams secondary) throws ConfigurationException, GeneralFailureException, CacheException
primary
- The primary user credentials. SecurityParams
secondary
- The secondary user credentials. These credentials are used incase primary credentials are not authorized. SecurityParams
cacheId
- The cache id to initialize.
CacheException
- Thrown incase of any error during intializing the cache.
ConfigurationException
- Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
GeneralFailureException
- Thrown when an exception occurs during a clustered operation.public static Cache initializeCache(java.lang.String cacheId, java.lang.String clientCacheId) throws ConfigurationException, GeneralFailureException, CacheException
cacheId
- The cache id to initialize.clientCacheId
- Name of Inproc ClientCache
CacheException
- Thrown incase of any error during initializing the cache.
ConfigurationException
- Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
GeneralFailureException
- Thrown when an exception occurs during a clustered operation.public static Cache initializeCache(java.lang.String cacheId, java.lang.String server, int port) throws ConfigurationException, GeneralFailureException, CacheException
cacheId
- The cache id to initialize.server
- The name of the node where the NCache server is running.port
- the port of the NCache server.
CacheException
- Thrown incase of any error during initializing the cache.
ConfigurationException
- Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
GeneralFailureException
- Thrown when an exception occurs during a clustered operation.public static Cache initializeCache(java.lang.String cacheId, java.lang.String server, int port, boolean balanceNodes) throws ConfigurationException, GeneralFailureException, CacheException
cacheId
- The cache id to initialize.server
- The name of the node where the NCache server is running.port
- the port of the NCache server.balanceNodes
- true to select the least loaded server, false to connect to the given server anyway.
CacheException
- Thrown incase of any error during intializing the cache.
ConfigurationException
- Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
GeneralFailureException
- Thrown when an exception occurs during a clustered operation.public static Cache initializeCache(java.lang.String cacheId, java.lang.String server, int port, SecurityParams primary, SecurityParams secondary) throws ConfigurationException, GeneralFailureException, CacheException
primary
- The primary user credentials. SecurityParams
secondary
- The secondary user credentials. These credentials are used incase primary credentials are not authorized. SecurityParams
cacheId
- The cache id to initialize.server
- The name of the node where the NCache server is running.port
- the port of the NCache server.
CacheException
- Thrown incase of any error during initializing the cache.
ConfigurationException
- Thrown when an exception occurs during configuration. Likely causes are badly specified configuration strings.
GeneralFailureException
- Thrown when an exception occurs during a clustered operation.public static void setConfigPath(java.lang.String path)
path
- The directory path of configuration files.public static void setExceptionsEnabled(boolean value)
value
- Flag that indicates whether exceptions are enabled or not.
If this property is set the Cache object
throws exceptions from public operations. If not set no exception is thrown and the
operation fails silently. Setting this flag is especially helpful during
development phase of application since exceptions provide more information about
the specific causes of failure.Cache
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |