Package org.eclipse.keyple.core.service
Interface PoolPlugin
-
- All Superinterfaces:
Plugin
public interface PoolPlugin extends Plugin
Plugin able to handle the access to an undefined number ofReader
.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.
- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Reader
allocateReader(java.lang.String readerGroupReference)
Gets aReader
and makes it exclusive to the caller until thereleaseReader(Reader)
method is invoked.java.util.SortedSet<java.lang.String>
getReaderGroupReferences()
Gets a list of group references that identify a group of readers.void
releaseReader(Reader reader)
Releases a Reader previously allocated with allocateReader.-
Methods inherited from interface org.eclipse.keyple.core.service.Plugin
getExtension, getName, getReader, getReaderNames, getReaders
-
-
-
-
Method Detail
-
getReaderGroupReferences
java.util.SortedSet<java.lang.String> getReaderGroupReferences()
Gets a list of group references that identify a group of readers.A group reference can represent a family of readers that all have the same characteristics (for example, containing a SAM with identical key sets).
- Returns:
- a list of String
- Since:
- 2.0.0
-
allocateReader
Reader allocateReader(java.lang.String readerGroupReference)
Gets aReader
and makes it exclusive to the caller until thereleaseReader(Reader)
method is invoked.The allocated reader belongs to the group targeted with provided reference.
- Parameters:
readerGroupReference
- The reference of the group to which the reader belongs (may be null depending on the implementation made).- Returns:
- A not null reference.
- Throws:
KeyplePluginException
- If the allocation failed due to lack of available reader.- Since:
- 2.0.0
-
releaseReader
void releaseReader(Reader reader)
Releases a Reader previously allocated with allocateReader.This method must be invoked as soon as the reader is no longer needed by the caller of allocateReader in order to free the resource.
- Parameters:
reader
- The Reader to be released.- Since:
- 2.0.0
-
-