public interface CacheService
Modifier and Type | Field and Description |
---|---|
static int |
CACHE_SIZE
The default size of a cache.
|
static int |
DEFAULT
Indicates to create a default cache.
|
static int |
IN_MEMORY
Indicates to cache data in memory only.
|
static int |
PERSISTENCE_ON_DISK
Indicates to cache data on disk.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(int cacheID,
Object key,
Object element)
Adds the specified element to the selected cache.
|
void |
clearAllCaches()
Clears all the caches.
|
void |
clearCache(int cacheID)
Clears the specified cache.
|
int |
createCache()
Creates a default cache.
|
int |
createCache(int type)
Creates a cache of a given type.
|
int |
createCache(int type,
int size)
Creates a cache of a given type.
|
Object |
getElement(int cacheID,
Object key)
Adds the specified element to the selected cache.
|
void |
removeCache(int cacheID)
Removes the cache corresponding to the passed id.
|
void |
setCacheEntries(int cacheID,
int entries)
Resets the number of items in memory of the cache,
when a new cache is created or deleted.
|
void |
shutDown()
Shuts the cache down.
|
static final int DEFAULT
static final int PERSISTENCE_ON_DISK
static final int IN_MEMORY
static final int CACHE_SIZE
int createCache()
int createCache(int type, int size)
type
- The type of cache to create.size
- The size of the cache.int createCache(int type)
type
- The type of cache to create.void removeCache(int cacheID)
cacheID
- The id of the cache.void addElement(int cacheID, Object key, Object element)
cacheID
- The id of the cache.key
- The key corresponding to the element to add.element
- The element to add.Object getElement(int cacheID, Object key)
cacheID
- The id of the cache.key
- The key corresponding to the element to add.void clearCache(int cacheID)
cacheID
- The id of the cache to clear.void setCacheEntries(int cacheID, int entries)
cacheID
- The id of the cache.entries
- The number of entries.void clearAllCaches()
void shutDown()
Version: 5.3.5-ice35-b73
Copyright © 2017 The University of Dundee & Open Microscopy Environment. All Rights Reserved.