## org.jboss.ejb
Interface BeanLock

All Known Implementing Classes:
  BeanLockSupport

public interface BeanLock

BeanLock interface

Version:
  $Revision: 1.9.4.3 $

  Revisions:

  2001/07/29: marcf

  1. Initial revision

  20010802: marcf

  1. Moved to a pluggable framework for the locking policies
  2. you specify in jboss.xml what locking-policy you want, eg. pessimistic/optimistic
  3. The BeanLock is now an interface and implementations can be found under ejb/plugins/lock
Author:
  Bill Burke, Marc Fleury

Method Summary
`void` `addMethodLock()`
`void` `addRef()`
`void` `endTransaction(javax.transaction.Transaction tx)`
`java.lang.Object` `getId()`
`int` `getNumMethodLocks()`
`int` `getRefs()`
`javax.transaction.Transaction` `getTransaction()`
`boolean` `isMethodLocked()`
`void` `releaseMethodLock()` releaseMethodLock if we reach the count of zero it means the instance is free from threads (and reentrency) we wake up the next thread in the currentLock
`void` `releaseSync()`
`void` `removeRef()`
`void` `schedule(MethodInvocation mi)`
`void` `setId(java.lang.Object id)`
`void` `setReentrant(boolean reentrant)`
`void` `setTimeout(int timeout)`
`void` `setTransaction(javax.transaction.Transaction tx)` setTransaction(Transaction tx) The setTransaction associates a transaction with the lock.
`void` `sync()`
`void` `wontSynchronize(javax.transaction.Transaction tx)`

Method Detail

### getId

    public java.lang.Object getId()

### setId

    public void setId(java.lang.Object id)

### setReentrant

    public void setReentrant(boolean reentrant)

### setTimeout

    public void setTimeout(int timeout)

### sync

    public void sync()

### releaseSync

    public void releaseSync()

### schedule

    public void schedule(MethodInvocation mi)
                  throws java.lang.Exception

### setTransaction

    public void setTransaction(javax.transaction.Transaction tx)

  setTransaction(Transaction tx) The setTransaction associates a transaction with the lock.

### getTransaction

    public javax.transaction.Transaction getTransaction()

### endTransaction

    public void endTransaction(javax.transaction.Transaction tx)

### wontSynchronize

    public void wontSynchronize(javax.transaction.Transaction tx)

### isMethodLocked

    public boolean isMethodLocked()

### getNumMethodLocks

    public int getNumMethodLocks()

### addMethodLock

    public void addMethodLock()

### releaseMethodLock

    public void releaseMethodLock()

  releaseMethodLock if we reach the count of zero it means the instance is free from threads (and reentrency) we wake up the next thread in the currentLock

### addRef

    public void addRef()

### removeRef

    public void removeRef()

### getRefs

    public int getRefs()

Copyright © 2000 The JBoss Organization. All Rights Reserved.