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 java.util.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 | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final TerminalFactory | |
| private static final String | |
| private static final String | |
| private final Provider | |
| private final TerminalFactorySpi | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static TerminalFactory | |
| public static String | |
| public static TerminalFactory | Returns: a TerminalFactory of the specified typethe type of the requested TerminalFactory type, Object the parameters to pass to the TerminalFactorySpi
implementation, or null if no parameters are needed params)Returns a TerminalFactory of the specified type that is initialized with the specified parameters. |
| public static TerminalFactory | Returns: a TerminalFactory of the specified typethe type of the requested TerminalFactory type, Object the parameters to pass to the TerminalFactorySpi
implementation, or null if no parameters are needed params, String the name of the provider provider)Returns a TerminalFactory of the specified type that is initialized with the specified parameters. |
| public static TerminalFactory | Returns: a TerminalFactory of the specified typethe type of the requested TerminalFactory type, Object the parameters to pass to the TerminalFactorySpi
implementation, or null if no parameters are needed params, Provider the provider provider)Returns a TerminalFactory of the specified type that is initialized with the specified parameters. |
| public Provider | Returns: the provider of this TerminalFactory.Returns the provider of this TerminalFactory. |
| public String | |
| public CardTerminals | Returns: a new CardTerminals object encapsulating the terminals supported by this factory.Returns a new CardTerminals object encapsulating the terminals supported by this factory. |
| public String | Returns: a string representation of this TerminalFactory.Overrides java. Returns a string representation of this TerminalFactory. |
| defaultFactory | back to summary |
|---|---|
| private static final TerminalFactory defaultFactory | |
| defaultType | back to summary |
|---|---|
| private static final String defaultType | |
| PROP_NAME | back to summary |
|---|---|
| private static final String PROP_NAME | |
| provider | back to summary |
|---|---|
| private final Provider provider | |
| spi | back to summary |
|---|---|
| private final TerminalFactorySpi spi | |
| type | back to summary |
|---|---|
| private final String type | |
| TerminalFactory | back to summary |
|---|---|
| private TerminalFactory(TerminalFactorySpi spi, Provider provider, String type) | |
| getDefault | back to summary |
|---|---|
| public static TerminalFactory getDefault() Returns the default TerminalFactory instance. See getDefaultType for more information. A default TerminalFactory is always available. However, depending on the implementation, it may not offer any terminals.
| |
| getDefaultType | back to summary |
|---|---|
| public static String getDefaultType() Get the default TerminalFactory type. It is determined as follows:
when this class is initialized, the system property
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.
| |
| getInstance | back to summary |
|---|---|
| public static TerminalFactory getInstance(String type, Object params) throws NoSuchAlgorithmException Returns a TerminalFactory of the specified type that is initialized with the specified parameters. 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 Implementation Note The JDK Reference Implementation additionally uses the
| |
| getInstance | back to summary |
|---|---|
| public static TerminalFactory getInstance(String type, Object params, String provider) throws NoSuchAlgorithmException, NoSuchProviderException Returns a TerminalFactory of the specified type that is initialized with the specified parameters. 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
| |
| getInstance | back to summary |
|---|---|
| public static TerminalFactory getInstance(String type, Object params, Provider provider) throws NoSuchAlgorithmException Returns a TerminalFactory of the specified type that is initialized with the specified parameters. 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
| |
| getProvider | back to summary |
|---|---|
| public Provider getProvider() Returns the provider of this TerminalFactory.
| |
| getType | back to summary |
|---|---|
| public String getType() Returns the type of this TerminalFactory. This is the value that was specified in the getInstance() method that returned this object.
| |
| terminals | back to summary |
|---|---|
| public CardTerminals terminals() Returns a new CardTerminals object encapsulating the terminals supported by this factory. See the class comment of the CardTerminals class regarding how the returned objects can be shared and reused.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this TerminalFactory.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final CardTerminals |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public List | list(CardTerminals.
Implements abstract javax. Returns an unmodifiable list of all terminals matching the specified state. |
| public boolean | waitForChange(long timeout)
Implements abstract javax. Waits for card insertion or removal in any of the terminals of this object or until the timeout expires. |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final CardTerminals INSTANCE | |
| NoneCardTerminals | back to summary |
|---|---|
| private NoneCardTerminals() | |
| list | back to summary |
|---|---|
| public List Implements abstract javax. Doc from javax. Returns an unmodifiable list of all terminals matching the specified state. If state is If state is
| |
| waitForChange | back to summary |
|---|---|
| public boolean waitForChange(long timeout) throws CardException Implements abstract javax. Doc from javax. Waits for card insertion or removal in any of the terminals of this object or until the timeout expires. This method examines each CardTerminal of this object.
If a card was inserted into or removed from a CardTerminal since the
previous call to If This method is often used in a loop in combination with
TerminalFactory factory = ...;
CardTerminals terminals = factory.terminals();
while (true) {
for (CardTerminal terminal : terminals.list(CARD_INSERTION)) {
// examine Card in terminal, return if it matches
}
terminals.waitForChange();
}
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final TerminalFactorySpi |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| protected CardTerminals | engineTerminals()
Implements abstract javax. Returns the CardTerminals created by this factory. |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final TerminalFactorySpi INSTANCE | |
| NoneFactorySpi | back to summary |
|---|---|
| private NoneFactorySpi() | |
| engineTerminals | back to summary |
|---|---|
| protected CardTerminals engineTerminals() Implements abstract javax. Doc from javax. Returns the CardTerminals created by this factory. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Provider | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| private |
| INSTANCE | back to summary |
|---|---|
| pack-priv static final Provider INSTANCE | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| NoneProvider | back to summary |
|---|---|
| private NoneProvider() | |