001package net.sf.hajdbc.distributable;
002
003import java.io.Serializable;
004import java.util.Map;
005import java.util.concurrent.locks.Lock;
006
007import net.sf.hajdbc.LockManager;
008
009import org.jgroups.Address;
010
011public interface LockDecree extends Serializable
012{
013        /**
014         * Returns the address of the node that requested the lock
015         * @return a node address
016         */
017        public Address getAddress();
018
019        /**
020         * Execute lock operation.
021         * @param lockManager a lock manager
022         * @param lockMap a map of object identifier to lock
023         * @return true if operation was successful, false otherwise.
024         */
025        public boolean vote(LockManager lockManager, Map<String, Lock> lockMap);
026}