public abstract class SamResourceManager
extends java.lang.Object
Provides methods fot the allocation/deallocation of SAM resources
| Modifier and Type | Class and Description |
|---|---|
static class |
SamResourceManager.AllocationMode |
| Constructor and Description |
|---|
SamResourceManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> |
allocateSamResource(SamResourceManager.AllocationMode allocationMode,
SamIdentifier samIdentifier)
Allocate a SAM resource from the specified SAM group.
|
protected org.eclipse.keyple.calypso.transaction.sammanager.SamResourceManagerDefault.ManagedSamResource |
createSamResource(org.eclipse.keyple.core.service.Reader samReader)
Deprecated.
|
abstract void |
freeSamResource(org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> samResource)
Free a previously allocated SAM resource.
|
public abstract org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> allocateSamResource(SamResourceManager.AllocationMode allocationMode, SamIdentifier samIdentifier)
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.
allocationMode - the blocking/non-blocking modesamIdentifier - the targeted SAM identifierCalypsoNoSamResourceAvailableException - if no resource is availableorg.eclipse.keyple.core.service.exception.KeypleReaderException - if a reader error occursorg.eclipse.keyple.core.service.exception.KeypleAllocationReaderException - if reader allocation failspublic abstract void freeSamResource(org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> samResource)
samResource - the SAM resource reference to freeprotected org.eclipse.keyple.calypso.transaction.sammanager.SamResourceManagerDefault.ManagedSamResource createSamResource(org.eclipse.keyple.core.service.Reader samReader)
Proceed with the SAM selection and combine the SAM reader and the Calypso SAM resulting from the selection.
samReader - the SAM reader with which the APDU exchanges will be done.CardResourceCalypsoNoSamResourceAvailableException - if an error occurs while doing the selection