How to retrieve the consumer with declarative services? [message #631650] |
Fri, 08 October 2010 11:33 |
Roland Brand Messages: 42 Registered: July 2009 |
Member |
|
|
Hello
I am creating an RCP application which stores its data in files. The format of these files can change in every version of the application and I offer the possibility to migrate the files to a newer version. A complete migration consists of a chain of migration steps. As an example, the migration from version 1.0 to version 2.2 consists of three steps, 1.0 -> 2.0, 2.0 -> 2.1, 2.1 -> 2.2.
Currently the migration steps are declared with DS, each step is an own service. On the consumer side I have a Migrator class, which is a singleton and uses ServiceTracker to get the available MigrationSteps.
After the talk on "Best and Worst OSGi Practices" at the last EclipseCon, I'd like to get rid of the ServiceTracker. So I declared the Migrator as a DS component which uses the MigrationStep service. Now, the Migrator is created automatically and it retrieves the MigrationSteps via the bind/unbind methods.
But then I have the problem that I am not able to get the Migrator instance itself. Because it is created by DS, it is not a singleton anymore. How can I use the Migrator from my application?
Probably I missed something in the DS specification, but I'm really stuck with this and would appreciate any hint.
Roland
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04140 seconds