wt.replication.unit
Class WTUnitUtil

java.lang.Object
  extended bywt.replication.unit.WTUnitUtil

public class WTUnitUtil
extends Object


Field Summary
static int RETRY_ATTEMPTS_NUMBER
           
static int SLEEP_INTERVAL_SECONDS
           
 
Constructor Summary
WTUnitUtil()
           
 
Method Summary
static Persistable lockAndRefreshPersistentObject(Persistable obj)
          Performs a database lock on the given Persistable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETRY_ATTEMPTS_NUMBER

public static final int RETRY_ATTEMPTS_NUMBER
See Also:
Constant Field Values

SLEEP_INTERVAL_SECONDS

public static final int SLEEP_INTERVAL_SECONDS
See Also:
Constant Field Values
Constructor Detail

WTUnitUtil

public WTUnitUtil()
Method Detail

lockAndRefreshPersistentObject

public static Persistable lockAndRefreshPersistentObject(Persistable obj)
                                                  throws WTException
Performs a database lock on the given Persistable object. If the given object is locked, this thread will sleep for the given sleepIntervalSeconds and will retry the given number of times. If the object is still locked after retrying, an ObjectLockedException will be thrown. Then retrieves a Persistable object from the database given its object identifier. Object references of the target object are not refreshed.

Throws:
WTException