Tips from the pros?
View Single Post
06-07-09, 11:53 AM
Join Date: Mar 2007
At some point I intend to post my "test module" which does nothing more but simulate updating by having a little timer for downloads and searches, etc. This should essentially be a full-featured module that does absolutely nothing to help you out.
Until then, in this forum you'll find a sticky with the API. It runs you through the boilerplate stuff you need to set up, and then at the bottom it has your javadocs for services. What you need to do:
1. Implement an OSGi BundleActivator. This is somewhat similar to your application-style main() method. This will be called when your module is initialized. (This process is described in the sticky.)
2. Implement the services you want. I kept the naming convention the same, so that anything ending in "Service" is what you should really be looking at to implement. The rest of it is stuff that those services will need to use (such as parameters, etc.) You will probably want to start by implementing an UpdateService(). You will see enumerateItems() in there which is how you're going to identify what you're going to upload/download (and then take it from there to Uploadable or Updatable, respectively)
3. In your BundleActivator's start() method, register the services you have created. I have an example of that posted in the sticky at the top of this forum.
After you've registered with felix, Minion will be able to detect you and you will get your own tab, etc.
Hope that gets you started for now.
It's my turn next.
Shakespeare liked regexes too!
View Public Profile
Send a private message to Shirik
Find More Posts by Shirik