org.apache.commons.messenger
Class Lock

java.lang.Object
  extended by org.apache.commons.messenger.Lock

public class Lock
extends java.lang.Object

Lock is a simple lock.

Version:
$Revision: 155459 $
Author:
James Strachan

Field Summary
private  int count
           
private  java.lang.Thread owner
           
 
Constructor Summary
Lock()
           
 
Method Summary
 void acquire()
          Acquires the lock, blocking until the lock can be acquired
 boolean hasLock()
           
 void release()
          Release the lock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

private java.lang.Thread owner

count

private int count
Constructor Detail

Lock

public Lock()
Method Detail

acquire

public void acquire()
Acquires the lock, blocking until the lock can be acquired

Throws:
java.lang.InterruptedException

release

public void release()
             throws javax.jms.JMSException
Release the lock.

Throws:
javax.jms.JMSException

hasLock

public boolean hasLock()
Returns: