My sample classes:
public class MyModel implements Model
{
:
:
}
public class SingleModelProvider implements ModelProvider
{
public SingleModelProvider(Model providedModel, List actions)
{
:
}
}
The plan is to reuse the SingleModelProvider class in several bundles to provide different implementations of the ModelProvider. What I need to accomplish in each bundle is to simply instantiate the SingleModelProvider with the appropriate parameters to the constructor. A pretty simple scenario using any DI framework. I would like to register the ModelProvider services using DS (Declarative Services) if possible without having to write the boilerplate code in an Activator.
Is this possible?
I can't seem to find any documentation on how to accomplish this since the class declaration in DS does not seem to allow for constructor arguments (or setters for that matter).
Do I use a factory? I am not sure if that is worthwhile since it may make the case no simpler than using an Activator and publishing service manually.