net.sf.jportlet.service.cache
Class CacheableImpl

java.lang.Object
  |
  +--net.sf.jportlet.service.cache.CacheableImpl
All Implemented Interfaces:
Cacheable

public class CacheableImpl
extends java.lang.Object
implements Cacheable

Implementation of CacheableImpl

Author:
Herve Tchepannou

Constructor Summary
CacheableImpl(java.lang.Object id, java.lang.Object data, long TTL)
           
 
Method Summary
 void expire()
          Force the object to expire
 java.lang.Object getData()
          Returns the data
 java.lang.Object getId()
          Returns if object unique identifier
 boolean isExpired()
          Returns true if the object has expired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheableImpl

public CacheableImpl(java.lang.Object id,
                     java.lang.Object data,
                     long TTL)
Parameters:
id - Id of the Cacheable object
data - Data of the Cacheable object
TTL - Time to live in millis-seconds. if < 0, then the object never expires
Method Detail

getData

public java.lang.Object getData()
Description copied from interface: Cacheable
Returns the data

Specified by:
getData in interface Cacheable
Returns:
boolean
See Also:
Cacheable.getData()

getId

public java.lang.Object getId()
Description copied from interface: Cacheable
Returns if object unique identifier

Specified by:
getId in interface Cacheable
Returns:
Object
See Also:
Cacheable.getId()

isExpired

public boolean isExpired()
Description copied from interface: Cacheable
Returns true if the object has expired

Specified by:
isExpired in interface Cacheable
Returns:
boolean
See Also:
Cacheable.isExpired()

expire

public void expire()
Description copied from interface: Cacheable
Force the object to expire

Specified by:
expire in interface Cacheable
See Also:
Cacheable.expire()


Copyright © 2002 Herve Tchepannou. All Rights Reserved.