Top Description Methods
javax.cache.expiry

public Interface ExpiryPolicy

Known Direct Implementers
javax.cache.expiry.ModifiedExpiryPolicy, javax.cache.expiry.TouchedExpiryPolicy, javax.cache.expiry.AccessedExpiryPolicy, javax.cache.expiry.CreatedExpiryPolicy, javax.cache.expiry.EternalExpiryPolicy

Defines functions to determine when cache entries will expire based on creation, access and modification operations.

Each of the functions return a new Duration that specifies the amount of time that must pass before a cache entry is considered expired. Duration has constants defined for useful durations.

Authors
Brian Oliver, Greg Luck
Since
1.0
See Also
Duration

Method Summary

Modifier and TypeMethod and Description
public Duration

Returns:

the new Duration before an accessed entry expires
getExpiryForAccess
()

Gets the Duration before an accessed Cache.Entry is considered expired.

public Duration

Returns:

the new Duration before a created entry expires
getExpiryForCreation
()

Gets the Duration before a newly created Cache.Entry is considered expired.

public Duration

Returns:

the new Duration before an updated entry expires
getExpiryForUpdate
()

Gets the Duration before an updated Cache.Entry is considered expired.

Method Detail

getExpiryForAccessback to summary
public Duration getExpiryForAccess()

Gets the Duration before an accessed Cache.Entry is considered expired.

This method is called by a caching implementation after a Cache.Entry is accessed to determine the Duration before an entry expires. If a Duration#ZERO is returned a Cache.Entry will be considered immediately expired. Returning null will result in no change to the previously understood expiry Duration.

Should an exception occur while determining the Duration, an implementation specific default Duration will be used.

Returns:Duration

the new Duration before an accessed entry expires

getExpiryForCreationback to summary
public Duration getExpiryForCreation()

Gets the Duration before a newly created Cache.Entry is considered expired.

This method is called by a caching implementation after a Cache.Entry is created, but before a Cache.Entry is added to a cache, to determine the Duration before an entry expires. If a Duration#ZERO is returned the new Cache.Entry is considered to be already expired and will not be added to the Cache.

Should an exception occur while determining the Duration, an implementation specific default Duration will be used.

Returns:Duration

the new Duration before a created entry expires

getExpiryForUpdateback to summary
public Duration getExpiryForUpdate()

Gets the Duration before an updated Cache.Entry is considered expired.

This method is called by the caching implementation after a Cache.Entry is updated to determine the Duration before the updated entry expires. If a Duration#ZERO is returned a Cache.Entry is considered immediately expired. Returning null will result in no change to the previously understood expiry Duration.

Should an exception occur while determining the Duration, an implementation specific default Duration will be used.

Returns:Duration

the new Duration before an updated entry expires