JXFS Service operation modes and events

Any J/XFS operation involving communication with a device is asynchronous. The application issues a command by calling the appropriate method in the J/XFS Device Control. If the parameters are not correct, an exception is thrown immediately, but normally the operation is issued asynchronously and an identificationID is returned. This identificationID can be used by the application to stop a running operation with the cancel method, and to identify the operation when it receives an asynchronous IntermediateEvent or OperationCompleteEvent (which contains the operation result code).

The JXFS Service works in a similar way. It uses the same identificationId, but the events are toolkit events that correspond to the J/XFS IntermediateEvent and OperationCompleteEvent events. The JXFS Service also adds synchronous methods for some functions to improve ease of application programming.

All the possible JXFS events belong to one of the classes shown in the following diagram:

Diagram of the possible classes the JXFS events can belong to.

The JXFS Services transforms these JXFS events into toolkit events (DSEEventObject class). The name attribute of the event corresponds to the JXFS event type: IntermediateEvent corresponds to JXFSIntermediateEvent, OperationCompleteEvent corresponds to JXFSOperationCompleteEvent, StatusEvent corresponds to JXFSStatusEvent, and also other event types inheriting from OperationCompleteEvent. The sourceName attribute of the event corresponds to the JXFS Service name. The application must use a handler that has registered interest in these events in order to receive them. See Implementing event notification.