javax.util.jcache
Interface Attributes

All Known Implementing Classes:
AttributesImpl

Deprecated. removed with no replacement.

public interface Attributes

This class defines the attributes an object in the cache can have.


Field Summary
static long DISTRIBUTE
          Deprecated. Indicates the object is distributed, updates and invalidations are distributed to other processes.
static long GROUP_TTL_DESTROY
          Deprecated. Indicates the group object should be destroyed when the associated time to live expires.
static int INVALIDATE_EVENT
          Deprecated. Event wich is fired when invalidation of an cacheobject is fired.
static long NOFLUSH
          Deprecated. Indicates to not flush the object from the cache if the object is distributed and the cache is isolated from other caches.
static long ORIGINAL
          Deprecated. Indicates the object was created in the cache and can't be recreated if removed from the cache.
static long REPLY
          Deprecated. Indicates a reply should be sent from the remote caches if this object is updated or invalidated.
static long SPOOL
          Deprecated. Indicates the object shoulod be spooled to disk when the object is being removed from the memory cache because of space limitations.
static long SYNCHRONIZE
          Deprecated. Indicates that the updates to this object should be synchronized.
 
Method Summary
 void applyAttributes(Attributes attributes)
          Deprecated.  
 long getCreateTime()
          Deprecated. returns the time the object was loaded into the cache.
 long getDefaultTimeToLive()
          Deprecated.  
 long getIdleTime()
          Deprecated. returns the current value for the idle time interval.
 CacheEventListener getListener()
          Deprecated. Gets the CacheEventListener.
 CacheLoader getLoader()
          Deprecated. returns the CacheLoaderattribute.
 int getSize()
          Deprecated. returns the size of the object.
 long getTimeToLive()
          Deprecated. returns the current value for the time to live interval.
 long getVersion()
          Deprecated. returns the current value of version.
 boolean isSet(long theFlags)
          Deprecated. Checks wether the flags are set or not.
 void reset()
          Deprecated. resets the Attributes to its default values.
 void setCreateTime(long aCreateTime)
          Deprecated. Sets the createTime.
 void setDefaultTimeToLive(long ttl)
          Deprecated. Will set the maximum time the associated cache object will stay in the cache before it is invalidated.
 void setFlags(long theFlags)
          Deprecated. Is used to specify wich attributes should be set in the attributes object.
 void setIdleTime(long idle)
          Deprecated. sets the maximum time the associated cache object will remain in the cache without being referenced before it is invalidated.
 void setListener(int event, CacheEventListener aListener)
          Deprecated. Register an event listener object to be executed when the specified event occurs with relationship to the associated object.
 void setLoader(CacheLoader aLoader)
          Deprecated. Will associate a loader object with this object.
 void setSize(int aSize)
          Deprecated. Is used to specify the size in bytes of the object being cached.
 void setTimeToLive(long ttl)
          Deprecated. Will set the maximum time the associated cache object will stay in the cache before it is invalidated.
 void setVersion(long aVersion)
          Deprecated. Sets the version attribute.
 long timeToSeconds(int days, int hours, int minutes, int seconds)
          Deprecated. Will convert the time specified into seconds.
 

Field Detail

INVALIDATE_EVENT

static final int INVALIDATE_EVENT
Deprecated. 
Event wich is fired when invalidation of an cacheobject is fired.

See Also:
Constant Field Values

DISTRIBUTE

static final long DISTRIBUTE
Deprecated. 
Indicates the object is distributed, updates and invalidations are distributed to other processes. Default is to not distribute changes.

See Also:
Constant Field Values

NOFLUSH

static final long NOFLUSH
Deprecated. 
Indicates to not flush the object from the cache if the object is distributed and the cache is isolated from other caches. Default is to flush the object. This flag is ignored if a "time to live" is specified, or the object is local.

See Also:
Constant Field Values

REPLY

static final long REPLY
Deprecated. 
Indicates a reply should be sent from the remote caches if this object is updated or invalidated. The default is no reply. If the object is local, this flag is ignored.

See Also:
Constant Field Values

SYNCHRONIZE

static final long SYNCHRONIZE
Deprecated. 
Indicates that the updates to this object should be synchronized. If this flag is set, only the owner of an object can update or invalidate the object. The default is no synchronization.

See Also:
Constant Field Values

SPOOL

static final long SPOOL
Deprecated. 
Indicates the object shoulod be spooled to disk when the object is being removed from the memory cache because of space limitations. This flag is only valid for memory objects.

See Also:
Constant Field Values

GROUP_TTL_DESTROY

static final long GROUP_TTL_DESTROY
Deprecated. 
Indicates the group object should be destroyed when the associated time to live expires. In the default case only the child objects are invalidated. The group remains valid.

See Also:
Constant Field Values

ORIGINAL

static final long ORIGINAL
Deprecated. 
Indicates the object was created in the cache and can't be recreated if removed from the cache. Original objects don't get removed from the cache even when they are not referenced. Original objects must be invalidated before they get removed fromthe cache.

See Also:
Constant Field Values
Method Detail

setFlags

void setFlags(long theFlags)
Deprecated. 
Is used to specify wich attributes should be set in the attributes object. The different attributes wich is valid is defined as public static variables in the Attributesclass.

Parameters:
theFlags - The attributes to set. the attributes may be OR-ed together. I.e. Attributes.DISTRIBUTE | Attributes.SYNCHRONIZE Invalid flags are silently ignored. To reset all flags you use 0 as a parameter. I.e. setFlags(0)

