Package de.gmxhome.conrad.jpos.jpos_base
Class JposDeviceFactory
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposDeviceFactory
- Direct Known Subclasses:
Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
,Factory
General part of JposDevice factory for every JPOS device using this framework. Every
device factory tries to get a JposDevice using the specified ID.
If this fails, a new object derived from JposDevice will be generated and put into a
JposDevice map using putDevice. After closing the last service based on JposBase that
holds a specific JposDevice, it uses deleteDevice to remove the JposDevice object from
the device map.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic jpos.config.JposEntry
Deprecated.static Map<String,JposDevice>
Holds all JposDevice objects currentls created. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
deleteDevice(String key)
Deletes driver implementation derived from JposDevice ou of map Devices.static JposDevice
Retrieves driver implementation derived from JposDevice.static void
putDevice(String key, JposDevice dev)
Stores driver implementation derived from JposDevice in map Devicesprotected void
validateJposConfiguration(JposCommonProperties props, JposDevice dev, JposCommonProperties[] claiming, jpos.config.JposEntry entry)
Initializes property set properties Device and Claiming and calls checkProperties method of the property set to verify correctness of jpos configuration and to initialize some corresponding values.
-
Field Details
-
Devices
Holds all JposDevice objects currentls created. The ID specified within the constructor of a JposDevice will be used as index into this map. -
CurrentEntry
Deprecated.Temporary storage for jpos entries passed to createInstance. Will be filled in checkProperties method of JposBaseDevice for later use in deprecated addDevice methods (those methods that have no JposEntry parameter).
-
-
Constructor Details
-
JposDeviceFactory
public JposDeviceFactory()
-
-
Method Details
-
validateJposConfiguration
protected void validateJposConfiguration(JposCommonProperties props, JposDevice dev, JposCommonProperties[] claiming, jpos.config.JposEntry entry) throws jpos.JposExceptionInitializes property set properties Device and Claiming and calls checkProperties method of the property set to verify correctness of jpos configuration and to initialize some corresponding values.- Parameters:
props
- Property set to be validated.dev
- Device to be used by property set.claiming
- Array containing the currently claimed device, if any.entry
- Name / Value pairs containing configuration values of the jpos.xml configuration file- Throws:
jpos.JposException
- if a value specified in entry is invalid
-
getDevice
Retrieves driver implementation derived from JposDevice.- Parameters:
key
- Key, e.g. COM port- Returns:
- JposDevice or null
-
putDevice
Stores driver implementation derived from JposDevice in map Devices- Parameters:
key
- Key, e.g. COM portdev
- JposDevice- Throws:
jpos.JposException
- if Devices contains just an entry with the given key
-
deleteDevice
Deletes driver implementation derived from JposDevice ou of map Devices. Must be done only if the JposDevice has no property set in any of its lists of lists of property set lists.- Parameters:
key
- Key, e.g. COM port- Throws:
jpos.JposException
- if Devices does not contain an entry with the given key
-