Package org.apache.jackrabbit.test
Class RepositoryHelperPoolImpl
- java.lang.Object
-
- org.apache.jackrabbit.test.RepositoryHelperPoolImpl
-
- All Implemented Interfaces:
RepositoryHelperPool
public class RepositoryHelperPoolImpl extends Object implements RepositoryHelperPool
RepositoryHelperPoolImpl
implements a pool of repository helper instances.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addHelper(RepositoryHelper helper)
RepositoryHelper
borrowHelper()
Borrows a repository helper instance.RepositoryHelper[]
borrowHelpers()
Borrows all available repository helper instances.static RepositoryHelperPool
getInstance()
void
returnHelper(RepositoryHelper helper)
Returns the given repository helper to the pool.
-
-
-
Method Detail
-
getInstance
public static RepositoryHelperPool getInstance()
-
addHelper
public void addHelper(RepositoryHelper helper)
-
borrowHelper
public RepositoryHelper borrowHelper() throws InterruptedException
Description copied from interface:RepositoryHelperPool
Borrows a repository helper instance.- Specified by:
borrowHelper
in interfaceRepositoryHelperPool
- Returns:
- a repository helper.
- Throws:
InterruptedException
- if this thread is interrupted while waiting for a repository helper.
-
borrowHelpers
public RepositoryHelper[] borrowHelpers() throws InterruptedException
Description copied from interface:RepositoryHelperPool
Borrows all available repository helper instances. Waits until one becomes available.- Specified by:
borrowHelpers
in interfaceRepositoryHelperPool
- Returns:
- a repository helper.
- Throws:
InterruptedException
- if this thread is interrupted while waiting for a repository helper.
-
returnHelper
public void returnHelper(RepositoryHelper helper)
Description copied from interface:RepositoryHelperPool
Returns the given repository helper to the pool.- Specified by:
returnHelper
in interfaceRepositoryHelperPool
- Parameters:
helper
- the repository helper to return.
-
-