Re: DM4 service factory/multiple service instance support

2016-08-24 Thread David Jencks
I’d be really amazed if this worked. I imagine that DM is quite similar to DS, and you definitely can’t do that in DS, you have to use the scope rather than trying to write your own serviceFactory or PrototypeServiceFactory. If your service is e.g. ServiceFactory that’s what you’ll get when

Re: DM4 service factory/multiple service instance support

2016-08-24 Thread Raymond Auge
I'm fairly certain that DM supports publishing services of any type and doesn't care about scoping, including implementations of PrototypeServiceFactory. Mdu, your service simply needs to implement PrototypeServiceFactory and you should be able to use the DM's imperative API as usual. But any

Re: DM4 service factory/multiple service instance support

2016-08-24 Thread mduduzik
Ray/David, Thanks for your prompt responses. I would like to accomplish this using API/Activator approach in DM4 (Felix Dependency Manager 4). Here's the context within which I would like to do this: public class Activator extends DependencyActivatorBase { @Override public void

Re: DM4 service factory/multiple service instance support

2016-08-24 Thread David Jencks
I think he wants something like DS’s prototype scope in DependencyManager 4….. I don’t know if it’s available. david jencks > On Aug 24, 2016, at 12:02 PM, Raymond Auge wrote: > > On Wed, Aug 24, 2016 at 2:17 PM, mduduzik

Re: DM4 service factory/multiple service instance support

2016-08-24 Thread Raymond Auge
On Wed, Aug 24, 2016 at 2:17 PM, mduduzik wrote: > I would like to create and new instance of component for every service > request. I believe by default a component is a singleton - i.e. the same > instance will be returned for every service consumer request. In DS/SCR,

Re: DM4 service factory/multiple service instance support

2016-08-24 Thread David Jencks
With regards to DS, I think you might be confusing factory component (where you get instances of your component by calling componentFactoryService.newInstance(…)) with prototype scope (where you can use a ServiceObjects.getService() call to obtain a new instance of the service for each call).

DM4 service factory/multiple service instance support

2016-08-24 Thread mduduzik
I would like to create and new instance of component for every service request. I believe by default a component is a singleton - i.e. the same instance will be returned for every service consumer request. In DS/SCR, this is accomplished by using a factory property in @Component declaration.

RE: LinkageError, but why?

2016-08-24 Thread Remo Liechti
Btw: @Resource(lookup = "java:app/osgi/Bundle") Bundle activatorBundle; public T getService(Class serviceInterface) { return activatorBundle.getBundleContext() .getService(activatorBundle.getBundleContext().getServiceReference(serviceInterface)); } -Original

LinkageError, but why?

2016-08-24 Thread Remo Liechti
Hi Guys As you know by now, I wrap an osgi application into a j2ee web app on Weblogic. Weblogic uses felix. I can successfully deploy the app and communicate on sockets with it, all fine. But when it comes to accessing the app using the OSGI Services, I can call a few methods. However, as