public class CacheServiceImpl extends DefaultComponent implements CacheService
Modifier and Type | Class and Description |
---|---|
protected static class |
CacheServiceImpl.AbstractCachePubSubInvalidator |
protected static class |
CacheServiceImpl.CacheDescriptorRegistry |
protected static class |
CacheServiceImpl.CacheInvalidation |
protected class |
CacheServiceImpl.CachePubSubInvalidator |
Modifier and Type | Field and Description |
---|---|
static String |
CACHE_INVAL_PUBSUB_TOPIC |
protected Map<String,CacheManagement> |
caches
Currently registered caches.
|
static String |
CLUSTERING_ENABLED_PROP
Framework property defining whether clustering is enabled.
|
static String |
DEFAULT_CACHE_ID |
protected CacheServiceImpl.CachePubSubInvalidator |
invalidator |
static ComponentName |
NAME |
static String |
NODE_ID_PROP
Framework property containing the node id.
|
protected static Random |
RANDOM |
protected CacheServiceImpl.CacheDescriptorRegistry |
registry |
lastModified
Constructor and Description |
---|
CacheServiceImpl() |
Modifier and Type | Method and Description |
---|---|
int |
getApplicationStartedOrder()
The component notification order for
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext) . |
Cache |
getCache(String name)
Gets the cache with the given name.
|
CacheDescriptor |
getCacheDescriptor(String descriptor) |
protected void |
maybeStart(String name) |
void |
registerCache(String name)
Programmatically registers a cache with the given name, with the the size and the timeout given by the default
cache.
|
void |
registerCache(String name,
int maxSize,
int timeout)
Deprecated.
|
void |
registerCacheDescriptor(CacheDescriptor descriptor) |
void |
registerContribution(Object contrib,
String extensionPoint,
ComponentInstance contributor) |
void |
start(ComponentContext context)
Start the component.
|
protected void |
startCacheDescriptor(CacheDescriptor desc)
Creates and starts the cache.
|
void |
stop(ComponentContext context)
Stop the component.
|
void |
unregisterCacheDescriptor(CacheDescriptor descriptor) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
activate, deactivate, getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted
public static final ComponentName NAME
public static final String DEFAULT_CACHE_ID
public static final String CACHE_INVAL_PUBSUB_TOPIC
public static final String CLUSTERING_ENABLED_PROP
public static final String NODE_ID_PROP
protected final CacheServiceImpl.CacheDescriptorRegistry registry
protected final Map<String,CacheManagement> caches
protected CacheServiceImpl.CachePubSubInvalidator invalidator
public CacheServiceImpl()
public void registerContribution(Object contrib, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
@Deprecated public void registerCache(String name, int maxSize, int timeout)
CacheService
registerCache
in interface CacheService
name
- the cache namemaxSize
- the maximum number of elementstimeout
- the entry timeout (in minutes)public void registerCache(String name)
CacheService
registerCache
in interface CacheService
name
- the cache namepublic void registerCacheDescriptor(CacheDescriptor descriptor)
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public void unregisterCacheDescriptor(CacheDescriptor descriptor)
public int getApplicationStartedOrder()
Component
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext)
.
Components are notified in increasing order. Order 1000 is the default order for components that don't care. Order 100 is the repository initialization.
getApplicationStartedOrder
in interface Component
public void start(ComponentContext context)
Component
start
in interface Component
start
in class DefaultComponent
protected void startCacheDescriptor(CacheDescriptor desc)
public void stop(ComponentContext context)
Component
stop
in interface Component
stop
in class DefaultComponent
protected void maybeStart(String name)
public Cache getCache(String name)
CacheService
getCache
in interface CacheService
name
- the cache namenull
if it does not existpublic CacheDescriptor getCacheDescriptor(String descriptor)
Copyright © 2018 Nuxeo. All rights reserved.