org.jwarp.service.cache
Interface ICacheService

All Superinterfaces:
IConfigurable, IExceptionProvider, IService
All Known Implementing Classes:
CacheService

public interface ICacheService
extends IService

Abstract interface for the default cache service.


Field Summary
static java.lang.String SERVICE_TYPE
          The service type constant
 
Fields inherited from interface org.jwarp.service.IService
SERVICE_STATUS_CREATED, SERVICE_STATUS_NOT_AVAILABLE, SERVICE_STATUS_READY, SERVICE_STATUS_RESUMING, SERVICE_STATUS_RUNNING, SERVICE_STATUS_STARTING, SERVICE_STATUS_STOPPED, SERVICE_STATUS_STOPPING, SERVICE_STATUS_SUSPENDED
 
Method Summary
 ICache createCache(java.lang.String cacheID, int maxComponents, int maxTime, int minAccess, int updateInterval, ITicket user)
          Creates a new cache.
 ICache createCache(java.lang.String cacheID, ITicket user)
          Creates a new cache.
 ICache getCache(java.lang.String cacheID, ITicket user)
          Returns the caches internal implementatino.
 java.util.Iterator getCacheNames(ITicket user)
          Get an iterator with the names of all currently running cache instances.
 ICache removeCache(java.lang.String cacheID, ITicket user)
          Updates the cache.
 
Methods inherited from interface org.jwarp.service.IService
checkContext, getDependencies, getLogLevel, getName, getStatus, getType, resume, setContext, setDependencies, setLogLevel, shutdown, start, suspend
 
Methods inherited from interface org.jwarp.service.configuration.IConfigurable
configure
 
Methods inherited from interface org.jwarp.common.IExceptionProvider
addExceptionListener, getExceptionListeners, removeAllExceptionListeners, removeExceptionListener
 

Field Detail

SERVICE_TYPE

public static final java.lang.String SERVICE_TYPE
The service type constant
Method Detail

getCacheNames

public java.util.Iterator getCacheNames(ITicket user)
Get an iterator with the names of all currently running cache instances.
Returns:
The names of the current caches

getCache

public ICache getCache(java.lang.String cacheID,
                       ITicket user)
                throws java.lang.SecurityException,
                       NotFoundException
Returns the caches internal implementatino. On the internal implementation further settings can be changes such as the interval date, the cache's size etc.
Parameters:
cacheID - The cache's name
user - The user
Throws:
SecurityEception - If access was denied for/during the operation
NotFoundException - If a cache with the given cacheID could not be located.

removeCache

public ICache removeCache(java.lang.String cacheID,
                          ITicket user)
                   throws java.lang.SecurityException
Updates the cache. This is typically called by a thread running independently.
Parameters:
cacheID - The cache's name
user - The user
Throws:
SecurityEception - If access was denied for/during the operation
NotFoundException - If a cache with the given cacheID could not be located.

createCache

public ICache createCache(java.lang.String cacheID,
                          ITicket user)
                   throws java.lang.SecurityException,
                          InitializationException
Creates a new cache.
Parameters:
cacheID - The new cache's name
user - The user
Throws:
SecurityEception - If access was denied for/during the operation
InitializationException - If a cache initialization error occurred or a cache with the same name is existing yet.

createCache

public ICache createCache(java.lang.String cacheID,
                          int maxComponents,
                          int maxTime,
                          int minAccess,
                          int updateInterval,
                          ITicket user)
                   throws java.lang.SecurityException,
                          InitializationException
Creates a new cache.
Parameters:
cacheID - The new cache's name
maxComponents - The maximum number of components until a cache update is triggered
maxTime - The maximum time an item is stored within the cache
minAccess - The minimun number of accesses during an update period so an object can stay within the cache
updateInterval - The update interval of the cache in seconds
user - The user
Throws:
SecurityEception - If access was denied for/during the operation
InitializationException - If a cache initialization error occurred or a cache with the same name is existing yet.

©   O R C A   S y s t e m s