org.apache.jackrabbit.core.state
Class DefaultISMLocking

java.lang.Object
  extended by org.apache.jackrabbit.core.state.DefaultISMLocking
All Implemented Interfaces:
ISMLocking

public class DefaultISMLocking
extends Object
implements ISMLocking

DefaultISMLocking implements the default locking strategy using coarse grained locking on an ItemStateManager wide read-write lock. E.g. while a write lock is held, no read lock can be acquired.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.jackrabbit.core.state.ISMLocking
ISMLocking.ReadLock, ISMLocking.WriteLock
 
Constructor Summary
DefaultISMLocking()
           
 
Method Summary
 ISMLocking.ReadLock acquireReadLock(ItemId id)
          Acquire a read lock for the given item id.
 ISMLocking.WriteLock acquireWriteLock(ChangeLog changeLog)
          Acquires a write lock for the given changeLog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultISMLocking

public DefaultISMLocking()
Method Detail

acquireReadLock

public ISMLocking.ReadLock acquireReadLock(ItemId id)
                                    throws InterruptedException
Acquire a read lock for the given item id.

Specified by:
acquireReadLock in interface ISMLocking
Parameters:
id - an item id.
Throws:
InterruptedException

acquireWriteLock

public ISMLocking.WriteLock acquireWriteLock(ChangeLog changeLog)
                                      throws InterruptedException
Acquires a write lock for the given changeLog.

Specified by:
acquireWriteLock in interface ISMLocking
Parameters:
changeLog - the change log
Returns:
the write lock for the given changeLog.
Throws:
InterruptedException - if the thread is interrupted while creating the write lock.


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