Mercurial > hg > blitz_condensed
diff src/org/dancres/blitz/entry/LeaseTracker.java @ 0:3dc0c5604566
Initial checkin of blitz 2.0 fcs - no installer yet.
author | Dan Creswell <dan.creswell@gmail.com> |
---|---|
date | Sat, 21 Mar 2009 11:00:06 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/org/dancres/blitz/entry/LeaseTracker.java Sat Mar 21 11:00:06 2009 +0000 @@ -0,0 +1,48 @@ +package org.dancres.blitz.entry; + +import java.io.IOException; + +import org.dancres.blitz.lease.ReapFilter; + +/** + <p> + Tracks the lease expiries for all EntrySleeves of a particular type. + </p> + + <p> + When you are ready to process expired leases, invoke + <code>bringOutTheDead</code> which will cause the <code>LeaseTracker</code> + to pass one or more <code>TupleLocator<code> instances to the passed + <code>EntryReaper</code>. The <code>EntryReaper</code> should iterate + through each Locator instance and do the following: + </p> + + <ol> + <li>Load the <code>EntrySleeve</code> associated with the UID</li> + <li>Check it has actually expired. Note that, due to caching, the version + of the sleeve in cache may contain an updated expiry time which hasn't yet + been communicated to the <code>LeaseTracker</code>.</li> + <li>If the <code>EntrySleeve</code> has expired, filter using appropriate + <code>ReapFilter</code>s and mark the <code>EntrySleeve</code> for deletion + assuming the filters don't boycott.</li> + </ol> + + @see org.dancres.blitz.entry.TupleLocator + @see org.dancres.blitz.entry.EntryReaper + */ +public interface LeaseTracker { + /** + Locate expired entries and pass their UIDs to the specified filter. + */ + public void bringOutTheDead(EntryReaper aReaper) throws IOException; + + public void delete(PersistentEntry anEntry) throws IOException; + + public void update(PersistentEntry anEntry) throws IOException; + + public void write(PersistentEntry anEntry) throws IOException; + + public void close() throws IOException; + + public void delete() throws IOException; +}