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
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected final Map<String, CacheManagement> Currently registered caches.static final Stringprotected CacheServiceImpl.CachePubSubInvalidatorprotected booleanstatic final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintThe component notification order forComponent.start(ComponentContext).Gets the cache with the given name.getCacheDescriptor(String descriptor) protected voidmaybeStart(String name) voidregisterCache(String name) Programmatically registers a cache with the given name, with the the size and the timeout given by the default cache.voidstart(ComponentContext context) Start the component.protected voidCreates and starts the cache.voidstop(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:CacheServiceProgrammatically registers a cache with the given name, with the the size and the timeout given by the default cache.- Specified by:
registerCachein interfaceCacheService- Parameters:
name- the cache name
-
getApplicationStartedOrder
public int getApplicationStartedOrder()Description copied from interface:ComponentThe 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:
getApplicationStartedOrderin interfaceComponent- Returns:
- the order, 1000 by default
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
startCacheDescriptor
Creates and starts the cache. -
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent- Throws:
InterruptedException
-
maybeStart
-
getCache
Description copied from interface:CacheServiceGets the cache with the given name.- Specified by:
getCachein interfaceCacheService- Parameters:
name- the cache name- Returns:
- the cache, or
nullif it does not exist
-
getCacheDescriptor
- Since:
- 9.3
-