public final class TerminalFactory extends Object
Each TerminalFactory has a type
indicating how it
was implemented. It must be specified when the implementation is obtained
using a getInstance() method and can be retrieved
via the getType() method.
The following standard type names have been defined:
PC/SC
None
None
and
getDefault() returns an instance of a None
TerminalFactory. Factories of this type cannot be obtained by calling the
getInstance()
methods.
Note:
Provider implementations that accept initialization parameters via the
getInstance()
methods are strongly
encouraged to use a Properties object as the
representation for String name-value pair based parameters whenever
possible. This allows applications to more easily interoperate with
multiple providers than if each provider used different provider
specific class as parameters.
TerminalFactory utilizes an extensible service provider framework. Service providers that wish to add a new implementation should see the TerminalFactorySpi class for more information.
CardTerminals
,
Provider
Modifier and Type | Method and Description |
---|---|
static TerminalFactory |
getDefault()
Returns the default TerminalFactory instance.
|
static String |
getDefaultType()
Get the default TerminalFactory type.
|
static TerminalFactory |
getInstance(String type,
Object params)
Returns a TerminalFactory of the specified type that is initialized
with the specified parameters.
|
static TerminalFactory |
getInstance(String type,
Object params,
Provider provider)
Returns a TerminalFactory of the specified type that is initialized
with the specified parameters.
|
static TerminalFactory |
getInstance(String type,
Object params,
String provider)
Returns a TerminalFactory of the specified type that is initialized
with the specified parameters.
|
Provider |
getProvider()
Returns the provider of this TerminalFactory.
|
String |
getType()
Returns the type of this TerminalFactory.
|
CardTerminals |
terminals()
Returns a new CardTerminals object encapsulating the terminals
supported by this factory.
|
String |
toString()
Returns a string representation of this TerminalFactory.
|
public static String getDefaultType()
It is determined as follows:
when this class is initialized, the system property
javax.smartcardio.TerminalFactory.DefaultType
is examined. If it is set, a TerminalFactory of this type is
instantiated by calling the getInstance(String,Object) method passing
null
as the value for params
. If the call
succeeds, the type becomes the default type and the factory becomes
the default factory.
If the system property is not set or the getInstance() call fails for any reason, the system defaults to an implementation specific default type and TerminalFactory.
public static TerminalFactory getDefault()
A default TerminalFactory is always available. However, depending on the implementation, it may not offer any terminals.
public static TerminalFactory getInstance(String type, Object params) throws NoSuchAlgorithmException
This method traverses the list of registered security Providers, starting with the most preferred Provider. A new TerminalFactory object encapsulating the TerminalFactorySpi implementation from the first Provider that supports the specified type is returned.
Note that the list of registered providers may be retrieved via the Security.getProviders() method.
The TerminalFactory
is initialized with the
specified parameters Object. The type of parameters
needed may vary between different types of TerminalFactory
s.
type
- the type of the requested TerminalFactoryparams
- the parameters to pass to the TerminalFactorySpi
implementation, or null if no parameters are neededNullPointerException
- if type is nullNoSuchAlgorithmException
- if no Provider supports a
TerminalFactorySpi of the specified typepublic static TerminalFactory getInstance(String type, Object params, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
A new TerminalFactory object encapsulating the TerminalFactorySpi implementation from the specified provider is returned. The specified provider must be registered in the security provider list.
Note that the list of registered providers may be retrieved via the Security.getProviders() method.
The TerminalFactory
is initialized with the
specified parameters Object. The type of parameters
needed may vary between different types of TerminalFactory
s.
type
- the type of the requested TerminalFactoryparams
- the parameters to pass to the TerminalFactorySpi
implementation, or null if no parameters are neededprovider
- the name of the providerNullPointerException
- if type is nullIllegalArgumentException
- if provider is null or the empty StringNoSuchAlgorithmException
- if a TerminalFactorySpi implementation
of the specified type is not available from the specified providerNoSuchAlgorithmException
- if no TerminalFactory of the
specified type could be foundNoSuchProviderException
- if the specified provider could not
be foundpublic static TerminalFactory getInstance(String type, Object params, Provider provider) throws NoSuchAlgorithmException
A new TerminalFactory object encapsulating the TerminalFactorySpi implementation from the specified provider object is returned. Note that the specified provider object does not have to be registered in the provider list.
The TerminalFactory
is initialized with the
specified parameters Object. The type of parameters
needed may vary between different types of TerminalFactory
s.
type
- the type of the requested TerminalFactoryparams
- the parameters to pass to the TerminalFactorySpi
implementation, or null if no parameters are neededprovider
- the providerNullPointerException
- if type is nullIllegalArgumentException
- if provider is nullNoSuchAlgorithmException
- if a TerminalFactorySpi implementation
of the specified type is not available from the specified Providerpublic Provider getProvider()
public String getType()
public CardTerminals terminals()
Copyright © 2005, 2015, Oracle and/or its affiliates. All rights reserved.