You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2009/08/03 17:04:09 UTC
Re: Servlet registration: sling.servlet.extensions ignored with
default resource type
Alexander Klimetschek wrote:
> On Fri, Jul 31, 2009 at 11:06 AM, Vidar Ramdal<vi...@idium.no> wrote:
>> No, I used only the old-fashioned Javadoc method, but should that make
>> a difference?
>
> You are right, it should not make a difference, but the bug could only
> be in the QDox based way. With QDox, the properties are read from the
> java sources at build time and are put into the
> OSGI-INF/serviceComponents.xml file inside the bundle, which will be
> picked up by SCR when it is installed. With Java annotations the
> interpretation of the SCR annotation is done whenever the class is
> loaded (IIUC), so it's slightly different (and allows for any loaded
> class to be a service, eg. also ones where the source is in the JCR).
>
No, this is not the case with the SCR annotations. :)
We follow the DS spec and therefore do not read the annotations at
runtime. They're read by the SCR plugin during build time (again with
QDox) - as both Javadoc tags and annotations provide the same
functionality and use the same code underneath there shouldn't be any
difference. If so, this could be a bug :)
Regards
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: Servlet registration: sling.servlet.extensions ignored with
default resource type
Posted by Carsten Ziegeler <cz...@apache.org>.
Alexander Klimetschek wrote:
> On Mon, Aug 3, 2009 at 5:04 PM, Carsten Ziegeler<cz...@apache.org> wrote:
>> We follow the DS spec and therefore do not read the annotations at
>> runtime. They're read by the SCR plugin during build time (again with
>> QDox)
>
> I thought one of the main reasons for Java annotations was to support
> classes loaded from the repository. But this use case is still not
> supported, IIUC?
>
Hmm, I don't know of this use case :) The reason for annotations was
...well..to use annotations in the source code and have IDE support.
Loading services from the repository can be done of course (though I
would not suggest to do it), but that would definitly leave the OSGi DS
spec and be a proprietary stuff.
Carsten
--
Carsten Ziegeler
cziegeler@apache.org
Re: Servlet registration: sling.servlet.extensions ignored with
default resource type
Posted by Alexander Klimetschek <ak...@day.com>.
On Mon, Aug 3, 2009 at 5:04 PM, Carsten Ziegeler<cz...@apache.org> wrote:
> We follow the DS spec and therefore do not read the annotations at
> runtime. They're read by the SCR plugin during build time (again with
> QDox)
I thought one of the main reasons for Java annotations was to support
classes loaded from the repository. But this use case is still not
supported, IIUC?
Regards,
Alex
--
Alexander Klimetschek
alexander.klimetschek@day.com