org.exoplatform.services.cache
Interface ExoCache

All Known Implementing Classes:
BaseExoCache, ConcurrentFIFOExoCache, FIFOExoCache, SimpleExoCache

public interface ExoCache

Created by The eXo Platform SAS. Author : Tuan Nguyen tuan08@users.sourceforge.net Date: Jun 14, 2003 Time: 1:12:22 PM


Method Summary
 void addCacheListener(CacheListener listener)
           
 void clearCache()
          Clears the cache.
 java.lang.Object get(java.io.Serializable name)
          Performs a lookup operation.
 java.util.List getCachedObjects()
          Returns a list of cached object that are considered as valid when the method is called.
 int getCacheHit()
           
 int getCacheMiss()
           
 int getCacheSize()
           
 java.lang.String getLabel()
           
 long getLiveTime()
           
 int getMaxSize()
           
 java.lang.String getName()
           
 boolean isDistributed()
           
 boolean isLogEnabled()
           
 boolean isReplicated()
           
 void put(java.io.Serializable name, java.lang.Object obj)
          Performs a put in the cache.
 void putMap(java.util.Map<java.io.Serializable,java.lang.Object> objs)
          Performs a put of all the entries provided by the map argument.
 java.lang.Object remove(java.io.Serializable name)
          Removes an entry from the cache.
 java.util.List removeCachedObjects()
          Clears the cache and returns the list of cached object that are considered as valid when the method is called.
 void select(CachedObjectSelector selector)
          Selects a subset of the cache.
 void setDistributed(boolean b)
           
 void setLabel(java.lang.String s)
           
 void setLiveTime(long period)
           
 void setLogEnabled(boolean b)
           
 void setMaxSize(int max)
           
 void setName(java.lang.String name)
           
 void setReplicated(boolean b)
           
 

Method Detail

getName

java.lang.String getName()

setName

void setName(java.lang.String name)

getLabel

java.lang.String getLabel()

setLabel

void setLabel(java.lang.String s)

get

java.lang.Object get(java.io.Serializable name)
                     throws java.lang.Exception
Performs a lookup operation.

Parameters:
name - the cache key
Returns:
the cached value which may be evaluated to null
Throws:
java.lang.Exception - any exception

remove

java.lang.Object remove(java.io.Serializable name)
                        throws java.lang.Exception
Removes an entry from the cache.

Parameters:
name - the cache key
Returns:
the previously cached value or null if no entry existed or that entry value was evaluated to null
Throws:
java.lang.Exception - any exception

put

void put(java.io.Serializable name,
         java.lang.Object obj)
         throws java.lang.Exception
Performs a put in the cache.

Parameters:
name - the cache key
obj - the cached value
Throws:
java.lang.Exception - any exception

putMap

void putMap(java.util.Map<java.io.Serializable,java.lang.Object> objs)
            throws java.lang.Exception
Performs a put of all the entries provided by the map argument.

Parameters:
objs - the objects to put
Throws:
java.lang.Exception - any exception

clearCache

void clearCache()
                throws java.lang.Exception
Clears the cache.

Throws:
java.lang.Exception - any exception

select

void select(CachedObjectSelector selector)
            throws java.lang.Exception
Selects a subset of the cache.

Parameters:
selector - the selector
Throws:
java.lang.Exception - any exception

getCacheSize

int getCacheSize()

getMaxSize

int getMaxSize()

setMaxSize

void setMaxSize(int max)

getLiveTime

long getLiveTime()

setLiveTime

void setLiveTime(long period)

getCacheHit

int getCacheHit()

getCacheMiss

int getCacheMiss()

getCachedObjects

java.util.List getCachedObjects()
Returns a list of cached object that are considered as valid when the method is called. Any non valid object will not be returnted.

Returns:
the list of cached objects

removeCachedObjects

java.util.List removeCachedObjects()
                                   throws java.lang.Exception
Clears the cache and returns the list of cached object that are considered as valid when the method is called. Any non valid object will not be returned.

Returns:
the list of cached objects
Throws:
java.lang.Exception - any exception

addCacheListener

void addCacheListener(CacheListener listener)

isDistributed

boolean isDistributed()

setDistributed

void setDistributed(boolean b)

isReplicated

boolean isReplicated()

setReplicated

void setReplicated(boolean b)

isLogEnabled

boolean isLogEnabled()

setLogEnabled

void setLogEnabled(boolean b)


Copyright © 2011 eXo Platform SAS. All Rights Reserved.