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
RepositoryHelperPoolImplimplements a pool of repository helper instances.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHelper(RepositoryHelper helper)RepositoryHelperborrowHelper()Borrows a repository helper instance.RepositoryHelper[]borrowHelpers()Borrows all available repository helper instances.static RepositoryHelperPoolgetInstance()voidreturnHelper(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:RepositoryHelperPoolBorrows a repository helper instance.- Specified by:
borrowHelperin 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:RepositoryHelperPoolBorrows all available repository helper instances. Waits until one becomes available.- Specified by:
borrowHelpersin 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:RepositoryHelperPoolReturns the given repository helper to the pool.- Specified by:
returnHelperin interfaceRepositoryHelperPool- Parameters:
helper- the repository helper to return.
-
-