org.infinispan.util.concurrent.locks.containers
Class AbstractStripedLockContainer

java.lang.Object
  extended by org.infinispan.util.concurrent.locks.containers.AbstractStripedLockContainer
All Implemented Interfaces:
LockContainer
Direct Known Subclasses:
OwnableReentrantStripedLockContainer, ReentrantStripedLockContainer

@ThreadSafe
public abstract class AbstractStripedLockContainer
extends Object
implements LockContainer

A container for locks. Used with lock striping.

Since:
4.0
Author:
Manik Surtani (manik@jboss.org)

Constructor Summary
AbstractStripedLockContainer()
           
 
Method Summary
 boolean acquireLock(Object key, long timeout, TimeUnit unit)
           
protected abstract  void initLocks(int numLocks)
           
 void releaseLock(Object key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.infinispan.util.concurrent.locks.containers.LockContainer
getLock, getNumLocksHeld, isLocked, ownsLock, size
 

Constructor Detail

AbstractStripedLockContainer

public AbstractStripedLockContainer()
Method Detail

initLocks

protected abstract void initLocks(int numLocks)

acquireLock

public boolean acquireLock(Object key,
                           long timeout,
                           TimeUnit unit)
                    throws InterruptedException
Specified by:
acquireLock in interface LockContainer
Throws:
InterruptedException

releaseLock

public void releaseLock(Object key)
Specified by:
releaseLock in interface LockContainer

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.