|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fjank.jcache.CacheAccessImpl2
public final class CacheAccessImpl2
An optimized implementation of CacheAccess. No exceptions is thrown excpet in really exceptional situations. The Map interface uses this class directly, while the old CacheAccessImpl interface should be reprogrammed to work with this class.
Method Summary | |
---|---|
void |
cancelResponse()
terminates the request for a reply from the previous invalidate or update. |
void |
close()
will return the CacheAccess object to the cache. |
void |
defineGroup(String name)
Is used to create a new group object. |
void |
defineGroup(String name,
Attributes attributes)
Is used to create a new group object. |
void |
defineGroup(String name,
String group)
Is used to create a new group which belongs to another group. |
void |
defineGroup(String name,
String groupName,
Attributes attributes)
Is used to create a new group which belongs to another group. |
void |
defineObject(Object name,
Attributes attributes)
is used to specify the attributes to associate with an object when it is loaded. |
void |
defineObject(Object name,
String group,
Attributes attributes)
See defineObject(Object, Attributes) |
void |
destroy()
Will invalidate all objects within the region for this CacheAccess object, and the region itself. |
void |
destroy(Object name)
Will invalidate all objects in the named region and the named region. |
Object |
get(Object name)
Returns a reference to the object accosiated with the specified name. |
Object |
get(Object name,
Object arguments)
Gets the object from the cache. |
Object |
get(Object name,
String group,
Object arguments)
Gets the object from the specified group. |
Attributes |
getAttributes()
Will return an attribute object describing the current attributes associated for the region for this CacheAccess. |
Attributes |
getAttributes(Object name)
will return an attribute object describing the current attributes associated with the object name. |
CacheException |
getException(boolean cached)
Will return the last exception which occured. |
boolean |
getOwnership(Object name,
int timeout)
will claim ownership for the named object for this instance of CacheAccess. |
CacheRegion |
getRegion()
Gets the region this access applies to. |
void |
invalidate()
Will mark all objects in the region as invalid. |
void |
invalidate(Object name)
Will mark all objects withing the scope of the specified name as invalid. |
boolean |
isPresent(Object name)
Check the existence of a valid copy of the named object in the region associated with this CacheAccess object. |
void |
preLoad(Object name)
This method allows for asynchronous loading of object into the cache. |
void |
preLoad(Object name,
Object arguments)
See preLoad(Object) . |
void |
preLoad(Object name,
String group,
Object arguments)
See preLoad(Object) . |
void |
put(Object name,
Attributes attributes,
Object object)
See put(Object, Object) |
boolean |
put(Object name,
Object object)
inserts the specified object into the cache, and associates it with the specified name. |
void |
put(Object name,
String group,
Attributes attributes,
Object object)
See put(Object, Object) |
void |
put(Object name,
String group,
Object object)
See put(Object, Object) |
void |
releaseOwnership()
Is called to explicitly give up ownership for an object. |
Object |
replace(Object name,
Object object)
Will create a new version of the object indentified by the name, replacing the current version with the object specified. |
Object |
replace(Object name,
String group,
Object object)
See replace(Object, Object) |
Object |
replaceWithoutDistribution(Object name,
Object object)
|
Object |
replaceWithoutDistribution(Object name,
String group,
Object object)
|
void |
resetAttributes(Attributes attributes)
allows for some attributes of a region to be reset. |
void |
resetAttributes(Object name,
Attributes attributes)
See resetAttributes(Attributes) . |
void |
save()
Will cause all objects within the region of this CacheAccess to be saved to the disk cache. |
void |
save(Object name)
See save() . |
void |
waitForResponse(int timeout)
May be used to wait for replies returned from invalidates or updates when a reply is requested. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void cancelResponse()
public void close()
public void defineGroup(String name)
name
- the name of the new group.public void defineGroup(String name, Attributes attributes)
name
- the group the new group should be associated with.attributes
- the attributes of the new group.public void defineGroup(String name, String group)
name
- the name of the new group.group
- the group the new group should be associated with.public void defineGroup(String name, String groupName, Attributes attributes)
name
- the name of the new group.groupName
- the group the new group should be associated with.attributes
- the attributes of the new group.public void defineObject(Object name, Attributes attributes)
name
- the name of the object to associate the attributes with.attributes
- the attributes to associate.public void defineObject(Object name, String group, Attributes attributes)
name
- the name of the object to associate the attributes with.group
- the group the object to associate the attributes with is
contained in.attributes
- the attributes to associate.public void destroy()
public void destroy(Object name)
name
- the name of the region to destroy.destroy()
public Object get(Object name)
InputStream
is
returned, if the object is a disk object, a String
containg the full path to the object is returned. The name parameter must
override the Object.equals(Object)
and Object.hashCode()
methods. If a loader object has not been
registered for the object the default load method will do a netSearch for
the object. A CacheAccess will only maintain a reference to one cached
object at any gived time. If get is called multiple times, the object
accessed previously, will be released.
name
- the name of the object to get.
public Object get(Object name, Object arguments)
name
- the name of the object to get.arguments
- the arguments wich is passed to the load method of the
CacheLoader, if registered.
get(Object)
public Object get(Object name, String group, Object arguments)
name
- the name of the object to get.group
- The group the Object is associated with.arguments
- the arguments wich is passed to the load method of the
CacheLoader, if registered.
get(Object)
public Attributes getAttributes()
public Attributes getAttributes(Object name)
name
- the name of the object to get the attributes for.
public boolean getOwnership(Object name, int timeout)
name
- the name of the object to claim ownership for.timeout
- number of milliseconds to wait for the ownership claim.
public void invalidate()
public void invalidate(Object name)
name
- the name of the object to invalidate.public boolean isPresent(Object name)
name
- the name of the object to check the existence for.
public void preLoad(Object name)
name
- the name of the object to load.public void preLoad(Object name, Object arguments)
preLoad(Object)
.
name
- the name of the object to load.arguments
- these arguments will be passed to the load method of the
loader object.public void preLoad(Object name, String group, Object arguments)
preLoad(Object)
.
name
- the name of the object to load.group
- the group the new object will be associated with.arguments
- these arguments will be passed to the load method of the
loader object.public void put(Object name, Attributes attributes, Object object)
put(Object, Object)
name
- the name associated with the object.attributes
- the attributes to associate with the object put into
the cache,object
- the object wich is put in the cache.put(Object,Object)
public void put(Object name, String group, Attributes attributes, Object object)
put(Object, Object)
name
- the name associated with the object.group
- The group associated with the object.attributes
- the attributes to associate with the object put into
the cache,object
- the object wich is put in the cache.put(Object,Object)
public CacheException getException(boolean cached)
cached
- if true
, a cached exception is returned. The stacktrace of this exception
will not be correct. Otherwise a new CacheException will be created. if you use false
as the cache
parameter, be adviced that this will be detrimental for performance.
public boolean put(Object name, Object object)
name
- the name associated with the object.object
- the object wich is put in the cache.public void put(Object name, String group, Object object)
put(Object, Object)
name
- the name associated with the object.group
- The group associated with the object.object
- the object wich is put in the cache.put(Object, Object)
public void releaseOwnership()
public Object replace(Object name, Object object)
name
- the name of the object to replace.object
- The new object to be put in the cache.
public Object replaceWithoutDistribution(Object name, Object object)
public Object replace(Object name, String group, Object object)
name
- the name of the object to replace.group
- the group the object is associated with.object
- The new object to be put in the cache.
public Object replaceWithoutDistribution(Object name, String group, Object object)
public void resetAttributes(Attributes attributes)
attributes
- The new attributes to append to the region.public void resetAttributes(Object name, Attributes attributes)
resetAttributes(Attributes)
.
name
- the name of the region to reset the attributes for.attributes
- the new attributes for the named region.public void save()
public void save(Object name)
save()
. If the name refers to a specific object and that
object does not implement the Serializable
interface, a
CacheException
will be logged. If the name referenced a group or
a region, all objects not implementing Serializable
is
ignored.
name
- the name of the object to save.public void waitForResponse(int timeout)
timeout
- the maximum number of milliseconds to wait for remote
caches to reply.public CacheRegion getRegion()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |