org.jboss.dna.graph.cache
Class BasicCachePolicy

java.lang.Object
  extended by org.jboss.dna.graph.cache.BasicCachePolicy
All Implemented Interfaces:
Serializable, CachePolicy

@NotThreadSafe
public class BasicCachePolicy
extends Object
implements CachePolicy

A basic mutable CachePolicy implementation.

See Also:
Serialized Form

Constructor Summary
BasicCachePolicy()
           
BasicCachePolicy(long timeToCache, TimeUnit unit)
           
 
Method Summary
 boolean equals(Object obj)
          
 long getTimeToLive()
          Get the system time in milliseconds before which the node data remains valid.
 CachePolicy getUnmodifiable()
           
 boolean isEmpty()
           
 void setTimeToLive(long timeToLive, TimeUnit unit)
          Set the time for values and information to live in the cache.
 String toString()
          
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicCachePolicy

public BasicCachePolicy()

BasicCachePolicy

public BasicCachePolicy(long timeToCache,
                        TimeUnit unit)
Method Detail

getTimeToLive

public long getTimeToLive()
Get the system time in milliseconds before which the node data remains valid.

Specified by:
getTimeToLive in interface CachePolicy
Returns:
the number of milliseconds that the cached data should be used before consulting the original source.
See Also:
CachePolicy.getTimeToLive()

setTimeToLive

public void setTimeToLive(long timeToLive,
                          TimeUnit unit)
Set the time for values and information to live in the cache.

Parameters:
timeToLive - Sets timeToLive to the specified value.
unit - the unit in which the time to live value is defined

isEmpty

public boolean isEmpty()

getUnmodifiable

public CachePolicy getUnmodifiable()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


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