org.jboss.ejb.plugins.lock
Class NoLock

java.lang.Object
  extended by org.jboss.ejb.plugins.lock.BeanLockSupport
      extended by org.jboss.ejb.plugins.lock.NoLock
All Implemented Interfaces:
BeanLock, BeanLockExt, org.jboss.util.deadlock.Resource
Direct Known Subclasses:
JDBCOptimisticLock, MethodOnlyEJBLock

public class NoLock
extends BeanLockSupport

No locking what-so-ever Holds all locks for entity beans, not used for stateful.

All BeanLocks have a reference count. When the reference count goes to 0, the lock is released from the id -> lock mapping.

Version:
$Revision: 1.4.6.2 $

Revisions:

2001/08/08: billb

  1. Initial revision
Author:
Bill Burke

Field Summary
 
Fields inherited from class org.jboss.ejb.plugins.lock.BeanLockSupport
container, id, refs, synched, synchedDepth, tx, txTimeout
 
Constructor Summary
NoLock()
           
 
Method Summary
 void endInvocation(Invocation mi)
          Callback to the BeanLock to inform it that a method invocation has ended.
 void endTransaction(Transaction transaction)
          Informs the lock that the given transaction has ended.
 void schedule(Invocation mi)
          Schedule(Invocation) Schedule implements a particular policy for scheduling the threads coming in.
 void wontSynchronize(Transaction trasaction)
          Signifies to the lock that the transaction will not Synchronize (Tx demarcation not seen).
 
Methods inherited from class org.jboss.ejb.plugins.lock.BeanLockSupport
addRef, attemptSync, getId, getRefs, getResourceHolder, getTransaction, releaseSync, removeRef, setContainer, setId, setTimeout, setTransaction, sync
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoLock

public NoLock()
Method Detail

schedule

public void schedule(Invocation mi)
              throws Exception
Schedule(Invocation) Schedule implements a particular policy for scheduling the threads coming in. There is always the spec required "serialization" but we can add custom scheduling in here Synchronizing on lock: a failure to get scheduled must result in a wait() call and a release of the lock. Schedulation must return with lock.

Specified by:
schedule in interface BeanLock
Specified by:
schedule in class BeanLockSupport
Parameters:
mi - The method invocation that needs a lock.
Throws:
Exception

endTransaction

public void endTransaction(Transaction transaction)
Description copied from interface: BeanLock
Informs the lock that the given transaction has ended.

Specified by:
endTransaction in interface BeanLock
Specified by:
endTransaction in class BeanLockSupport
Parameters:
transaction - The transaction that has ended.

wontSynchronize

public void wontSynchronize(Transaction trasaction)
Description copied from interface: BeanLock
Signifies to the lock that the transaction will not Synchronize (Tx demarcation not seen).

OSH: This method does not seem to be called from anywhere. What is it meant for? To be called on a timeout before the transaction has terminated?

Specified by:
wontSynchronize in interface BeanLock
Specified by:
wontSynchronize in class BeanLockSupport

endInvocation

public void endInvocation(Invocation mi)
Description copied from interface: BeanLock
Callback to the BeanLock to inform it that a method invocation has ended. A common use of this method is to release a method lock.

Specified by:
endInvocation in interface BeanLock
Specified by:
endInvocation in class BeanLockSupport


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.