KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > lock > LockStrategyNone


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.cache.lock;
8
9 import java.util.concurrent.locks.Lock JavaDoc;
10
11 /**
12  * Transaction isolation level of None.
13  *
14  * @author Lari Hotari
15  * @version $Revision: 1.2 $
16  */

17 public class LockStrategyNone implements LockStrategy
18 {
19    private Lock JavaDoc nullLock_;
20
21    public LockStrategyNone()
22    {
23       nullLock_ = new NullLock();
24    }
25
26    /**
27     * @see org.jboss.cache.lock.LockStrategy#readLock()
28     */

29    public Lock JavaDoc readLock()
30    {
31       return nullLock_;
32    }
33
34    /**
35     * @see org.jboss.cache.lock.LockStrategy#upgradeLockAttempt(long)
36     */

37    public Lock JavaDoc upgradeLockAttempt(long msecs) throws UpgradeException
38    {
39       return nullLock_;
40    }
41
42    /**
43     * @see org.jboss.cache.lock.LockStrategy#writeLock()
44     */

45    public Lock JavaDoc writeLock()
46    {
47       return nullLock_;
48    }
49    
50  }
51
52
Popular Tags