org.apache.commons.transaction.locking
Class LockException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.commons.transaction.locking.LockException
All Implemented Interfaces:
java.io.Serializable

public class LockException
extends java.lang.RuntimeException

Exception displaying a lock problem.

Since:
1.1
Version:
$Revision$
See Also:
Serialized Form

Field Summary
protected  int code
           
static int CODE_DEADLOCK_VICTIM
          Locking request canceled because of deadlock.
static int CODE_INTERRUPTED
          Thread has been interrupted while waiting for lock.
static int CODE_TIMED_OUT
          Maximum wait time for a lock has been exceeded.
protected  java.lang.String reason
           
protected  java.lang.Object resourceId
           
 
Constructor Summary
LockException(java.lang.String reason, int code, java.lang.Object resourceId)
           
 
Method Summary
 int getCode()
          Returns the formal reason for the exception.
 java.lang.String getReason()
          Returns the verbose for the exception.
 java.lang.Object getResourceId()
          Returns the resource the lock was tried on.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CODE_INTERRUPTED

public static final int CODE_INTERRUPTED
Thread has been interrupted while waiting for lock.

See Also:
Constant Field Values

CODE_TIMED_OUT

public static final int CODE_TIMED_OUT
Maximum wait time for a lock has been exceeded.

See Also:
Constant Field Values

CODE_DEADLOCK_VICTIM

public static final int CODE_DEADLOCK_VICTIM
Locking request canceled because of deadlock.

See Also:
Constant Field Values

resourceId

protected java.lang.Object resourceId

reason

protected java.lang.String reason

code

protected int code
Constructor Detail

LockException

public LockException(java.lang.String reason,
                     int code,
                     java.lang.Object resourceId)
Method Detail

getCode

public int getCode()
Returns the formal reason for the exception.

Returns:
one of CODE_INTERRUPTED,CODE_TIMED_OUTor CODE_DEADLOCK_VICTIM.

getResourceId

public java.lang.Object getResourceId()
Returns the resource the lock was tried on.

Returns:
the resource or null if not applicable

getReason

public java.lang.String getReason()
Returns the verbose for the exception.

Returns:
the reason message


Copyright ? 2004 The Apache Software Foundation. All Rights Reserved.