setLoader

void setLoader(CacheLoader aLoader)
Deprecated. 
Will associate a loader object with this object.

Parameters:
aLoader - The loader to set. This parameter can be null.

setVersion

void setVersion(long aVersion)
Deprecated. 
Sets the version attribute. Is only maintained for user convenience. It is not used internally by the cache.

Parameters:
aVersion - the version number to set.

setTimeToLive

void setTimeToLive(long ttl)
                   throws InvalidArgumentException
Deprecated. 
Will set the maximum time the associated cache object will stay in the cache before it is invalidated. The time starts when the object is loaded into the cache(by the CacheLoaderobject or put by the CacheAccess#replace(Object, Object)) or when the time to live attribute is set by the CacheLoader.setAttributes(Object, Attributes) method.

Parameters:
ttl - the time to live in seconds. The timeToSeconds(int, int, int, int) can be used to convert days, hours, minutes to seconds.
Throws:
InvalidArgumentException - if a negative value for ttl is supplied.

setDefaultTimeToLive

void setDefaultTimeToLive(long ttl)
                          throws InvalidArgumentException
Deprecated. 
Will set the maximum time the associated cache object will stay in the cache before it is invalidated. For regions and groups, this will establish a default time to live that is applied individually to each member in the group or region. It will not cause the entire group or region to time out as a whole. For individual objects, the default time to live is equivalent with time to live. If both are set the default time to live is ignored. The time starts when the object is loaded into the cache(by the CacheLoaderobjector put by the CacheAccess#replace(Object, Object)) or when the time to live attribute is set by the CacheLoader.setAttributes(Object,Attributes) method.

Parameters:
ttl - the time to live in seconds. The timeToSeconds(int, int, int, int) can be used to convert days, hours, minutes to secounds.
Throws:
InvalidArgumentException - if a negative value for ttl is supplied.

getDefaultTimeToLive

long getDefaultTimeToLive()
Deprecated. 

setIdleTime

void setIdleTime(long idle)
                 throws InvalidArgumentException
Deprecated. 
sets the maximum time the associated cache object will remain in the cache without being referenced before it is invalidated.

Parameters:
idle - is in seconds. The timeToSeconds(int, int, int,int) can be used to convert days, hours, minutes to secounds.
Throws:
InvalidArgumentException - if a negative value for idle is supplied.

setListener

void setListener(int event,
                 CacheEventListener aListener)
Deprecated. 
Register an event listener object to be executed when the specified event occurs with relationship to the associated object. Currently the only invalidate event being monitored is Attributes.INVALIDATE_EVENT. If invalid parameters are passed such as invalid events, or null as listener, this method silently returns without doing any changes to this object.

Parameters:
event - The event to listen for.
aListener - the listener to fire when the event occurs.

setSize

void setSize(int aSize)
Deprecated. 
Is used to specify the size in bytes of the object being cached. This is used to determine when the cache capacity is reached. If the cache is not using object size to determine the capacity (It can also use object counts) this value is ignored.

Parameters:
aSize - the size to be set. if this parameter is smaller than zero, this method silently returns.

getSize

int getSize()
Deprecated. 
returns the size of the object. this size is set by the setSize(int) method, or in the case of StreamAccess objects, the size is calculated by the cache.

Returns:
the size of the object, or 0 if the size has not been set.

isSet

boolean isSet(long theFlags)
Deprecated. 
Checks wether the flags are set or not.

Parameters:
theFlags - the flags to be checked. may be OR-ed together, for wich this method will return true only if all flags are set.
Returns:
true if the specified attribute is set, false otherwise.

getCreateTime

long getCreateTime()
Deprecated. 
returns the time the object was loaded into the cache. The time is the number of milliseconds since midnight, January 1, 1970 (UTC).

Returns:
the time the object was loaded into the cache. The time is the number of milliseconds since midnight, January 1, 1970 (UTC).

getLoader

CacheLoader getLoader()
Deprecated. 
returns the CacheLoaderattribute.

Returns:
the CacheLoaderattribute.

getVersion

long getVersion()
Deprecated. 
returns the current value of version.

Returns:
the current value of version.

getIdleTime

long getIdleTime()
Deprecated. 
returns the current value for the idle time interval.

Returns:
the current value for the idle time interval.

getTimeToLive

long getTimeToLive()
Deprecated. 
returns the current value for the time to live interval.

Returns:
the current value for the time to live interval.

reset

void reset()
Deprecated. 
resets the Attributes to its default values. The attributes wich are reset are expiration time attributes, time to live, default time to live, idle time and event handlers.


setCreateTime

void setCreateTime(long aCreateTime)
Deprecated. 
Sets the createTime.

Parameters:
aCreateTime - The createTime to set

timeToSeconds

long timeToSeconds(int days,
                   int hours,
                   int minutes,
                   int seconds)
                   throws InvalidArgumentException
Deprecated. 
Will convert the time specified into seconds.

Parameters:
days - number of days.
hours - number of hours.
minutes - number of minutes.
seconds - number of seconds.
Returns:
the converted time in seconds.
Throws:
InvalidArgumentException - if any of the parameters are negative values.

getListener

CacheEventListener getListener()
Deprecated. 
Gets the CacheEventListener.

Returns:
The CacheEventListener.

applyAttributes

void applyAttributes(Attributes attributes)
Deprecated. 


Copyright © 2002-2009 Hosted by SourceForge. All Rights Reserved.