Package SampleCombiDevice
Class CashDrawer
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.cashdrawer.CashDrawerProperties
SampleCombiDevice.CashDrawer
- All Implemented Interfaces:
CashDrawerInterface,JposBaseInterface
Class implementing the CashDrawerInterface for the sample combi device.
-
Field Summary
Fields inherited from class de.gmxhome.conrad.jpos.jpos_base.cashdrawer.CashDrawerProperties
CapStatus, CapStatusMultiDrawerDetect, DrawerBeepVolume, DrawerOpenedFields inherited from class de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
AllowAlwaysSetProperties, AllowDeprecatedMethods, AsyncInputActive, AsyncMode, AutoDisable, CapStatisticsReporting, CapUpdateStatistics, CheckHealthText, Claimed, Claiming, ClaimWaiters, CurrentCommands, CurrentUnitID, DataCount, DataEventEnabled, DataEventList, Device, DeviceEnabled, DeviceServiceDescription, DeviceServiceVersion, DevProps, ErrorString, ErrorUnits, EventCB, EventList, EventSource, EventString, EventUnitID, EventUnits, ExclusiveAllowed, ExclusiveNo, ExclusiveUse, ExclusiveYes, FirstEnableHappened, FlagWhenIdle, FlagWhenIdleStatusValue, FreezeEvents, Index, LogicalName, MaximumConfirmationEventWaitingTime, OutputID, PowerNotify, PowerState, SerializedRequestRunner, SerializedRequests, State, StrictFIFOEventHandling, SuspendedCommands, SuspendedConcurrentCommands, UnitsOnline, UsesSubsystemUnits -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckHealth(int level)Final part of CheckHealth method.voidclose()Final part of close method.voiddeviceEnabled(boolean enable)Final part of setting DeviceEnabled.voidopen()Final part of open method.voidFinal part of OpenDrawer method.voidFinal part of WaitForDrawerClose method.Methods inherited from class de.gmxhome.conrad.jpos.jpos_base.cashdrawer.CashDrawerProperties
checkProperties, initOnOpenMethods inherited from class de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
addProperties, asyncMode, attachWaiter, autoDisable, checkForDeprecation, claim, clearDataProperties, clearErrorProperties, clearInput, clearOutput, clearOutputErrorProperties, compareFirmwareVersion, dataEventEnabled, directIO, directIO, flagWhenIdle, freezeEvents, getClaimingInstance, handlePowerStateOnEnable, initOnClaim, initOnEnable, initOnFirstEnable, newJposOutputRequest, powerNotify, release, releaseWaiter, removeFromPropertySetList, resetStatistics, retrieveStatistics, retryInput, retryOutput, signalWaiter, unitDataCount, updateFirmware, updateFirmware, updateStatistics, waitWaiterMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.gmxhome.conrad.jpos.jpos_base.JposBaseInterface
asyncMode, autoDisable, claim, clearInput, clearOutput, compareFirmwareVersion, dataEventEnabled, directIO, directIO, flagWhenIdle, freezeEvents, handlePowerStateOnEnable, newJposOutputRequest, powerNotify, release, removeFromPropertySetList, resetStatistics, retrieveStatistics, retryInput, retryOutput, unitDataCount, updateFirmware, updateFirmware, updateStatistics
-
Constructor Details
-
CashDrawer
Constructor. Gets instance of Device to be used as communication object. Device index for sample is always 0.- Parameters:
dev- Instance of Device this object belongs to.
-
-
Method Details
-
deviceEnabled
public void deviceEnabled(boolean enable) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal part of setting DeviceEnabled. Can be overwritten within derived classes. Performs initOnEnable method of corresponding property set in addition to setting DeviceEnabled. This method will be called only if the following plausibility checks lead to a positive result:- Device has not been closed,
- ExclusiveUse equals ExclusiveYes: Device is claimed,
- DeviceEnabled != enabled.
- Specified by:
deviceEnabledin interfaceJposBaseInterface- Overrides:
deviceEnabledin classJposCommonProperties- Parameters:
enable- True to enable, false to disable- Throws:
jpos.JposException- If an error occurs during enable or disable
-
open
public void open() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal part of open method. Can be overwritten in derived class, if necessary. sets State property and calls method initOnOpen of object specified by dev. This method will be called whenever the service's open method will be called. All checks, if necessary, must be implemented within the derived service implementation.- Specified by:
openin interfaceJposBaseInterface- Overrides:
openin classJposCommonProperties- Throws:
jpos.JposException- See UPOS specification, method Open
-
close
public void close() throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal part of close method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:- Device is neither enabled nor claimed.
- Specified by:
closein interfaceJposBaseInterface- Overrides:
closein classJposCommonProperties- Throws:
jpos.JposException- See UPOS specification, method Close
-
checkHealth
public void checkHealth(int level) throws jpos.JposExceptionDescription copied from interface:JposBaseInterfaceFinal part of CheckHealth method. Can be overwritten in derived class, if necessary. Keep in mind that dvice class specific checks (e.g. check of Claimed or DeviceEnabled) must be done within derived classes. This method will be called only if the following plausibility checks lead to a positive result:- Device is neither enabled nor claimed.
- Specified by:
checkHealthin interfaceJposBaseInterface- Overrides:
checkHealthin classJposCommonProperties- Parameters:
level- See UPOS specification, method CheckHealth- Throws:
jpos.JposException- See UPOS specification, method CheckHealth
-
openDrawer
public void openDrawer() throws jpos.JposExceptionDescription copied from interface:CashDrawerInterfaceFinal part of OpenDrawer method. Can be overwritten in derived class, if necessary. This method will be called only if the following plausibility checks lead to a positive result:- Device is enabled,
- Device has not been claimed by other instance.
- Specified by:
openDrawerin interfaceCashDrawerInterface- Overrides:
openDrawerin classCashDrawerProperties- Throws:
jpos.JposException- If an error occurs.
-
waitForDrawerClose
public void waitForDrawerClose() throws jpos.JposExceptionDescription copied from interface:CashDrawerInterfaceFinal part of WaitForDrawerClose method. Can be overwritten in derived class, if necessary. Since the CashDrawerService class performs beeping directly via the underlaying standardized sound system via javax.sound, the parameters beepTimeout, beepDuration, beepFrequency and beepDelay will not be forwarded to the final part.
This method will be called only if the following plausibility checks lead to a positive result:- Device is enabled,
- CapStatus is true,
- The parameters beepTimeout, beepDuration and beepDelay of the calling method are positive or FOREVER,
- The parameter beepFrequency is between 10 and 24000.
Keep also in mind that the beep duration should be at least 1/8 seconds (125 milliseconds) to ensure that it can be heard, values above 1/4 second (250 milliseconds) are recommended.- Specified by:
waitForDrawerClosein interfaceCashDrawerInterface- Overrides:
waitForDrawerClosein classCashDrawerProperties- Throws:
jpos.JposException- If an error occurs.
-