org.apache.ojb.otm.lock.wait
Class TimeoutStrategy

java.lang.Object
  extended byorg.apache.ojb.otm.lock.wait.TimeoutStrategy
All Implemented Interfaces:
LockWaitStrategy

public class TimeoutStrategy
extends java.lang.Object
implements LockWaitStrategy

Deadlock detection, then timeout

Author:
Oleg Nitz

Constructor Summary
TimeoutStrategy()
          The default timeout is 30 seconds
TimeoutStrategy(long timeout)
           
 
Method Summary
 void waitForLock(ObjectLock lock, Transaction tx)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeoutStrategy

public TimeoutStrategy(long timeout)
Parameters:
timeout - the number of milliseconds to wait before throwing exception

TimeoutStrategy

public TimeoutStrategy()
The default timeout is 30 seconds

Method Detail

waitForLock

public void waitForLock(ObjectLock lock,
                        Transaction tx)
                 throws LockingException
Specified by:
waitForLock in interface LockWaitStrategy
Parameters:
lock - The lock that the tx is waiting for
tx - The waiting tx
Throws:
LockingException
See Also:
LockWaitStrategy.waitForLock(ObjectLock, Transaction)


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14