K - the type of keys maintained by this mapV - the type of mapped values@Component(componentId="org.everit.cache.lru.ecm.LruCache",
configurationPolicy=FACTORY,
label="Everit LRU Cache",
description="LRU cache component based on a high performance ConcurrentLinkedHashMap.")
@StringAttributes(value=@StringAttribute(attributeId="service.description",defaultValue="Default LRU cache",priority=1.0f,label="Service Description",description="The description of this component configuration. It is used to easily identify the service registered by this component."))
@ManualService(value={java.util.Map.class,java.util.concurrent.ConcurrentMap.class,com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap.class})
public class LruCacheComponent<K,V>
extends Object
CacheConstants#OBJECT_CLASS_NAME_MAP based on
ConcurrentLinkedHashMap.| Modifier and Type | Field and Description |
|---|---|
static int |
P01_SERVICE_DESCRIPTION |
static int |
P02_CAPACITY |
| Constructor and Description |
|---|
LruCacheComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
activate(org.everit.osgi.ecm.component.ComponentContext<LruCacheComponent<K,V>> componentContext)
Component activator method.
|
void |
deactivate()
Component deactivate method.
|
void |
setCapacity(long capacity) |
public static final int P01_SERVICE_DESCRIPTION
public static final int P02_CAPACITY
@Activate public void activate(org.everit.osgi.ecm.component.ComponentContext<LruCacheComponent<K,V>> componentContext)
@Deactivate public void deactivate()
@LongAttribute(attributeId="capacity",
defaultValue=1000L,
priority=2.0f,
label="Capacity",
description="The maximum number of elements stored in the cache.")
public void setCapacity(long capacity)
Copyright © 2011–2015 Everit Kft.. All rights reserved.