org.apache.jackrabbit.core.util
Interface RepositoryLockMechanism

All Known Implementing Classes:
CooperativeFileLock, RepositoryLock

public interface RepositoryLockMechanism

Exclusive lock on a repository home directory. This class encapsulates collective experience on how to acquire an exclusive lock on a given directory. The lock is expected to be exclusive both across process boundaries and within a single JVM.


Method Summary
 void acquire()
          Lock the repository home.
 void init(String homeDir)
          Initialize the instance for the given directory path.
 void release()
          Releases repository lock.
 

Method Detail

init

void init(String homeDir)
          throws RepositoryException
Initialize the instance for the given directory path. The lock still needs to be explicitly acquired using the acquire() method.

Parameters:
homeDir - directory path
Throws:
RepositoryException - if the canonical path of the directory can not be determined

acquire

void acquire()
             throws RepositoryException
Lock the repository home.

Throws:
RepositoryException - if the repository lock can not be acquired

release

void release()
             throws RepositoryException
Releases repository lock.

Throws:
RepositoryException - if the repository lock can not be released


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