public class CacheServiceImpl extends DefaultComponent implements CacheService
Modifier and Type | Field and Description |
---|---|
protected List<String> |
autoregisteredCacheNames
Contains the names of all caches which have not been registered from an extension
|
protected CacheRegistry |
cacheRegistry |
static String |
DEFAULT_CACHE_ID |
static ComponentName |
NAME |
lastModified
CACHE_TOPIC, INVALIDATE_ALL
Constructor and Description |
---|
CacheServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
applicationStarted(ComponentContext context)
Notify the component that Nuxeo Framework finished starting all Nuxeo bundles.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
<T> T |
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object.
|
int |
getApplicationStartedOrder()
The component notification order for
Component.applicationStarted(org.nuxeo.runtime.model.ComponentContext) . |
CacheAttributesChecker |
getCache(String name) |
void |
registerCache(CacheDescriptor descriptor) |
void |
registerCache(String name,
int maxSize,
int timeout) |
void |
registerExtension(Extension extension)
Registers the given extension.
|
void |
unregisterCache(CacheDescriptor descriptor) |
void |
unregisterExtension(Extension extension)
Unregisters the given extension.
|
activate, getLastModified, registerContribution, setLastModified, setModifiedNow, unregisterContribution
public static final String DEFAULT_CACHE_ID
public static final ComponentName NAME
protected final CacheRegistry cacheRegistry
protected final List<String> autoregisteredCacheNames
public CacheServiceImpl()
public CacheAttributesChecker getCache(String name)
getCache
in interface CacheService
public void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic 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
getApplicationStartedOrder
in class DefaultComponent
public void applicationStarted(ComponentContext context)
Component
applicationStarted
in interface Component
applicationStarted
in class DefaultComponent
public void registerExtension(Extension extension)
Extensible
registerExtension
in interface Extensible
registerExtension
in class DefaultComponent
extension
- the extension to registerpublic void registerCache(CacheDescriptor descriptor)
public void registerCache(String name, int maxSize, int timeout)
registerCache
in interface CacheService
public void unregisterExtension(Extension extension) throws RuntimeException
Extensible
unregisterExtension
in interface Extensible
unregisterExtension
in class DefaultComponent
extension
- the extension to unregisterRuntimeException
public void unregisterCache(CacheDescriptor descriptor)
public <T> T getAdapter(Class<T> adapter)
Adaptable
null
if no such object can be found.getAdapter
in interface Adaptable
getAdapter
in class DefaultComponent
adapter
- the adapter class to look upnull
if this object does not have an adapter for
the given classCopyright © 2016 Nuxeo SA. All rights reserved.