1 25 26 package org.objectweb.perseus.concurrency.pessimistic; 27 28 import org.objectweb.perseus.concurrency.api.ConcurrencyException; 29 import org.objectweb.perseus.dependency.api.DependencyGraph; 30 import org.objectweb.util.monolog.api.Logger; 31 32 37 public abstract class Lock { 38 39 protected int reservations = 0; 40 public Object hints; 41 public DependencyGraph dg = null; 42 public Logger logger = null; 43 public Object oid; 44 45 public Lock() { 46 } 47 48 public Lock(Object hints, DependencyGraph dg) { 49 this.hints = hints; 50 this.dg = dg; 51 } 52 53 public synchronized void reserve() { 54 reservations++; 55 } 56 57 62 public abstract void readIntention(Object ctxt) 63 throws ConcurrencyException; 64 65 70 public abstract void writeIntention(Object ctxt) 71 throws ConcurrencyException; 72 73 81 public abstract boolean close(Object ctxt); 82 83 84 public abstract byte getMax(); 85 86 } 87 | Popular Tags |