Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.transaction.locking
Class LockException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              java.lang.RuntimeException
                  org.apache.commons.transaction.locking.LockException

All Implemented Interfaces:
  Serializable

public class LockException
extends 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 String` | `reason`
`protected Object` | `resourceId`

Constructor Summary
`LockException(String reason, int code, Object resourceId)`

Method Summary
`int` | `getCode()` Returns the formal reason for the exception.
`String` | `getReason()` Returns the verbose for the exception.
`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 Object resourceId

### reason

    protected String reason

### code

    protected int code

Constructor Detail

### LockException

    public LockException(String reason,
                         int code,
                         Object resourceId)

Method Detail

### getCode

    public int getCode()

  Returns the formal reason for the exception.

  Returns:
    one of `CODE_INTERRUPTED`,`CODE_TIMED_OUT`or `CODE_DEADLOCK_VICTIM`.

### getResourceId

    public Object getResourceId()

  Returns the resource the lock was tried on.

  Returns:
    the resource or `null` if not applicable

### getReason

    public String getReason()

  Returns the verbose for the exception.

  Returns:
    the reason message

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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