Re: Maven and declarative services

2014-03-18 Thread Karel Haeck
I think you need: <_dsannotations>* On 18/03/2014 0:36, bokie wrote: Hi Scott, thanks for the reply. *** works nicely on the annotations in the *aQute.bnd.annotation.component* package but not on the annotations in the *org.osgi.service.component.annotations* package - no DS descr

RE: unloading a DLL from the container

2014-03-18 Thread CLEMENT Jean-Philippe
Hi, 1. As far as I know you cannot 2. Maybe GlueGen can help you (NativeLibrary) JP -Message d'origine- De : Frizz [mailto:frizzthe...@googlemail.com] Envoyé : mardi 18 mars 2014 06:35 À : users@felix.apache.org Objet : JNI: unloading a DLL from the container Hi there, I have a bundle

Re: unloading a DLL from the container

2014-03-18 Thread Frizz
I was just thinking: How to handle this in production environments? E.g. Imagine some of your bundles depend a DLL (or .so) and this DLL needs to be updated. So all you can do is replace the DLL, shutdown and restart the container? On Tue, Mar 18, 2014 at 10:06 AM, CLEMENT Jean-Philippe < jean-ph

Re: Maven and declarative services

2014-03-18 Thread bokie
Hi, thanks all for your replies. This worked: <_dsannotations>* Adding the _dsannotations instruction to *maven-bundle-plugin* worked on the annotations in the *org.osgi.service.component.annotations* package with no extra dependencies, i.e.: dependencies on org.apache.felix:org.apache

[scr] Circular references detected but not resolved if one of the references in the cycle has optional cardinality

2014-03-18 Thread Victor Antonovich
Hello! I would like to point here to FELIX-4417 issue (https://issues.apache.org/jira/browse/FELIX-4417). For now, circular references with one optional reference aren't handled correctly by Felix SCR (BTW, Knopflerfish SCR does). Thanks, Victor --

How to use a service immediately after its activation?

2014-03-18 Thread Bertrand Delacretaz
Hi, I'd like to interact with a given service as soon as it is created, ideally before other clients use it. Is it safe to use a service in the ServiceListener.serviceChanged(ServiceReference R) method, grabbing it from R? I suppose there's no way to prioritize a given ServiceListener, but at le

Re: How to use a service immediately after its activation?

2014-03-18 Thread David Jencks
On Mar 18, 2014, at 10:49 AM, Bertrand Delacretaz wrote: > Hi, > > I'd like to interact with a given service as soon as it is created, ideally > before other clients use it. You can't guarantee that any particular request for the service from the service registry will be the first one. > >

Upgrading to Java 8 with Felix and BND

2014-03-18 Thread Christopher BROWN
Hello, I'm considering upgrading an application currently running on Felix 3.2.2 to a (much) more recent version of Felix (embedded) and continuing use of BND. I've so far done some earlier testing by building Felix from source and including mappings of beta Java 8 APIs, but without compiling Jav

Re: Upgrading to Java 8 with Felix and BND

2014-03-18 Thread Neil Bartlett
I would expect Felix to "Just Work" on the Java 8 runtime; after all, J8 is meant to be backwards compatible. Bnd will almost certainly NOT work on classes compiled for Java 8 if they use the new bytecode features. We have not done any testing with this yet but I'm sure there will be issues for us

Re: How to use a service immediately after its activation?

2014-03-18 Thread Bertrand Delacretaz
Hi, On Tue, Mar 18, 2014 at 7:24 PM, David Jencks wrote: > ...If you have a DS component with a reference to your desired service, with > a bind method, > the bind method will be called at some point when the desired service is > available, > whether the service or your component starts first..

Re: How to use a service immediately after its activation?

2014-03-18 Thread Bruce Jackson
If you really want to do that, perhaps to would be better for your service to expose 2 separate service interfaces, one which extends the other. The first (for simplicity we could refer to it as private) could cause DS activation in the component you¹re interested in, and this interaction could tri

Re: How to use a service immediately after its activation?

2014-03-18 Thread David Bosschaert
Hi Bertrand, I guess one thing you might be able to do is have a service registry hook that hides the service until you 'release' it. It would involve writing a FindHook [1] and a ListenerHook [2] that would hide the service for any other bundle than the one registering it until it calls some API

Re: How to use a service immediately after its activation?

2014-03-18 Thread David Bosschaert
oops, that first link should be: http://www.osgi.org/javadoc/r4v43/core/org/osgi/framework/hooks/service/FindHook.html On 18 March 2014 14:17, David Bosschaert wrote: > Hi Bertrand, > > I guess one thing you might be able to do is have a service registry > hook that hides the service until you 'r

Re: Upgrading to Java 8 with Felix and BND

2014-03-18 Thread Christopher BROWN
I got Felix running on the developer preview last autumn following advice on this list: http://mail-archives.apache.org/mod_mbox/felix-users/201309.mbox/%3CCAHL_zcOO23xUaPc_gCFKaw=bvbcecg_hhh2pv7ty5yld-xd...@mail.gmail.com%3E I don't know if this sort of patching is still required with the most re

Re: How to use a service immediately after its activation?

2014-03-18 Thread Neil Bartlett
The only entity who knows a "service is about to be published" is the publishing bundle. Which leads me to the conclusion that you're creating far too tight a coupling between the service publisher and consumer. Whatever you're trying to do in your special listener, wouldn't it be better done insi

Re: Upgrading to Java 8 with Felix and BND

2014-03-18 Thread Neil Bartlett
Thanks, we'd certainly be interested in bug reports against bnd. Our issue tracker is on Github: https://github.com/bndtools/bnd/issues If ASM fails on default methods then I would expect we would too. Bnd does not use ASM but it does some similar things. Regards, Neil On Tue, Mar 18, 2014 at

Re: Upgrading to Java 8 with Felix and BND

2014-03-18 Thread Mark Derricutt
ASM 5.0 is out: http://asm.ow2.org/history.html It would be great to get a release of things like maven-scr-plugin released using this, as that's one thing that's definitely broken currently when targeting JDK8 byte code. On 19 Mar 2014, at 10:28, Neil Bartlett wrote: If ASM fails on default

Re: How to use a service immediately after its activation?

2014-03-18 Thread Marcel Offermans
Hello Bertrand, On 18 Mar 2014, at 22:09 pm, Bertrand Delacretaz wrote > On Tue, Mar 18, 2014 at 7:24 PM, David Jencks wrote: >> ...If you have a DS component with a reference to your desired service, with >> a bind method, >> the bind method will be called at some point when the desired servic

Re: Upgrading to Java 8 with Felix and BND

2014-03-18 Thread Paul Bakker
Java 8 support in Bnd is high on my wish list as well, I created an issue to track further discussion and progress: https://github.com/bndtools/bnd/issues/485 Cheers, Paul On Tue, Mar 18, 2014 at 10:52 PM, Mark Derricutt wrote: > ASM 5.0 is out: http://asm.ow2.org/history.html > > It would be

Classloader exception

2014-03-18 Thread Frizz
Hi all, I load a DLL using JNI. Because I'm still in development phase, I use "dev:watch" to automatically update my bundle in the container. I understood that this results in an exception: "UnsatisfiedLinkError: Native Library xyz already loaded in another classloader" - because the DLL is alrea