Package org.eclipse.keyple.core.service
Interface PoolPlugin
- All Superinterfaces:
Plugin
Plugin able to handle the access to an undefined number of
CardReader
.
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
Modifier and TypeMethodDescriptionorg.eclipse.keypop.reader.CardReader
allocateReader
(String readerGroupReference) Gets aCardReader
and makes it exclusive to the caller until thereleaseReader(CardReader)
method is invoked.Gets a list of group references that identify a group of readers.org.eclipse.keypop.reader.selection.spi.SmartCard
getSelectedSmartCard
(org.eclipse.keypop.reader.CardReader reader) Returns the selectedSmartCard
from aCardReader
.void
releaseReader
(org.eclipse.keypop.reader.CardReader reader) Releases a Reader previously allocated with allocateReader.Methods inherited from interface org.eclipse.keyple.core.service.Plugin
findReader, getExtension, getName, getReader, getReaderExtension, getReaderNames, getReaders
-
Method Details
-
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
Gets aCardReader
and makes it exclusive to the caller until thereleaseReader(CardReader)
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
-
getSelectedSmartCard
org.eclipse.keypop.reader.selection.spi.SmartCard getSelectedSmartCard(org.eclipse.keypop.reader.CardReader reader) Returns the selectedSmartCard
from aCardReader
.This method is used to retrieve the selected card from a reader that has been allocated with the
allocateReader(String)
method.- Parameters:
reader
- The reader from which to get the selected card.- Returns:
- null if no smart card is selected by default, the selected smart card otherwise.
- Throws:
IllegalArgumentException
- If the provided reader is null.- Since:
- 2.2.0
-
releaseReader
void releaseReader(org.eclipse.keypop.reader.CardReader 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
-