Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » ejb » plugins » lock » [javadoc | source]
org.jboss.ejb.plugins.lock
abstract public class: BeanLockSupport [javadoc | source]
java.lang.Object
   org.jboss.ejb.plugins.lock.BeanLockSupport

All Implemented Interfaces:
    Resource, BeanLockExt

Direct Known Subclasses:
    NoLock, JDBCOptimisticLock, QueuedPessimisticEJBLockNoADE, MethodOnlyEJBLock, QueuedPessimisticEJBLock, SimpleReadWriteEJBLock

Support for the BeanLock
Field Summary
protected  Container container     
protected  int refs    Number of threads that retrieved this lock from the manager (0 means removing) 
protected  Object id    The Cachekey corresponding to this Bean 
static  Logger log    Logger instance 
protected  Transaction tx    Transaction holding lock on bean 
protected  Thread synched     
protected  int synchedDepth     
protected  int txTimeout     
Method from org.jboss.ejb.plugins.lock.BeanLockSupport Summary:
addRef,   attemptSync,   endInvocation,   endTransaction,   getId,   getRefs,   getResourceHolder,   getTransaction,   releaseSync,   removeRef,   schedule,   setContainer,   setId,   setTimeout,   setTransaction,   sync,   wontSynchronize
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.ejb.plugins.lock.BeanLockSupport Detail:
 public  void addRef() 
 public boolean attemptSync() 
    A non-blocking method that checks if the calling thread will be able to acquire the sync lock based on the calling thread.
 abstract public  void endInvocation(Invocation mi)
 abstract public  void endTransaction(Transaction tx)
 public Object getId() 
 public int getRefs() 
 public Object getResourceHolder() 
 public Transaction getTransaction() 
 public  void releaseSync() 
 public  void removeRef() 
 abstract public  void schedule(Invocation mi) throws Exception
 public  void setContainer(Container container) 
 public  void setId(Object id) 
 public  void setTimeout(int timeout) 
 public  void setTransaction(Transaction tx) 
    The setTransaction associates a transaction with the lock. The current transaction is associated by the schedule call.
 public  void sync() 
    A method that checks if the calling thread has the lock, and if it does not blocks until the lock is available. If there is no current owner of the lock, or the calling thread already owns the lock then the calling thread will immeadiately acquire the lock.
 abstract public  void wontSynchronize(Transaction tx)