On 3/15/11 8:28 AM, Carsten Ziegeler wrote: > chetan mehrotra wrote >> One reason for using Inject would be that @Reference is a compile time >> annotation (i.e. RetentionPolicy.SOURCE). And due do that a new >> annotation TestReference is being used in Sling Testing component [1]. >> >> And as Inject is part of JSR 300 we can possibly have reference to >> such a class in the code. >> > As the scripting.java bundle is compiling the class, we could use the > @Reference annotation. > However, maybe this is not a good idea to use it here as well. My real reason for not wanting to use @Reference is that this isn't an SCR context and it seems confusing to use SCR annotations in a non-SCR context, which brings us to...
> > What about this crazy idea? We support the scr annotations and the > scripting.java registers a "generated" bundle which contains the scr > descriptors. This would make these services managed by scr. > But maybe that's really too crazy... I think this could be confusing. scripting.java follows the path conventions of other scripts, just with a .java extensions. This opens up the path to have a scripting.java-compiled servlet apply to a different resource type than it "should" based on the path location. So, yeah, I think too crazy... Crazy counter-proposal.... maven-scr-plugin (and friends) should support @Inject as a replacement for @Reference. Justin > > Regards > Carsten
