Interface PoolPluginSpi
-
public interface PoolPluginSpi
Plugin able to manage a dynamic list of readers based on an allocation/de-allocation mechanism (for example HSM).- Since:
- 2.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PoolReaderSpi
allocateReader(java.lang.String readerGroupReference)
Obtains an available reader resource and makes it exclusive to the caller until the releaseReader method is invoked.java.lang.String
getName()
Gets the name of the pool plugin.java.util.SortedSet<java.lang.String>
getReaderGroupReferences()
Gets a list of group references that will be used as an argument toallocateReader(String)
.void
onUnregister()
Invoked when unregistering the plugin.void
releaseReader(ReaderSpi readerSpi)
Releases the reader previously allocated withallocateReader(String)
and whose reference is provided.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the pool plugin.- Returns:
- A not empty string.
- Since:
- 2.0.0
-
getReaderGroupReferences
java.util.SortedSet<java.lang.String> getReaderGroupReferences() throws PluginIOException
Gets a list of group references that will be used as an argument toallocateReader(String)
.A group reference can represent a family of Reader with all the same characteristics (for example SAM with identical key sets).
- Returns:
- An empty Set if there is no group reference
- Throws:
PluginIOException
- If an error occurs- Since:
- 2.0.0
-
allocateReader
PoolReaderSpi allocateReader(java.lang.String readerGroupReference) throws PluginIOException
Obtains an available reader resource and makes it exclusive to the caller until the releaseReader method is invoked.The allocated reader belongs to the group targeted with the provided group reference.
- Parameters:
readerGroupReference
- The reader group reference (optional).- Returns:
- A not null reference.
- Throws:
PluginIOException
- If an error occurs.- Since:
- 2.0.0
-
releaseReader
void releaseReader(ReaderSpi readerSpi) throws PluginIOException
Releases the reader previously allocated withallocateReader(String)
and whose reference is provided.This method must be invoked as soon as the reader is no longer needed by the caller of
allocateReader(String)
in order to free the resource.- Parameters:
readerSpi
- The reader to deallocate- Throws:
PluginIOException
- If an error occurs- Since:
- 2.0.0
-
onUnregister
void onUnregister()
Invoked when unregistering the plugin.- Since:
- 2.0.0
-
-