GWTP Dispatch client 0.6-redhat-2

com.gwtplatform.dispatch.client.actionhandler.caching
Interface Cache

All Known Implementing Classes:
DefaultCacheImpl

public interface Cache

Interface for client side caching.

Author:
Sunny Gupta

Method Summary
 void clear()
          Clears the entire cache.
 Object get(Object key)
          Returns the cached value corresponding to key.
 long getAutoExpireTimeInMs()
           
 long getLastUpateTime(Object key)
          Returns the last update time in milliseconds since January 1, 1970, 00:00:00 GMT for the cached entry.
 void put(Object key, Object value)
          Puts the key-value pair in the cache.
 void remove(Object key)
          Removes the entry from the cache.
 void setAutoExpireTimeInMs(long autoExpireTimeInMs)
          Set the auto expiry time, after which an entry will expire after it is put in cache.
 

Method Detail

put

void put(Object key,
         Object value)
Puts the key-value pair in the cache. If an entry with key already exists, it is overwritten. If automatic expiration is used, this entry will be expired after getAutoExpireTimeInMs() milliseconds.

Parameters:
key - The key for the entry to be cached
value - The corresponding value

getAutoExpireTimeInMs

long getAutoExpireTimeInMs()

setAutoExpireTimeInMs

void setAutoExpireTimeInMs(long autoExpireTimeInMs)
Set the auto expiry time, after which an entry will expire after it is put in cache.

Parameters:
autoExpireTimeInMs - The auto expiry time in milliseconds

get

Object get(Object key)
Returns the cached value corresponding to key.

Parameters:
key - The key for the cached entry
Returns:
The value corresponding to key

clear

void clear()
Clears the entire cache.


remove

void remove(Object key)
Removes the entry from the cache.

Parameters:
key - The key for the cached entry

getLastUpateTime

long getLastUpateTime(Object key)
Returns the last update time in milliseconds since January 1, 1970, 00:00:00 GMT for the cached entry.

Parameters:
key - The key for which last update time is required
Returns:
The last update time as long value, if the value is cached, otherwise -1

GWTP Dispatch client 0.6-redhat-2

Copyright © 2010-2012 ArcBees. All Rights Reserved.