public interface PoolPlugin extends Plugin
It is typically used to define a Plugin built on top of an HSM interface that can allocate a large number of virtual reader slots.
A PoolPlugin can't be observable.
Modifier and Type | Method and Description |
---|---|
Reader |
allocateReader(java.lang.String groupReference)
Obtains an available Reader resource and makes it exclusive to the caller until the
releaseReader method is called.
|
java.util.SortedSet<java.lang.String> |
getReaderGroupReferences()
Gets a list of group references that will be used as an argument to allocateReader.
|
void |
releaseReader(Reader reader)
Releases a Reader previously allocated with allocateReader.
|
getName, getReader, getReaderNames, getReaders
java.util.SortedSet<java.lang.String> getReaderGroupReferences()
A group reference can represent a family of Reader with all the same characteristics (e.g. SAM with identical key sets).
Reader allocateReader(java.lang.String groupReference)
The allocated reader belongs to the group targeted with provided reference.
groupReference
- the reference of the group to which the reader belongs (may be null
depending on the implementation made)KeypleAllocationReaderException
- if the allocation failed due to a technical errorKeypleAllocationNoReaderException
- if the allocation failed due to lack of available
readervoid releaseReader(Reader reader)
This method must be called as soon as the reader is no longer needed by the caller of allocateReader in order to free the resource.
reader
- the Reader to be released.