Mercurial > hg > blitz_condensed
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:3dc0c5604566 |
---|---|
1 package org.dancres.blitz.entry; | |
2 | |
3 import java.io.IOException; | |
4 | |
5 import org.dancres.blitz.lease.ReapFilter; | |
6 | |
7 /** | |
8 <p> | |
9 Tracks the lease expiries for all EntrySleeves of a particular type. | |
10 </p> | |
11 | |
12 <p> | |
13 When you are ready to process expired leases, invoke | |
14 <code>bringOutTheDead</code> which will cause the <code>LeaseTracker</code> | |
15 to pass one or more <code>TupleLocator<code> instances to the passed | |
16 <code>EntryReaper</code>. The <code>EntryReaper</code> should iterate | |
17 through each Locator instance and do the following: | |
18 </p> | |
19 | |
20 <ol> | |
21 <li>Load the <code>EntrySleeve</code> associated with the UID</li> | |
22 <li>Check it has actually expired. Note that, due to caching, the version | |
23 of the sleeve in cache may contain an updated expiry time which hasn't yet | |
24 been communicated to the <code>LeaseTracker</code>.</li> | |
25 <li>If the <code>EntrySleeve</code> has expired, filter using appropriate | |
26 <code>ReapFilter</code>s and mark the <code>EntrySleeve</code> for deletion | |
27 assuming the filters don't boycott.</li> | |
28 </ol> | |
29 | |
30 @see org.dancres.blitz.entry.TupleLocator | |
31 @see org.dancres.blitz.entry.EntryReaper | |
32 */ | |
33 public interface LeaseTracker { | |
34 /** | |
35 Locate expired entries and pass their UIDs to the specified filter. | |
36 */ | |
37 public void bringOutTheDead(EntryReaper aReaper) throws IOException; | |
38 | |
39 public void delete(PersistentEntry anEntry) throws IOException; | |
40 | |
41 public void update(PersistentEntry anEntry) throws IOException; | |
42 | |
43 public void write(PersistentEntry anEntry) throws IOException; | |
44 | |
45 public void close() throws IOException; | |
46 | |
47 public void delete() throws IOException; | |
48 } |