Package de.gmxhome.conrad.jpos.jpos_base
Class JposInputRequest
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
de.gmxhome.conrad.jpos.jpos_base.JposInputRequest
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
DispenseCash
,QueryContent
,ReadTags
,ReadValue
,ReadWeight
,StartHearingFree
,StartRecording
,StartVideo
,TakePhoto
Class to invoke an input method synchronously or asynchronously, depending on AsyncMode property. Does neither change
OutputID nor fires OutputCompleteEvents.
Classes that use JposInputRequests should rewrite newJposOutputRequest(), the JposOutputRequest class factory in the property set class, to return an instance of JposInputRequest instead to avoid wrong request handling.
Classes that use JposInputRequests should rewrite newJposOutputRequest(), the JposOutputRequest class factory in the property set class, to return an instance of JposInputRequest instead to avoid wrong request handling.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
JposOutputRequest.JposRequestThread
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
Abort, AdditionalData, Device, EndSync, Exception, Finished, OutputID, Props, Waiting
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateErrorEvent(jpos.JposException ex)
Factory for error events generated from JposExceptions.Factory for output complete events.void
enqueue()
Puts output request into queue of pending commands.boolean
Finishs asynchronous processing of a request.void
reactivate(boolean queries)
Reactivate only those commands that are or are not derived from JposInputRequest.Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposOutputRequest
abortCommand, abortCommand, catchedInvocation, clearAll, clearInput, clearOutput, countCommands, createIdleEvent, dequeue, enqueueSynchronous, finished, invoke, reactivate, reset, run
-
Constructor Details
-
JposInputRequest
Constructor. Stores given parameters for later use.- Parameters:
props
- Property set of device service.
-
-
Method Details
-
createErrorEvent
Description copied from class:JposOutputRequest
Factory for error events generated from JposExceptions. Must be overwritten whenever a device specific error event shall be created. For example, in case of cash printer methods, this method should return a POSPrinterErrorEvent (which is an object derived from JposErrorEvent) that contains additional values to be stored in printer properties before the event will be fired.
If a device supports result code properties instead of error events, this method must return null. The result codes should be buffered for a later call of the createIdleEvent method which must create a device specific StatusUpdateEvent which contains the buffered values.
If null will be returned instead of a JposErrorEvent, it will enforce special request handling instead:- Instead of suspending the request, it will be finished.
- The idle flag will be set.
- Overrides:
createErrorEvent
in classJposOutputRequest
- Parameters:
ex
- JposException which is the originator of an error event.- Returns:
- The resulting error event.
-
createOutputEvent
Description copied from class:JposOutputRequest
Factory for output complete events. Must be overwritten whenever a device specific output complete event shall be created.- Overrides:
createOutputEvent
in classJposOutputRequest
- Returns:
- The resulting output complete event or null if no output complete event shall be enqueued.
-
enqueue
public void enqueue() throws jpos.JposExceptionDescription copied from class:JposOutputRequest
Puts output request into queue of pending commands. If not active, a new request processor will be activated.- Overrides:
enqueue
in classJposOutputRequest
- Throws:
jpos.JposException
- if device is just in error state
-
finishAsyncProcessing
public boolean finishAsyncProcessing()Description copied from class:JposOutputRequest
Finishs asynchronous processing of a request.- Overrides:
finishAsyncProcessing
in classJposOutputRequest
- Returns:
- true if request has been processed, false if suspended.
-
reactivate
public void reactivate(boolean queries)Description copied from class:JposOutputRequest
Reactivate only those commands that are or are not derived from JposInputRequest. This default implementation expects that no request has been derived from JposInputRequest.- Overrides:
reactivate
in classJposOutputRequest
- Parameters:
queries
- If true, only JposInputRequests will be reactivated. Otherwise only all other JposOutputRequests will be reactivated.
-