|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ias.cache.Attributes
Attributes is used to define how an object should be managed by the cache. Each Object in the cache has attributes associate with it. See User's Guide about how each attribute affects the various object types.
Field Summary |
Type | Field |
---|---|
static long |
DISTRIBUTE
indicates the object is distributed, updates and invalidations are distributed to other processes Default is local. |
static long |
GROUP_TTL_DESTROY
indicates that the group object should be destroyed when the associated time to live expires. |
static long |
ORIGINAL
indicates the object was created by the application in the cache rather than loaded from an external source. |
static long |
REPLY
indicates a reply should be sent from remote caches if this object is updated or invalidated. |
static long |
SPOOL
indicates the object should be spooled to disk when the object is being removed from the memory cache because of space limitations. |
static long |
SYNCHRONIZE
indicates that updates to this object should be synchronized. |
static long |
SYNCHRONIZE_DEFAULT
indicates that all objects in a group should be synchronized individually. |
Constructor Summary |
Attributes()
constructs a default Attributes. |
Method Summary |
Type | Method |
---|---|
java.lang.Object |
clone()
clones a new Attributes object. |
long |
getCreateTime()
returns the time the object was loaded into the cache. |
long |
getDefaultTimeToLive()
returns the Default TimeToLive value in seconds as a long value. |
long |
getFlags()
returns all flags as defined in setFlags as a long value. |
long |
getIdleTime()
returns the current value for the idle time interval. |
CacheLoader |
getLoader()
returns a CacheLoader object from this Attribute. |
long |
getObjectSize()
returns the size of the object which was specified by invoking setSize(long) . |
long |
getTimeToLive()
returns the current value for the time to live interval. |
long |
getVersion()
returns the current value of version. |
boolean |
isSet(long vflags)
returns true if the specified attribute is set, false otherwise. |
void |
setCacheEventListener(int id,
CacheEventListener listener)
registers an event listener object to be executed when the event occurs. |
void |
setCacheEventListener(int id,
CacheEventListener listener,
boolean def)
registers an event listener object to be executed when the event occurs. |
void |
setDefaultTimeToLive(long sec)
sets the default maximum time all objects associated with this group or region will stay in the cache before it is invalidated. |
void |
setFlags(long newFlags)
specifies which of the listed attributes should be set in the Attributes object. |
void |
setFlagsToDefault()
resets this Attributes object to contain default Attributes values. |
void |
setIdleTime(int idle)
sets the maximum time the associated cache object will remain in the cache without being referenced before it is invalidated. |
void |
setLoader(CacheLoader loader)
sets a CacheLoader object in this Attribute. |
void |
setSize(long objSize)
sets the size of the object. |
void |
setTimeToLive(long sec)
sets the maximum time the associated cache object will stay in the cache before it is invalidated. |
void |
setVersion(long newversion)
sets the version attribute. |
static long |
timeToSeconds(int days,
int hours,
int minutes,
int seconds)
converts the time specified in days, hours, minutes and seconds to seconds. |
java.lang.String |
toString()
converts the Attributes object to a string of the form: flags, version, time to live, idle time. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final long DISTRIBUTE
public static final long REPLY
public static final long SYNCHRONIZE
public static final long SPOOL
public static final long GROUP_TTL_DESTROY
public static final long ORIGINAL
public static final long SYNCHRONIZE_DEFAULT
Constructor Detail |
public Attributes()
Method Detail |
public void setFlags(long newFlags)
Attributes.DISTRIBUTE|Attributes.SPOOL
. Any previous settings
will be disregard.
newFlags
- can be a combination of the following values:
public long getFlags()
public void setFlagsToDefault()
public void setVersion(long newversion)
newversion
- An user defined version number.public void setTimeToLive(long sec) throws InvalidArgumentException
timeToSeconds()
method may be used to convert days, hours, and/or minutes
to seconds.
sec
- Maximum time (in seconds) the associated cache object will stay
in the cache before it is invalidated.InvalidArgumentException
- if a negative value is supplied for
argument sec
.public void setDefaultTimeToLive(long sec) throws InvalidArgumentException
timeToSeconds()
method may be used to convert days,
hours, and/or minutes to seconds.
sec
- Maximum time (in seconds) the associated cache object will stay
in the cache before it is invalidated.InvalidArgumentException
- if a negative value is supplied for
argument sec
.public long getDefaultTimeToLive()
public void setIdleTime(int idle) throws InvalidArgumentException
idle
is in seconds. The timeToSeconds()
method may be used to
convert days, hours, and/or minutes to seconds.
- Parameters:
idle
- Maximum time (in seconds) the associated cache object will
remain in the cache without being referenced before
it is invalidated.- Throws:
InvalidArgumentException
- if a negative value is supplied for
argument idle
.- Since:
- 2.0.0
public void setCacheEventListener(int id, CacheEventListener listener) throws InvalidArgumentException
OBJECT_INVALIDATED
and OBJECT_UPDATED
are
currently supported.
id
- the id of the event to be handledlistener
- A CacheEventListener object.InvalidArgumentException
- if the event type
(argument id
)
is not CacheEvent.OBJECT_INVALIDATED
or
CacheEvent.OBJECT_UPDATED
public void setCacheEventListener(int id, CacheEventListener listener, boolean def) throws InvalidArgumentException
OBJECT_INVALIDATED
and OBJECT_UPDATED
are currently supported. If the
def
parameter is true then for groups and regions
the event listener is associated with members of the group or region
rather than the group or region itself. For individual objects the
def
parameter is ignored.
id
- the id of the event to be handledlistener
- A CacheEventListener object.def
- true if the handler should apply to the members of a group or
region individually rather than the group or region itselfInvalidArgumentException
- if the event type
(argument id
)
is not CacheEvent.OBJECT_INVALIDATED
or
CacheEvent.OBJECT_UPDATED
.public void setLoader(CacheLoader loader)
loader
- The CacheLoader object to be set in this Attribute.listener
- A CacheEventListener object.public void setSize(long objSize)
objSize
- is the size of the object in bytes.public CacheLoader getLoader()
public boolean isSet(long vflags)
isSet()
will return
true only if all of the attributes specifed are set.
vflags
- Verify if a particular attribute is set.public long getVersion()
public long getCreateTime()
public long getTimeToLive()
public long getIdleTime()
public long getObjectSize()
setSize(long)
.
public java.lang.Object clone()
clone
in class java.lang.Object
public static long timeToSeconds(int days, int hours, int minutes, int seconds) throws InvalidArgumentException
days
- Number of days.hours
- Number of hours.minutes
- Number of minutes.seconds
- Number of seconds.InvalidArgumentException
- if a negative value is supplied for any of
the arguments.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |