Yes, you are on the right way.

Probably what confuse you in the code style is the use of inner classes. I will not explain that concept here (is full of docs out there), just know that in java you can implement classes inside other classes (so inner classes).

In our adapter we have:
  • DemoDataAdapter
    This is the object that implements the DataProvider interface and so comunicates with Lightstreamer kernel.
    The subscribe/unsubscribe method receives the requests to subscribe/unsubscribe (of course...) items (ie which items the various clients wants)
  • MyFeedListener
    Is an inner class. An instance of this class will be passed to the "data-generator" class ExternalFeedSimulator.
    This class receives (implementing ExternalFeedListener) updates through the onEvent and then forwards them to Lightstreamer kernel:
    Code:
    listener.update(itemName, currentValues, isSnapshot);
  • ExternalFeedSimulator
    This is the object that creates data (the generator is his inner class MyProducer). In your case this object will not generate data but will pull data from DB


HTH
Bye!