com.bigdata.journal
Class ResourceLockService

java.lang.Object
  extended by com.bigdata.journal.ResourceLockService
All Implemented Interfaces:
IResourceLockService

public final class ResourceLockService
extends Object
implements IResourceLockService

An implementation using NamedLocks suitable for within JVM locking.

Version:
$Id: ResourceLockService.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Constructor Summary
ResourceLockService()
           
 
Method Summary
 IResourceLock acquireLock(String namespace)
          Acquire an exclusive lock on the named resource.
 IResourceLock acquireLock(String namespace, long timeout)
          Acquire an exclusive lock the named resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceLockService

public ResourceLockService()
Method Detail

acquireLock

public IResourceLock acquireLock(String namespace)
Description copied from interface: IResourceLockService
Acquire an exclusive lock on the named resource. The request will block until the lock is available.

Specified by:
acquireLock in interface IResourceLockService
Parameters:
namespace - The named resource.
Returns:
The lock.

acquireLock

public IResourceLock acquireLock(String namespace,
                                 long timeout)
                          throws InterruptedException,
                                 TimeoutException
Description copied from interface: IResourceLockService
Acquire an exclusive lock the named resource. The request will block until the lock is available or the timeout expires.

Specified by:
acquireLock in interface IResourceLockService
Parameters:
namespace - The named resource.
timeout - Timeout in milliseconds for the request -or- Long.MAX_VALUE to wait forever.
Returns:
The lock.
Throws:
InterruptedException
TimeoutException


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.