org.castor.cache.simple

Class TimeLimited

public class TimeLimited extends AbstractBaseCache

TimeLimited is a time limted first-in-first-out Map. Every object being put in the Map will live until the timeout expired.

The expiration time is passed to the cache at initialization by the individual cache property ttl which defines the timeout of every object in the cache in seconds. If not specified a timeout of 30 seconds will be used.

Version: $Revision: 6320 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $

Author: Thomas Yip Stein M. Hugubakken Werner Guttmann Ralf Joachim

Field Summary
static intDEFAULT_TTL
Default ttl of cache.
static StringPARAM_TTL
Mapped initialization parameter: ttl
static StringTYPE
The type of the cache.
Method Summary
voidclear()
booleancontainsKey(Object key)
booleancontainsValue(Object value)
SetentrySet()
Objectget(Object key)
intgetTTL()
Get real ttl of this cache.
StringgetType()
voidinitialize(Properties params)
booleanisEmpty()
SetkeySet()
Objectput(Object key, Object value)
voidputAll(Map map)
Objectremove(Object key)
intsize()
Collectionvalues()

Field Detail

DEFAULT_TTL

public static final int DEFAULT_TTL
Default ttl of cache.

PARAM_TTL

public static final String PARAM_TTL
Mapped initialization parameter: ttl

TYPE

public static final String TYPE
The type of the cache.

Method Detail

clear

public void clear()
{@inheritDoc }

See Also: java.util.Map#clear()

containsKey

public boolean containsKey(Object key)
{@inheritDoc }

See Also: java.util.Map#containsKey(java.lang.Object)

containsValue

public boolean containsValue(Object value)
{@inheritDoc }

See Also: java.util.Map#containsValue(java.lang.Object)

entrySet

public Set entrySet()
{@inheritDoc }

See Also: java.util.Map#entrySet()

get

public Object get(Object key)
{@inheritDoc }

See Also: java.util.Map#get(java.lang.Object)

getTTL

public int getTTL()
Get real ttl of this cache.

Returns: Real ttl of this cache.

getType

public String getType()
{@inheritDoc }

See Also: getType

initialize

public void initialize(Properties params)
{@inheritDoc }

See Also: initialize

isEmpty

public boolean isEmpty()
{@inheritDoc }

See Also: java.util.Map#isEmpty()

keySet

public Set keySet()
{@inheritDoc }

See Also: java.util.Map#keySet()

put

public Object put(Object key, Object value)
{@inheritDoc }

See Also: java.util.Map#put(java.lang.Object, java.lang.Object)

putAll

public void putAll(Map map)
{@inheritDoc }

See Also: java.util.Map#putAll(java.util.Map)

remove

public Object remove(Object key)
{@inheritDoc }

See Also: java.util.Map#remove(java.lang.Object)

size

public int size()
{@inheritDoc }

See Also: java.util.Map#size()

values

public Collection values()
{@inheritDoc }

See Also: java.util.Map#values()

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com