Today I finished the SimpleConsumer plug-in that bugged me last week and so, there now exists a full suite of plug-ins that shows how Discovery is meant to work. Simply download the sources (you'll probably want to use the J9 6.0 JRE. We're using it for compatibility with Provisioning), and start the Discovery, SimpleFinder, and SimpleConsumer bundles as OSGi services (and probably in that order, too :-) ). On the console, you should see a message saying that a certain string has been found. Wala! It works.
Of course, its not very interesting right now but its what's behind the scenes that's really groovy. Discovery, when started, waits until Finder services are started and then it makes a note of them and what programs they can find. Then, when a Consumer is registered, it requests a ServiceDiscovery service that was started by the Discovery bundle; the ServiceDiscovery then allows the Consumer to query for programs that have been found. A tad over-engineered? Sure sounds like it, but this architecture allows all Finders and Consumers and Discovery itself to come and go as they please while the system as a whole keeps working. As usual, thanks to Markus and Remy for pointing me in the right direction at our weekend meeting.
In other news, I went to Halo again on Saturday and, miracle of miracles, four ladies started dancing with me unbidden. Yes, F-O-U-R. At once. That made for another interesting night, and pushed Halo up in my ranking of best places to hang out.
Can you guess what I'll be doing tonight...you guessed right!