Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.graph.cache
Class BasicCachePolicy

    java.lang.Object
      org.modeshape.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
`clone, finalize, 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()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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