com.scaleoutsoftware.soss.client
Class CacheFactory

java.lang.Object
  extended by com.scaleoutsoftware.soss.client.CacheFactory

public final class CacheFactory
extends Object

This class contains static methods for creating NamedCaches.


Method Summary
static NamedCache getCache()
          Creates a NamedCache using the default application id.
static NamedCache getCache(com.scaleoutsoftware.soss.client.da.StateServerKey key)
          Creates a NamedCache using the application id extracted from the StateServerKey.
static NamedCache getCache(com.scaleoutsoftware.soss.client.da.StateServerKey key, boolean registerForEvents)
          Deprecated. the event handling will be automatically enabled when the listener is registered NamedCache.addListener(NamedCacheObjectExpirationListener); there is no need to explicitly enable them.
static NamedCache getCache(String name)
          Creates a NamedCache using a specified name.
static NamedCache getCache(String name, boolean registerForEvents)
          Deprecated. the event handling will be automatically enabled when the listener is registered NamedCache.addListener(NamedCacheObjectExpirationListener); there is no need to explicitly enable them.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCache

public static NamedCache getCache()
                           throws NamedCacheException
Creates a NamedCache using the default application id.

Returns:
instance of NamedCache
Throws:
NamedCacheException - Thrown if NamedCache has experienced an internal error.

getCache

public static NamedCache getCache(String name)
                           throws NamedCacheException
Creates a NamedCache using a specified name.

Parameters:
name - cache name
Returns:
instance of NamedCache
Throws:
NamedCacheException - Thrown if NamedCache has experienced an internal error.

getCache

public static NamedCache getCache(com.scaleoutsoftware.soss.client.da.StateServerKey key)
                           throws NamedCacheException
Creates a NamedCache using the application id extracted from the StateServerKey.

Parameters:
key - StateServerKey instance. Only the application id is used.
Returns:
instance of NamedCache
Throws:
NamedCacheException - Thrown if NamedCache has experienced an internal error.

getCache

public static NamedCache getCache(String name,
                                  boolean registerForEvents)
                           throws NamedCacheException
Deprecated. the event handling will be automatically enabled when the listener is registered NamedCache.addListener(NamedCacheObjectExpirationListener); there is no need to explicitly enable them.

Creates a NamedCache using a specified name.

Parameters:
name - cache name
registerForEvents - indicates if this cache should be registered for expiration events
Returns:
instance of NamedCache
Throws:
NamedCacheException - Thrown if NamedCache has experienced an internal error.

getCache

public static NamedCache getCache(com.scaleoutsoftware.soss.client.da.StateServerKey key,
                                  boolean registerForEvents)
                           throws NamedCacheException
Deprecated. the event handling will be automatically enabled when the listener is registered NamedCache.addListener(NamedCacheObjectExpirationListener); there is no need to explicitly enable them.

Creates a NamedCache using the application id extracted from the StateServerKey.

Parameters:
key - StateServerKey instance. Only the application id is used.
registerForEvents - indicates if this cache should be registered for expiration events
Returns:
instance of NamedCache
Throws:
NamedCacheException - Thrown if NamedCache has experienced an internal error.


Copyright (C) 2007-2012 ScaleOut Software, Inc.