WOSA Device Service architecture

A WOSADeviceService instance represents a WOSA/XFS logical device, such as a financial printer or an ID card reader/writer.

The WOSADeviceService class interfaces with the WOSA/XFS API using JNI (Java(TM) Native Interface) to provide a subset of the WOSA/XFS functions. The native code is divided into two implementation layers: the common WOSA/XFS access code (DSEWOSA.DLL) and the specific WOSA/XFS access code for each WOSA/XFS device type (DSEWxxx.DLL). There is one specific DLL per WOSA/XFS device type. DLLs are available for financial printer and for identification card reader/writer device types.

The following diagram shows the layers that are involved in accessing a financial device from Java. The top box represents the WOSADeviceService, which is the service bean. The box immediately below it is the native code that connects the standard WOSA/XFS API to the Java methods of the bean. The rest of the boxes below show the WOSA/XFS architecture itself.

Diagram illustrating the layers that are involved in accessing a financial device from Java.

Normally, the WOSADeviceService public methods issue asynchronous WOSA/XFS commands, so the methods return immediately. Later, when the request has been completely processed, the WOSADeviceService generates a Java event and an event, indicating the effective completion of the request.

An application can instantiate many instances of the WOSADeviceService class. If an application needs to use two devices, it must instantiate one instance per device. If two Java processes need to access the same device, each one can instantiate one WOSADeviceService instance for the same device, and then they can use the lock() and unlock() methods for getting exclusive use of the device.

WOSADeviceService methods usually map to one call to the WOSA/XFS API, so programmers who are used to dealing with the original WOSA/XFS will find the working protocol very similar. All the methods return an instance of type WOSAResult, which is a simple class with the following two public integer fields: