javax.util.jcache
Interface CacheMap

All Superinterfaces:
Map
All Known Implementing Classes:
MapAdapter

public interface CacheMap
extends Map

Interface with extra methods for special features of FKache.

Author:
Frank Karlstrøm

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Method Summary
 void defineObject(Object name, Attributes attributes)
          is used to specify the attributes to associate with an object when it is loaded.
 Object get(Object name, Object arguments)
          Gets the object from the cache.
 Attributes getAttributes()
          Will return an attribute object describing the current attributes associated for the region for this CacheAccess.
 Attributes getAttributes(Object name)
          Deprecated. moved to MapAccess
 Object put(Object key, String group, Object value)
          Puts a object into the cache, and attach it to a group.
 Object remove(Object key, String group)
          Removes an object from a group.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getAttributes

Attributes getAttributes()
Will return an attribute object describing the current attributes associated for the region for this CacheAccess.

Returns:
an Attributes object for the region of this CacheAccess.

getAttributes

Attributes getAttributes(Object name)
                         throws CacheException
Deprecated. moved to MapAccess

will return an attribute object describing the current attributes associated with the object name.

Parameters:
name - the name of the object to get the attributes for.
Returns:
an Attributes object for the named object.
Throws:
CacheException - if an error occurs.

get

Object get(Object name,
           Object arguments)
Gets the object from the cache. If the object is not currently in the cache and a loader object has been registered, the object will be loaded into the cache with the arguments specified.

Parameters:
name - the name of the object to get.
arguments - the arguments wich is passed to the load method of the CacheLoader, if registered.
Returns:
a reference to a shared object.

defineObject

void defineObject(Object name,
                  Attributes attributes)
is used to specify the attributes to associate with an object when it is loaded. This can include the loader object, cache event handlers, and spesific attributes for the object such as distribute, spool, etc. Attributes (with the exception of the CacheLoader object itself) can also be specified within the load method of the CacheLoader object using the setAttributes method, if the attributes for an object are not defined, the attributes of the region will be used.

Parameters:
name - the name of the object to associate the attributes with.
attributes - the attributes to associate.

put

Object put(Object key,
           String group,
           Object value)
Puts a object into the cache, and attach it to a group. If the group does not exist, this method will fail. If an object with the specified name, in the specified group already exists, this object is repleaced with the new object, and the old object is returned. Otherwise null is returned.

Parameters:
key - the key of the object
group - the group to put it in to.
value - the actual object to put into the cache.
Returns:
if an object already was in the cache in the specified group, this object is returned.

remove

Object remove(Object key,
              String group)
Removes an object from a group.

Parameters:
key - The object to remove.
group - The group to remove the object from.
Returns:
The removed object if any.


Copyright © 2002-2009 Hosted by SourceForge. All Rights Reserved.