#include <SamResourceManagerPool.h>
Inherits keyple::calypso::transaction::SamResourceManager.
Implementation of Sam Resource Manager working a keyple::core::seproxy::ReaderPoolPlugin
◆ SamResourceManagerPool()
keyple::calypso::transaction::SamResourceManagerPool::SamResourceManagerPool |
( |
ReaderPoolPlugin & |
samReaderPoolPlugin, |
|
|
const int |
maxBlockingTime, |
|
|
const int |
sleepTime |
|
) |
| |
Protected constructor, use the SamResourceManagerFactory
C++ vs. Java: Should be private but would forbid usage of make_shared from SamResourceManagerFactory class. Setting it public for now. Could use an intermediate derived class otherwise if need be.
- Parameters
-
samReaderPoolPlugin | the reader pool plugin |
maxBlockingTime | the maximum duration for which the allocateSamResource method will attempt to allocate a new reader by retrying (in milliseconds). |
sleepTime | the duration to wait between two retries |
◆ allocateSamResource()
Allocate a SAM resource from the specified SAM group.In the case where the allocation mode is BLOCKING, this method will wait until a SAM resource becomes free and then return the reference to the allocated resource. However, the BLOCKING mode will wait a maximum time defined in milliseconds by MAX_BLOCKING_TIME.In the case where the allocation mode is NON_BLOCKING and no SAM resource is available, this method will return an exception.If the samGroup argument is null, the first available SAM resource will be selected and returned regardless of its group.
- Parameters
-
allocationMode | the blocking/non-blocking mode |
samIdentifier | the targeted SAM identifier |
- Returns
- a SAM resource
- Exceptions
-
CalypsoNoSamResourceAvailableException | if no resource is available |
KeypleReaderException | if a reader error occurs |
KeypleAllocationReaderException | if reader allocation fails |
Implements keyple::calypso::transaction::SamResourceManager.
◆ freeSamResource()
void keyple::calypso::transaction::SamResourceManagerPool::freeSamResource |
( |
const SeResource< CalypsoSam > & |
samResource | ) |
|
|
overridevirtual |
◆ mSamReaderPlugin
ReaderPoolPlugin& keyple::calypso::transaction::SamResourceManagerPool::mSamReaderPlugin |
|
protected |
The documentation for this class was generated from the following files: