Mercurial > hg > blitz_stable
comparison src/org/dancres/blitz/TxnReapFilter.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; | |
2 | |
3 import org.dancres.blitz.lease.ReapFilter; | |
4 import org.dancres.blitz.lease.LeasedResource; | |
5 | |
6 import org.dancres.blitz.entry.EntrySleeve; | |
7 | |
8 import org.dancres.blitz.txnlock.*; | |
9 | |
10 /** | |
11 Blocks collection of EntrySleeve instances which are currently held under | |
12 some sort of transaction lock. | |
13 */ | |
14 public class TxnReapFilter implements ReapFilter { | |
15 public boolean filter(LeasedResource anObject) { | |
16 if (anObject instanceof EntrySleeve) { | |
17 EntrySleeve mySleeve = (EntrySleeve) anObject; | |
18 | |
19 LockMgr myMgr = | |
20 TxnLocks.getLockMgr(mySleeve.getEntry().getType()); | |
21 | |
22 // System.err.println("HasLock: " + | |
23 // myMgr.hasActiveLock(mySleeve.getOID())); | |
24 | |
25 return myMgr.hasActiveLock(mySleeve.getOID()); | |
26 } | |
27 | |
28 // We don't mind if this object is reaped - return "not filtered" | |
29 return false; | |
30 } | |
31 } |