Remote Management with JavaPOS using MBeans
Overview
JavaPOS supports remote management using jmx and MBeans. A subset of information from the Information, Health and Statistics commands are used to populate an MBean for use with Jconsole or some other jmx capable viewer. The following page describes the Datalogic JavaPOS MBean and the use of JavaPOS using MBeans as well as a technical reference to the exact properties that are covered in the ScannerScale MBean.
It is important to note that the JavaPOS support for Remote management is a capability rather than a feature. The POS developer is expected to repopulate the MBean or update the values when new values expect to be displayed or updated. The only time that the JavaPOS API updates the MBean is during claim. No other updates are performed at any time. Developers are encouraged to place their own update routines into their POS software to expand the functionality of MBeans tailored to their specific use case.
Configuration
This section covers the configuration areas that are related to MBeans support on JavaPOS.
System Properties
com.sun.management.jmxremote
JavaPOS Configuration
dls.properties Settings
Datalogic JavaPOS performs API-wide configuration using a file named “dls.properties”, located in the root directory of where the POS application is launched.
GenerateStatisticsOnEveryClaim
In order for Datalogic JavaPOS to update the MBean instance, the dls.properties property “GenerateStatisticsOnEveryClaim” must be set to “True”. Setting this property to any other value than “True” will result in the statistics being generated only during the initial claim of the device and then not generated on subsequent claim operations. Setting this property to “True” will result in new statistics being populated from the device each time the device is claimed.
jpos.xml Settings
Datalogic JavaPOS performs device specific configuration using a file named “jpos.xml”, located in the root directory of where the POS application is launched. For a given device profile, the following properties pertain to enabling Remote Management using MBeans.
canAcceptStatisticsCmd Property
The canAcceptStatisticsCmd Property must be set to True for any device that can accept a statistics command. In order for JavaPOS to populate the MBean instance, the device in question must accept a statistics command.
sendIHSOnClaim Property
The sendIHSOnClaim Property must be set to True for any device that wishes to have Information, Health and Statistics commands sent during the claim process. In order for the MBean instance to be populated, statistics are gathered during claim.
MBeansEnabled Property
The MBeansEnabled Property must be set to True for any device that wishes to utilize remote management using jmx. Setting this property to any other value than True will result in the ScannerScale MBean not being populated and the MBean not being registered.
Programming
Applicable Classes
com.dls.jpos.service Package
ScannerScale.java
This is the generic implementation of the ScannerScaleMBean interface. This class is meant to provide very basic MBeans compatible information gathered during claim. The MBean is populated using a Hashtable that is provided to the populate method. The keys in this Hashtable must correspond to the Constant values listed in the table at the end of this document in order to populate the MBean.
The ScannerScale instance is only ever populated once, during claim. The ScannerScale class is instantiated and then the statistics Hashtable gathered during claim is passed to the populate method. No other updates to the MBean are performed.
ScannerScaleMBean.java
This is the MBean interface definition for the ScannerScale JavaPOS MBean. POS Developers are encouraged to implement their own implementation of the interface rather than relying on the simple implementation provided in ScannerScale.java.
ScannerScaleAgent.java
This class encapsulates the registration process with an MBeans capable service. This class is provided as a simple implementation of MBeans for developers who do not wish or do not need to access a full service MBeans implementation. POS developers are encouraged to develop their own MBeans agent to suit their particular needs.
This agent iteration registers with the platform MBean server as “CIMV2:name=Scanner” or “CIMV2:name=Scale” depending on the applicable device. Custom registration, or using names other than “Scanner” or “Scale” require replacing this class with an appropriate agent class.
Reference
ScannerScale MBean
Access Methods
getApplicationRevisionLevel()
Populated from statistics during claim using the DLSJposConst.DLS_S_APPLICATION_REVISION tag. Appears as “ApplicationRevisionLevel”.
getBootloaderROMID()
Populated from statistics during claim using the DLSJposConst.DLS_S_SCANNER_BOOT_ROM_ID tag. Appears as “BootloaderROMID”.
getBus()
Populated from statistics during jpos.xml loading using the DLSJposConst.DLS_S_INTERFACE tag. Appears as “Bus”.
getCameraHealth()
Populated from statistics during claim using the DLSJposConst.DLS_S_CAMERA_HEALTH tag. Appears as “CameraHealth”.
getCapCompareFirmwareVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_CAP_COMP_FW_VER tag. Appears as “CapCompareFirmwareVersion”.
getCapPowerReporting()
Populated from statistics during claim using the DLSJposConst.DLS_S_CAP_PWR_REPORT tag. Appears as “CapPowerReporting”.
getCapStatisticsReporting()
Populated from statistics during claim using the DLSJposConst.DLS_S_CAP_STATS_REPORT tag. Appears as “CapStatisticsReporting”.
getCapUpdateFirmware()
Populated from statistics during claim using the DLSJposConst.DLS_S_CAP_UPDATE_FW tag. Appears as “CapUpdateFirmware”.
getCapUpdateStatistics()
Populated from statistics during claim using the DLSJposConst.DLS_S_CAP_UPDATE_STATS tag. Appears as “CapUpdateStatistics”.
getCaption()
Populated by assigning the branded manufacturer name from the brand.properties after claim. Appears as “Caption”.
getCommunicationErrorCount()
Populated from statistics during claim using the DLSJposConst.DLS_S_COMM_ERROR_COUNT tag. Appears as “CommunicationErrorCount”.
getConfigurationFileID()
Populated from statistics during claim using the DLSJposConst.DLS_S_SCANNER_CONFIG_FILE_ID tag. Appears as “ConfigurationFileID”.
getDescription()
Populated by appending “ Device” to the branded manufacturer name from the brand.properties after claim. Appears as “Description”.
getDeviceCategory()
Populated from statistics during claim using the DLSJposConst.DLS_S_DEVICE_CATEGORY tag. Appears as “DeviceCategory”.
getDeviceControlVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_CONTROL_VERSION tag. Appears as “DeviceControlVersion”.
getDeviceID()
Populated from statistics during claim using the DLSJposConst.DLS_S_SERIAL_NUMBER tag. Appears as “DeviceID”.
getDeviceServiceVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_SERVICE_VERSION tag. Appears as “DeviceServiceVersion”.
getEASDeactivateCount()
Populated from statistics during claim using the DLSJposConst.DLS_S_EAS_DEACTIVATED tag. Appears as “EASDeactivatedCount”.
getEASManualCount()
Populated from statistics during claim using the DLSJposConst.DLS_S_EAS_MANUAL tag. Appears as “EASManualCount”.
getEASRuntimeFaults()
Populated from statistics during claim using the DLSJposConst.DLS_S_EAS_RT_FAULTS tag. Appears as “EASRuntimeFaults”.
getEASSystemHealth()
Populated from statistics during claim using the DLSJposConst.DLS_S_EAS_HEALTH tag. Appears as “EASSystemHealth”.
getEnforcedZeroEvents()
Populated from statistics during claim using the DLSJposConst.DLS_S_ENFORCE_ZERO_EVENTS tag. Appears as “EnforcedZeroEvents”.
getErrorResets()
Populated from statistics during claim using the DLSJposConst.DLS_S_ERROR_RESETS tag. Appears as “ErrorResets”.
getFPGAVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_FPGA_VERSION tag. Appears as “FPGAVersion”.
getFirmwareRevision()
Populated from statistics during claim using the DLSJposConst.DLS_S_FIRMWARE_VERSION tag. Appears as “FirmwareRevision”.
getForced2DResets()
Populated from statistics during claim using the DLSJposConst.DLS_S_2D_FORCED_RESETS tag. Appears as “Forced2DResets”.
getGoodScanCount() Obsolete
The getGoodScanCount method always returns a value of “”. The code to populate this member was removed to prevent confusion. The JavaPOS Mbean is only ever populated during claim, so users were being confused by this attribute not updating as they scanned labels. At present, “Good Scan Count” is not updated, but is still an accessible member of the MBean.
getGoodWeightReadCount()
Populated from statistics during claim using the DLSJposConst.DLS_S_GOOD_WEIGHT_READ_COUNT tag. Appears as “GoodWeightReadCount”.
getHorizontalIPEForcedResets()
Populated from statistics during claim using the DLSJposConst.DLS_S_HORZ_IPE_FORCED_RESETS tag. Appears as “HorizontalIPEForcedResets”.
getHorizontalLaserHealth()
Populated from statistics during claim using the DLSJposConst.DLS_S_H_LASER_HEALTH tag. Appears as “HorizontalLaserHealth”.
getHoursPoweredCount()
Populated from statistics during claim using the DLSJposConst.DLS_S_HOURS_POWERED_COUNT tag. Appears as “HoursPoweredCount”.
getIPE0Health()
Populated from statistics during claim using the DLSJposConst.DLS_S_IPE_0_HEALTH tag. Appears as “IPE0Health”.
getIPE1Health()
Populated from statistics during claim using the DLSJposConst.DLS_S_IPE_1_HEALTH tag. Appears as “IPE1Health”.
getIPE2Health()
Populated from statistics during claim using the DLSJposConst.DLS_S_IPE_2_HEALTH tag. Appears as “IPE2Health”.
getIPE3Health()
Populated from statistics during claim using the DLSJposConst.DLS_S_IPE_3_HEALTH tag. Appears as “IPE3Health”.
getIPEAppVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_IPE_APP_VERSION tag. Appears as “IPEAppVersion”.
getInstallDate()
Populated from statistics during claim using the DLSJposConst.DLS_S_INSTALL_DATE tag. Appears as “InstallDate”.
getLaserOnTime()
Populated from statistics during claim using the DLSJposConst.DLS_S_LASER_TIME tag. Appears as “LaserOnTime”.
getManufactureDate()
Populated from statistics during claim using the DLSJposConst.DLS_S_MANUFACTURE_DATE tag. Appears as “ManufactureDate”.
getManufacturerName()
Populated by assigning the branded manufacturer name from the brand.properties after claim. Appears as “ManufacturerName”.
getMechanicalRevision()
Populated from statistics during claim using the DLSJposConst.DLS_S_SCANNER_REVISION tag. Appears as “MechanicalRevision”.
getModelName()
Populated from statistics during claim using the DLSJposConst.DLS_S_MODEL_NAME tag. Appears as “ModelName”.
getMotorHealth()
Populated from statistics during claim using the DLSJposConst.DLS_S_MOTOR_HEALTH tag. Appear as “MotorHealth”.
getMotorOnTime()
Populated from statistics during claim using the DLSJposConst.DLS_S_MOTOR_TIME tag. Appears as “MotorOnTime”.
getPOSZeroRequests()
Populated from statistics during claim using the DLSJposConst.DLS_S_POS_ZERO_REQUESTS tag. Appears as “POSZeroRequests”.
getPhysicalDeviceDescription()
Populated by appending “ Device” to the branded manufacturer name from the brand.properties after claim. Appears as “PhysicalDeviceDescription”.
getPhysicalDeviceName()
Populated by appending “ Device” to the branded manufacturer name from the brand.properties after claim. Appears as “PhysicalDeviceName”.
getPowerNotify()
Populated from statistics by comparing the string value in statistics stored using the DLSJposConst.DLS_S_POWER_NOTIFY tag to the constant string “JPOS_PN_ENABLED”. Assigns JposConst.JPOS_PN_ENABLED if the string matches or JposConst.JPOS_PN_DISABLED if the string does not match. Appears as “PowerNotify”.
getPowerState()
This field is not populated from statistics and is not directly populated in any way. It does not appear to be supported and appears most likely for backward compatibility purposes. The field is able to be populated and would work correctly if used by a developer, however, no population of values is done during claim or any other time.
getSDRAMCfgVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_SDRAM_CFG_VERSION tag. Appears as “SDRAMCfgVersion”.
getScaleSentryEvents()
Populated from statistics during claim using the DLSJposConst.DLS_S_SCALE_SENTRY_EVENTS tag. Appears as “ScaleSentryEvents”.
getScaleSentryHealth()
Populated from statistics during claim using the DLSJposConst.DLS_S_SCALE_SENTRY_HEALTH tag. Appears as “ScaleSentryHealth”.
getScannerRevision()
Populated from statistics during claim using the DLSJposConst.DLS_S_SCANNER_BOARD_SERIAL tag. Appears as “ScannerRevision”
getSerialNumber()
Populated from statistics during claim using the DLSJposConst.DLS_S_SERIAL_NUMBER tag. Appears as “SerialNumber”.
getTDRForcedResets()
Populated from statistics during claim using the DLSJposConst.DLS_S_TDR_FORCED_RESETS tag. Appears as “TDRForcedResets”.
getTotalResets()
Populated from statistics during claim using the DLSJposConst.DLS_S_TOTAL_RESETS tag. Appears as “TotalResets”.
getUSBHandheldConnected()
Populated from statistics during claim using the DLSJposConst.DLS_S_NUM_ATTACHED_DEVICES tag. Appears as “USBHandheldConnected”.
getUSBLoaderVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_USB_LOADER_VERSION tag. Appears as “USBLoaderVersion”.
getUSBSerialDongleConnected()
Populated from statistics during claim using the DLSJposConst.DLS_S_USB_SERIAL_CONNECTED tag. Appears as “USBSerialDongleConnected”.
getUnifiedPOSVersion()
getUniversalInterfaceApplicationROMID() Populated from statistics during claim using the DLSJposConst.DLS_S_UNIVERSAL_ROM_ID tag. Appears as “UniversalInterfaceApplicationROMID”.
getUniversalInterfaceBootloaderROMID()
Populated from statistics during claim using the DLSJposConst.DLS_S_UNIVERSAL_BOOT_ROM_ID tag. Appears as “UniversalInterfaceBootloaderROMID”.
getVerticalIPEForcedResets()
Populated from statistics during claim using the DLSJposConst.DLS_S_VERT_IPE_FORCED_RESETS tag. Appears as “VerticalIPEForcedResets”.
getVerticalLaserHealth()
Populated from statistics during claim using the DLSJposConst.DLS_S_V_LASER_HEALTH tag. Appears as “VerticalLaserHealth”.
getVirtualScanLineLibraryVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_VSL_VERSION tag. Appears as “VirtualScanLineLibraryVersion”.
getVisionLibraryVersion()
Populated from statistics during claim using the DLSJposConst.DLS_S_VL_VERSION tag. Appears as “VisionLibaryVersion”.
Attribute Table
The following is a table denoting the mapping between jmx Attribute name, DLSJPosConst constant name for developers, the actual value of that DLSJposConst constant and finally, the name of the MBean method defined in the ScannerScaleMBean interface that accesses each attribute.
The ScannerScale MBean is populated during claim by copying values from a Hashtable into the MBean member variables. The Hashtable is a simple key/value mapping between the names denoted in the "Constant Value" column and their values as supplied by the device. This Hashtable is used to update the statistics by supplying it as a parameter to the populate() method. Once populated, the item will be visible in Jconsole or other viewer as the Attribute named in the corresponding "MBean Attribute" column and is accessible using the method named in the corresponding "MBean accessor" column. The constant value for the applicable key name is listed in the corresponding "DLSJposConst constant" column.
MBean Attribute | DLSJposConst constant | Constant Value | MBean accessor |
---|---|---|---|
ApplicationRevisionLevel | DLSJposConst.DLS_S_APPLICATION_REVISION | ApplicationRevisionLevel | getApplicationRevisionLevel() |
BootloaderROMID | DLSJposConst.DLS_S_SCANNER_BOOT_ROM_ID | ScannerBootROMID | getBootloaderROMID() |
Bus | DLSJposConst.DLS_S_INTERFACE | Interface | getBus() |
CameraHealth | DLSJposConst.DLS_S_CAMERA_HEALTH | CameraHealth | getCameraHealth() |
CapCompareFirmwareVersion | DLSJposConst.DLS_S_CAP_COMP_FW_VER | CapCompareFirmwareVersion | getCapCompareFirmwareVersion() |
CapPowerReporting | DLSJposConst.DLS_S_CAP_PWR_REPORT | CapPowerReporting | getCapPowerReporting() |
CapStatisticsReporting | DLSJposConst.DLS_S_CAP_STATS_REPORT | CapStatisticsReporting | getCapStatisticsReporting() |
CapUpdateFirmware | DLSJposConst.DLS_S_CAP_UPDATE_FW | CapUpdateFirmware | getCapUpdateFirmware() |
CapUpdateStatistics | DLSJposConst.DLS_S_CAP_UPDATE_STATS | CapUpdateStatistics | getCapUpdateStatistics() |
CommunicationErrorCount | DLSJposConst.DLS_S_COMM_ERROR_COUNT | CommunicationErrorCount | getCommunicationErrorCount() |
ConfigurationFileID | DLSJposConst.DLS_S_SCANNER_CONFIG_FILE_ID | ConfigFileVersionNumber | getConfigurationFileID() |
DeviceCategory | DLSJposConst.DLS_S_DEVICE_CATEGORY | DeviceCategory | getDeviceCategory() |
DeviceControlVersion | DLSJposConst.DLS_S_CONTROL_VERSION | ControlVersion | getDeviceControlVersion() |
DeviceID | DLSJposConst.DLS_S_SERIAL_NUMBER | SerialNumber | getDeviceID() |
DeviceServiceVersion | DLSJposConst.DLS_S_SERVICE_VERSION | ServiceVersion | getDeviceServiceVersion() |
EASDeactivatedCount | DLSJposConst.DLS_S_EAS_DEACTIVATED | EASDeactivations | getEASDeactivatedCount() |
EASManualCount | DLSJposConst.DLS_S_EAS_MANUAL | EASManualPresses | getEASManualCount() |
EASRuntimeFaults | DLSJposConst.DLS_S_EAS_RT_FAULTS | EASRuntimeFaults | getEASRuntimeFaults() |
EASSystemHealth | DLSJposConst.DLS_S_EAS_HEALTH | EASHealth | getEASSystemHealth() |
EnforcedZeroEvents | DLSJposConst.DLS_S_ENFORCE_ZERO_EVENTS | EnforcedZeroEvents | getEnforcedZeroEvents() |
ErrorResets | DLSJposConst.DLS_S_ERROR_RESETS | ErrorResets | getErrorResets() |
FirmwareRevision | DLSJposConst.DLS_S_FIRMWARE_VERSION | FirmwareVersionNumber | getFirmwareRevision() |
Forced2DResets | DLSJposConst.DLS_S_2D_FORCED_RESETS | Forced2DResets | getForced2DResets() |
FPGAVersion | DLSJposConst.DLS_S_FPGA_VERSION | FPGAVersion | getFPGAVersion() |
GoodWeightReadCount | DLSJposConst.DLS_S_GOOD_WEIGHT_READ_COUNT | GoodWeightReadCount | getGoodWeightReadCount() |
HorizontalIPEForcedResets | DLSJposConst.DLS_S_HORZ_IPE_FORCED_RESETS | HorizontalIPEForcedResets | getHorizontalIPEForcedResets() |
HorizontalLaserHealth | DLSJposConst.DLS_S_H_LASER_HEALTH | HorizontalLaserHealth | getHorizontalLaserHealth() |
HoursPoweredCount | DLSJposConst.DLS_S_HOURS_POWERED_COUNT | HoursPoweredCount | getHoursPoweredCount() |
InstallDate | DLSJposConst.DLS_S_INSTALL_DATE | InstallDate | getInstallDate() |
IPE0Health | DLSJposConst.DLS_S_IPE_0_HEALTH | IPE0Health | getIPE0Health() |
IPE1Health | DLSJposConst.DLS_S_IPE_1_HEALTH | IPE1Health | getIPE1Health() |
IPE2Health | DLSJposConst.DLS_S_IPE_2_HEALTH | IPE2Health | getIPE2Health() |
IPE3Health | DLSJposConst.DLS_S_IPE_3_HEALTH | IPE3Health | getIPE3Health() |
IPEAppVersion | DLSJposConst.DLS_S_IPE_APP_VERSION | IPEAppVersion | getIPEAppVersion() |
LaserOnTime | DLSJposConst.DLS_S_LASER_TIME | LaserTime | getLaserOnTime() |
ManufactureDate | DLSJposConst.DLS_S_MANUFACTURE_DATE | ManufactureDate | getManufactureDate() |
MechanicalRevision | DLSJposConst.DLS_S_SCANNER_REVISION | ScannerRevisionNumber | getMechanicalRevision() |
ModelName | DLSJposConst.DLS_S_MODEL_NAME | ModelNumber | getModelName() |
MotorHealth | DLSJposConst.DLS_S_MOTOR_HEALTH | MotorHealth | getMotorHealth() |
MotorOnTime | DLSJposConst.DLS_S_MOTOR_TIME | MotorTime | getMotorOnTime() |
POSZeroRequests | DLSJposConst.DLS_S_POS_ZERO_REQUESTS | POSZeroRequests | getPOSZeroRequests() |
PowerNotify | DLSJposConst.DLS_S_POWER_NOTIFY | PowerNotify | getPowerNotify() |
ScaleSentryEvents | DLSJposConst.DLS_S_SCALE_SENTRY_EVENTS | ScaleSentryEvents | getScaleSentryEvents() |
ScaleSentryHealth | DLSJposConst.DLS_S_SCALE_SENTRY_HEALTH | ScaleSentryHealth | getScaleSentryHealth() |
ScannerRevision | DLSJposConst.DLS_S_SCANNER_BOARD_SERIAL | ScannerBoardSerialNumber | getScannerRevision() |
SDRAMCfgVersion | DLSJposConst.DLS_S_SDRAM_CFG_VERSION | SDRAMCfgVersion | getSDRAMCfgVersion() |
SerialNumber | DLSJposConst.DLS_S_SERIAL_NUMBER | SerialNumber | getSerialNumber() |
TDRForcedResets | DLSJposConst.DLS_S_TDR_FORCED_RESETS | TDRForcedResets | getTDRForcedResets() |
TotalResets | DLSJposConst.DLS_S_TOTAL_RESETS | TotalResets | getTotalResets() |
UniversalInterfaceApplicationROMID | DLSJposConst.DLS_S_UNIVERSAL_ROM_ID | CometROMID | getUniversalInterfaceApplicationROMID() |
UniversalInterfaceBootloaderROMID | DLSJposConst.DLS_S_UNIVERSAL_BOOT_ROM_ID | CometBootROMID | getUniversalInterfaceBootloaderROMID() |
USBHandheldConnected | DLSJposConst.DLS_S_NUM_ATTACHED_DEVICES | NumberOfAttachedDevices | getUSBHandheldConnected() |
USBLoaderVersion | DLSJposConst.DLS_S_USB_LOADER_VERSION | USBLoaderVersion | getUSBLoaderVersion() |
USBSerialDongleConnected | DLSJposConst.DLS_S_USB_SERIAL_CONNECTED | USBSerialDongleConnected | getUSBSerialDongleConnected() |
VerticalIPEForcedResets | DLSJposConst.DLS_S_VERT_IPE_FORCED_RESETS | VerticalIPEForcedResets | getVerticalIPEForcedResets() |
VerticalLaserHealth | DLSJposConst.DLS_S_V_LASER_HEALTH | VerticalLaserHealth | getVerticalLaserHealth() |
VirtualScanLineLibraryVersion | DLSJposConst.DLS_S_VSL_VERSION | VirtualScanLineLibraryVersion | getVirtualScanLineLibraryVersion |
VisionLibraryVersion | DLSJposConst.DLS_S_VL_VERSION | VisionLibraryVersion | getVisionLibraryVersion() |