org.jboss.dna.graph.request
Class CacheableRequest

java.lang.Object
  extended by org.jboss.dna.graph.request.Request
      extended by org.jboss.dna.graph.request.CacheableRequest
All Implemented Interfaces:
Serializable, Cacheable
Direct Known Subclasses:
GetWorkspacesRequest, ReadAllChildrenRequest, ReadAllPropertiesRequest, ReadBlockOfChildrenRequest, ReadBranchRequest, ReadNextBlockOfChildrenRequest, ReadNodeRequest, ReadPropertyRequest, VerifyNodeExistsRequest

@ThreadSafe
public abstract class CacheableRequest
extends Request
implements Cacheable

A request that contains results that may be cached.

See Also:
Serialized Form

Constructor Summary
CacheableRequest()
           
 
Method Summary
 CachePolicy getCachePolicy()
          Get the caching policy to be used for this object.
 DateTime getTimeLoaded()
          Get the time that this node data was originally loaded.
 void setCachePolicy(CachePolicy cachePolicy)
          Set the caching policy for this object.
 void setTimeLoaded(DateTime timeLoaded)
           
 
Methods inherited from class org.jboss.dna.graph.request.Request
cancel, freeze, getError, hasError, isCancelled, isFrozen, isReadOnly, setError, setLatchForFreezing
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheableRequest

public CacheableRequest()
Method Detail

getCachePolicy

public CachePolicy getCachePolicy()
Get the caching policy to be used for this object.

Note that the values of the policy are relative to the time the node was loaded, so the same instance can be used for many nodes.

Specified by:
getCachePolicy in interface Cacheable
Returns:
cachePolicy the caching policy, which may not be null
See Also:
Cacheable.getCachePolicy()

getTimeLoaded

public DateTime getTimeLoaded()
Get the time that this node data was originally loaded.

Specified by:
getTimeLoaded in interface Cacheable
Returns:
the system time (in milliseconds) that the node data was loaded
See Also:
Cacheable.getTimeLoaded()

setCachePolicy

public void setCachePolicy(CachePolicy cachePolicy)
Set the caching policy for this object.

Specified by:
setCachePolicy in interface Cacheable
Parameters:
cachePolicy - the caching policy to use for this object
Throws:
IllegalStateException - if the request is frozen
See Also:
Cacheable.setCachePolicy(org.jboss.dna.graph.cache.CachePolicy)

setTimeLoaded

public void setTimeLoaded(DateTime timeLoaded)
Parameters:
timeLoaded - Sets timeLoaded to the specified value.
Throws:
IllegalStateException - if the request is frozen


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.