public class SamResourceManagerDefault extends SamResourceManager
Plugin (either Stub or Pcsc) It is meant
to work with a Keyple Pcsc Plugin or a Keyple Stub Plugin.SamResourceManager.AllocationMode| Modifier and Type | Field and Description |
|---|---|
protected org.eclipse.keyple.core.service.Plugin |
samReaderPlugin
Deprecated.
|
| Modifier | Constructor and Description |
|---|---|
protected |
SamResourceManagerDefault(org.eclipse.keyple.core.service.Plugin plugin,
java.lang.String samReaderFilter,
int maxBlockingTime,
int sleepTime)
Deprecated.
Protected constructor, use the
SamResourceManagerFactory |
| Modifier and Type | Method and Description |
|---|---|
org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> |
allocateSamResource(SamResourceManager.AllocationMode allocationMode,
SamIdentifier samIdentifier)
Deprecated.
Allocate a SAM resource from the specified SAM group.
|
void |
freeSamResource(org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> samResource)
Deprecated.
Free a previously allocated SAM resource.
|
protected void |
removeResource(org.eclipse.keyple.core.service.Reader samReader)
Deprecated.
Remove a
CardResource from the current CardResource CalypsoSam> list |
createSamResourceprotected final org.eclipse.keyple.core.service.Plugin samReaderPlugin
protected SamResourceManagerDefault(org.eclipse.keyple.core.service.Plugin plugin,
java.lang.String samReaderFilter,
int maxBlockingTime,
int sleepTime)
SamResourceManagerFactoryplugin - the plugin through which SAM readers are accessiblesamReaderFilter - the regular expression defining how to identify SAM readers among
others.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 retriesorg.eclipse.keyple.core.service.exception.KeypleReaderException - thrown if an error occurs while getting the readers list.protected void removeResource(org.eclipse.keyple.core.service.Reader samReader)
CardResource from the current CardResource CalypsoSam> listsamReader - the SAM reader of the resource to remove from the list.public org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> allocateSamResource(SamResourceManager.AllocationMode allocationMode, SamIdentifier samIdentifier)
SamResourceManagerIn 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.
allocateSamResource in class SamResourceManagerallocationMode - the blocking/non-blocking modesamIdentifier - the targeted SAM identifierpublic void freeSamResource(org.eclipse.keyple.core.card.selection.CardResource<CalypsoSam> samResource)
SamResourceManagerfreeSamResource in class SamResourceManagersamResource - the SAM resource reference to free