Package org.nuxeo.ecm.core.cache
Class CacheServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.core.cache.CacheServiceImpl
- All Implemented Interfaces:
CacheService
,Adaptable
,Component
,Extensible
,TimestampedService
Cache service implementation to manage nuxeo cache
- Since:
- 6.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
protected class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final Map<String,
CacheManagement> Currently registered caches.static final String
protected CacheServiceImpl.CachePubSubInvalidator
protected boolean
static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
The component notification order forComponent.start(ComponentContext)
.Gets the cache with the given name.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
start
(ComponentContext context) Start the component.protected void
Creates and starts the cache.void
stop
(ComponentContext context) Stop the component.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtension
-
Field Details
-
XP_CACHES
- Since:
- 10.3
- See Also:
-
DEFAULT_CACHE_ID
- Since:
- 8.2
- See Also:
-
CACHE_INVAL_PUBSUB_TOPIC
- Since:
- 9.3
- See Also:
-
started
protected boolean started -
caches
Currently registered caches. -
invalidator
-
-
Constructor Details
-
CacheServiceImpl
public CacheServiceImpl()
-
-
Method Details
-
registerCache
Description copied from interface:CacheService
Programmatically registers a cache with the given name, with the the size and the timeout given by the default cache.- Specified by:
registerCache
in interfaceCacheService
- Parameters:
name
- the cache name
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:Component
The component notification order forComponent.start(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.
- Specified by:
getApplicationStartedOrder
in interfaceComponent
- Returns:
- the order, 1000 by default
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
startCacheDescriptor
Creates and starts the cache. -
stop
Description copied from interface:Component
Stop the component.- Specified by:
stop
in interfaceComponent
- Overrides:
stop
in classDefaultComponent
- Throws:
InterruptedException
-
maybeStart
-
getCache
Description copied from interface:CacheService
Gets the cache with the given name.- Specified by:
getCache
in interfaceCacheService
- Parameters:
name
- the cache name- Returns:
- the cache, or
null
if it does not exist
-
getCacheDescriptor
- Since:
- 9.3
-