Regarding OSGI Device Access?
Hello All,
I need help.
Let us say, I have a PrinterBundle, which creates a "PrinterDevice" (OSGI Device service).. and I have another bundle "A", which has ADriver (interested in "PrinterDevice" for match) and it registers an OSGI Service "PrinterImpl" on its attach method.
When Bundle A is installed/started in the framework, it registers the ADriver (OSGI Driver service).
PrinterBundle gets started and creates a "PrinterDevice" , as soon as a new "Printer" is added to the network.
Now, when a "Printer" is connected to the network, a "PrinterDevice" is created, which lets the OSGI DeviceManager look for all "Drivers" and call its match method.
My ADriver.match() is successful for the "PrinterDevice" and so ADriver.attach() is called, which does its own thing..
Question 1: If my Driver is registered before my Device is created, then all this works fine. However, If I register a Driver , after a "PrinterDevice" (meaning a Device was already created and DeviceManager at that time , had no Drivers to call upon), then it misses the Device (meaning, the Device is there idle, not attached to anyone).
How to solve this problem.?
Question 2: Also a Note: When I read the spec, I came across this description for "Driver Registration"...
When a new driver is registered, algorithm 5.1 (discovery) must be applied to each idle device. This gives the new driver a chance to compete with other drivers for attaching to the idle devices.
Is this true?...
Generally, If I have a Driver registered after the Device are created, will the Device Manager, recognize the new Drivers and pick up the Devices and go thru a discovery cycle?
I guess, there might be a simple way to ask this question..? Anyway, If you can make out my questions, please provide me with you answer.?
I appreciate your anwer.
Thanks
Kumaran

