|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.norther.tammi.acorn.cache.CachedMapAdapter<K,V> org.norther.tammi.core.cache.DefaultCache<K,V>
K
- the type of keys maintained by the cache.V
- the type of cached values.public class DefaultCache<K,V>
A default implementation of Cache.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.norther.tammi.acorn.cache.CachedMap |
---|
CachedMap.Value<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected static int |
DEFAULT_CAPACITY
The default capacity. |
protected static float |
DEFAULT_LOAD_FACTOR
The default load factor. |
Fields inherited from class org.norther.tammi.acorn.cache.CachedMapAdapter |
---|
DEFAULT_EXPIRATION_SLEEP_INTERVAL, DEFAULT_EXPIRATION_TIME |
Constructor Summary | |
---|---|
DefaultCache()
Constructs a new cached map. |
|
DefaultCache(int max)
Constructs a new cache with max expiration time. |
|
DefaultCache(int max,
int def)
Constructs a new cache with max and default expiration times. |
|
DefaultCache(int max,
int def,
int sleep)
Constructs a new cache with max and default expiration times and an expiration sleep interval. |
|
DefaultCache(int max,
int def,
int sleep,
int capacity)
Constructs a new cache with max and default expiration times, an expiration sleep interval and initial capacity. |
|
DefaultCache(int max,
int def,
int sleep,
int capacity,
float loadFactor)
Constructs a new cache with max and default expiration times, an expiration sleep interval, initial capacity and load factor. |
Method Summary | |
---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
protected MBeanDelegate |
getMBeanDelegate()
Gets the delegate to provide access to its methods for subclasses. |
MBeanNotificationInfo[] |
getNotificationInfo()
|
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
void |
premanaged(MBeanDelegate adapter)
This method is called when the implementing adaptee is trying to be managed either during pre-registration of the corresponding adapter MBean or just before it is explicitly added to the adapter MBean during run-time. |
void |
removeNotificationListener(NotificationListener listener)
|
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback)
|
void |
setAllowExpired(boolean flag)
Sets the allow expired option allowing gets of entries already expired but not yet removed by the expiration handler. |
void |
setDefaultExpirationTime(int t)
Sets the default expiration time in seconds. |
void |
setDiscardOverloaded(boolean flag)
Sets the discard overloaded option. |
void |
setExpirationLimit(int c)
Sets the expiration limit for the number of cached entries. |
void |
setExpirationSleepInterval(int t)
Sets the expiration sleep interval in seconds. |
void |
setExpirationThreshold(float h)
Sets the threshold relative to the entry limit before expiration of excessive entries starts. |
void |
setMaxExpirationTime(int t)
Sets the maximum expiration time in seconds. |
String |
toString()
|
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
Methods inherited from class org.norther.tammi.acorn.cache.CachedMapAdapter |
---|
add, add, clear, containsKey, containsValue, entrySet, equals, expire, expireAll, expireFraction, get, get, getDefaultExpirationTime, getExpirationLimit, getExpirationSleepInterval, getExpirationThreshold, getExpirationTimer, getMaxExpirationTime, getSwapOutHandler, hashCode, isAllowExpired, isAutoRefreshDeclined, isDiscardOverloaded, isEmpty, keySet, put, put, putAll, putIfAbsent, putIfAbsent, refresh, refresh, remove, remove, replace, replace, setAutoRefreshDeclined, setExpirationTimer, setSwapOutHandler, size, values |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.norther.tammi.acorn.cache.CachedMap |
---|
add, add, expire, expireAll, expireFraction, get, getDefaultExpirationTime, getExpirationLimit, getExpirationSleepInterval, getExpirationThreshold, getMaxExpirationTime, isAllowExpired, isAutoRefreshDeclined, isDiscardOverloaded, put, putIfAbsent, refresh, refresh, setAutoRefreshDeclined |
Methods inherited from interface java.util.concurrent.ConcurrentMap |
---|
putIfAbsent, remove, replace, replace |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
Field Detail |
---|
protected static final int DEFAULT_CAPACITY
protected static final float DEFAULT_LOAD_FACTOR
Constructor Detail |
---|
public DefaultCache()
public DefaultCache(int max)
max
- a max expiration time in secs (0 = default, -1 = infinite).public DefaultCache(int max, int def)
max
- a max expiration time in secs (0 = default, -1 = infinite).def
- a default expiration time in secs (0 = default, -1 =
infinite).public DefaultCache(int max, int def, int sleep)
max
- a max expiration time in secs (0 = default, -1 = infinite).def
- a default expiration time in secs (0 = default, -1 =
infinite).sleep
- an expiration sleep interval in secs (0 = default, -1 =
infinite).public DefaultCache(int max, int def, int sleep, int capacity)
max
- a max expiration time in secs (0 = default, -1 = infinite).def
- a default expiration time in secs (0 = default, -1 =
infinite).sleep
- an expiration sleep interval in secs (0 = default, -1 =
infinite).capacity
- an initial capacity.public DefaultCache(int max, int def, int sleep, int capacity, float loadFactor)
max
- a max expiration time in secs (0 = default, -1 = infinite).def
- a default expiration time in secs (0 = default, -1 =
infinite).sleep
- an expiration sleep interval in secs (0 = default, -1 =
infinite).capacity
- an initial capacity.loadFactor
- a load factor.Method Detail |
---|
public String toString()
toString
in class CachedMapAdapter<K,V>
public void premanaged(MBeanDelegate adapter) throws Exception
Manageable
premanaged
in interface Manageable
adapter
- the managing adapter.
Exception
- if the adaptee refused to be managed.public void postmanaged()
Manageable
postmanaged
in interface Manageable
public void unmanaged() throws Exception
Manageable
unmanaged
in interface Manageable
Exception
- if the adaptee refused to be unmanaged.public void setAllowExpired(boolean flag)
CachedMap
setAllowExpired
in interface CachedMap<K,V>
setAllowExpired
in class CachedMapAdapter<K,V>
flag
- the allow expired option.public void setDiscardOverloaded(boolean flag)
CachedMap
setDiscardOverloaded
in interface CachedMap<K,V>
setDiscardOverloaded
in class CachedMapAdapter<K,V>
flag
- true if new puts are discarded if overloaded, false
otherwise.public void setMaxExpirationTime(int t)
CachedMap
setMaxExpirationTime
in interface CachedMap<K,V>
setMaxExpirationTime
in class CachedMapAdapter<K,V>
t
- the secs.public void setExpirationSleepInterval(int t)
CachedMap
setExpirationSleepInterval
in interface CachedMap<K,V>
setExpirationSleepInterval
in class CachedMapAdapter<K,V>
t
- the secspublic void setDefaultExpirationTime(int t)
CachedMap
setDefaultExpirationTime
in interface CachedMap<K,V>
setDefaultExpirationTime
in class CachedMapAdapter<K,V>
t
- the secs.public void setExpirationLimit(int c)
CachedMap
setExpirationLimit
in interface CachedMap<K,V>
setExpirationLimit
in class CachedMapAdapter<K,V>
c
- the expiration limit.public void setExpirationThreshold(float h)
CachedMap
setExpirationThreshold
in interface CachedMap<K,V>
setExpirationThreshold
in class CachedMapAdapter<K,V>
h
- the threshold.public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
addNotificationListener
in interface NotificationBroadcaster
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationEmitter
ListenerNotFoundException
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener
in interface NotificationBroadcaster
ListenerNotFoundException
public MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface NotificationBroadcaster
protected MBeanDelegate getMBeanDelegate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |