Skip to main content

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 AttributeDLSJposConst constantConstant ValueMBean accessor
ApplicationRevisionLevelDLSJposConst.DLS_S_APPLICATION_REVISIONApplicationRevisionLevelgetApplicationRevisionLevel()
BootloaderROMIDDLSJposConst.DLS_S_SCANNER_BOOT_ROM_IDScannerBootROMIDgetBootloaderROMID()
BusDLSJposConst.DLS_S_INTERFACEInterfacegetBus()
CameraHealthDLSJposConst.DLS_S_CAMERA_HEALTHCameraHealthgetCameraHealth()
CapCompareFirmwareVersionDLSJposConst.DLS_S_CAP_COMP_FW_VERCapCompareFirmwareVersiongetCapCompareFirmwareVersion()
CapPowerReportingDLSJposConst.DLS_S_CAP_PWR_REPORTCapPowerReportinggetCapPowerReporting()
CapStatisticsReportingDLSJposConst.DLS_S_CAP_STATS_REPORTCapStatisticsReportinggetCapStatisticsReporting()
CapUpdateFirmwareDLSJposConst.DLS_S_CAP_UPDATE_FWCapUpdateFirmwaregetCapUpdateFirmware()
CapUpdateStatisticsDLSJposConst.DLS_S_CAP_UPDATE_STATSCapUpdateStatisticsgetCapUpdateStatistics()
CommunicationErrorCountDLSJposConst.DLS_S_COMM_ERROR_COUNTCommunicationErrorCountgetCommunicationErrorCount()
ConfigurationFileIDDLSJposConst.DLS_S_SCANNER_CONFIG_FILE_IDConfigFileVersionNumbergetConfigurationFileID()
DeviceCategoryDLSJposConst.DLS_S_DEVICE_CATEGORYDeviceCategorygetDeviceCategory()
DeviceControlVersionDLSJposConst.DLS_S_CONTROL_VERSIONControlVersiongetDeviceControlVersion()
DeviceIDDLSJposConst.DLS_S_SERIAL_NUMBERSerialNumbergetDeviceID()
DeviceServiceVersionDLSJposConst.DLS_S_SERVICE_VERSIONServiceVersiongetDeviceServiceVersion()
EASDeactivatedCountDLSJposConst.DLS_S_EAS_DEACTIVATEDEASDeactivationsgetEASDeactivatedCount()
EASManualCountDLSJposConst.DLS_S_EAS_MANUALEASManualPressesgetEASManualCount()
EASRuntimeFaultsDLSJposConst.DLS_S_EAS_RT_FAULTSEASRuntimeFaultsgetEASRuntimeFaults()
EASSystemHealthDLSJposConst.DLS_S_EAS_HEALTHEASHealthgetEASSystemHealth()
EnforcedZeroEventsDLSJposConst.DLS_S_ENFORCE_ZERO_EVENTSEnforcedZeroEventsgetEnforcedZeroEvents()
ErrorResetsDLSJposConst.DLS_S_ERROR_RESETSErrorResetsgetErrorResets()
FirmwareRevisionDLSJposConst.DLS_S_FIRMWARE_VERSIONFirmwareVersionNumbergetFirmwareRevision()
Forced2DResetsDLSJposConst.DLS_S_2D_FORCED_RESETSForced2DResetsgetForced2DResets()
FPGAVersionDLSJposConst.DLS_S_FPGA_VERSIONFPGAVersiongetFPGAVersion()
GoodWeightReadCountDLSJposConst.DLS_S_GOOD_WEIGHT_READ_COUNTGoodWeightReadCountgetGoodWeightReadCount()
HorizontalIPEForcedResetsDLSJposConst.DLS_S_HORZ_IPE_FORCED_RESETSHorizontalIPEForcedResetsgetHorizontalIPEForcedResets()
HorizontalLaserHealthDLSJposConst.DLS_S_H_LASER_HEALTHHorizontalLaserHealthgetHorizontalLaserHealth()
HoursPoweredCountDLSJposConst.DLS_S_HOURS_POWERED_COUNTHoursPoweredCountgetHoursPoweredCount()
InstallDateDLSJposConst.DLS_S_INSTALL_DATEInstallDategetInstallDate()
IPE0HealthDLSJposConst.DLS_S_IPE_0_HEALTHIPE0HealthgetIPE0Health()
IPE1HealthDLSJposConst.DLS_S_IPE_1_HEALTHIPE1HealthgetIPE1Health()
IPE2HealthDLSJposConst.DLS_S_IPE_2_HEALTHIPE2HealthgetIPE2Health()
IPE3HealthDLSJposConst.DLS_S_IPE_3_HEALTHIPE3HealthgetIPE3Health()
IPEAppVersionDLSJposConst.DLS_S_IPE_APP_VERSIONIPEAppVersiongetIPEAppVersion()
LaserOnTimeDLSJposConst.DLS_S_LASER_TIMELaserTimegetLaserOnTime()
ManufactureDateDLSJposConst.DLS_S_MANUFACTURE_DATEManufactureDategetManufactureDate()
MechanicalRevisionDLSJposConst.DLS_S_SCANNER_REVISIONScannerRevisionNumbergetMechanicalRevision()
ModelNameDLSJposConst.DLS_S_MODEL_NAMEModelNumbergetModelName()
MotorHealthDLSJposConst.DLS_S_MOTOR_HEALTHMotorHealthgetMotorHealth()
MotorOnTimeDLSJposConst.DLS_S_MOTOR_TIMEMotorTimegetMotorOnTime()
POSZeroRequestsDLSJposConst.DLS_S_POS_ZERO_REQUESTSPOSZeroRequestsgetPOSZeroRequests()
PowerNotifyDLSJposConst.DLS_S_POWER_NOTIFYPowerNotifygetPowerNotify()
ScaleSentryEventsDLSJposConst.DLS_S_SCALE_SENTRY_EVENTSScaleSentryEventsgetScaleSentryEvents()
ScaleSentryHealthDLSJposConst.DLS_S_SCALE_SENTRY_HEALTHScaleSentryHealthgetScaleSentryHealth()
ScannerRevisionDLSJposConst.DLS_S_SCANNER_BOARD_SERIALScannerBoardSerialNumbergetScannerRevision()
SDRAMCfgVersionDLSJposConst.DLS_S_SDRAM_CFG_VERSIONSDRAMCfgVersiongetSDRAMCfgVersion()
SerialNumberDLSJposConst.DLS_S_SERIAL_NUMBERSerialNumbergetSerialNumber()
TDRForcedResetsDLSJposConst.DLS_S_TDR_FORCED_RESETSTDRForcedResetsgetTDRForcedResets()
TotalResetsDLSJposConst.DLS_S_TOTAL_RESETSTotalResetsgetTotalResets()
UniversalInterfaceApplicationROMIDDLSJposConst.DLS_S_UNIVERSAL_ROM_IDCometROMIDgetUniversalInterfaceApplicationROMID()
UniversalInterfaceBootloaderROMIDDLSJposConst.DLS_S_UNIVERSAL_BOOT_ROM_IDCometBootROMIDgetUniversalInterfaceBootloaderROMID()
USBHandheldConnectedDLSJposConst.DLS_S_NUM_ATTACHED_DEVICESNumberOfAttachedDevicesgetUSBHandheldConnected()
USBLoaderVersionDLSJposConst.DLS_S_USB_LOADER_VERSIONUSBLoaderVersiongetUSBLoaderVersion()
USBSerialDongleConnectedDLSJposConst.DLS_S_USB_SERIAL_CONNECTEDUSBSerialDongleConnectedgetUSBSerialDongleConnected()
VerticalIPEForcedResetsDLSJposConst.DLS_S_VERT_IPE_FORCED_RESETSVerticalIPEForcedResetsgetVerticalIPEForcedResets()
VerticalLaserHealthDLSJposConst.DLS_S_V_LASER_HEALTHVerticalLaserHealthgetVerticalLaserHealth()
VirtualScanLineLibraryVersionDLSJposConst.DLS_S_VSL_VERSIONVirtualScanLineLibraryVersiongetVirtualScanLineLibraryVersion
VisionLibraryVersionDLSJposConst.DLS_S_VL_VERSIONVisionLibraryVersiongetVisionLibraryVersion()