I'm trying to dynamically bind some services that will be used from
(dynamically generated) resources in a jersey application container.
These services are annotated @Service, but when I try to bind them into the
appropriate scope (org.glassfish.jersey.process.internal.RequestScoped),
the reify process complains that the default annotations on the class
(@Singleton, rather than @PerLookup, for some reason?) does not match the
value passed in the descriptor I tried to bind.
I want to override the default value in the class, somehow. This is
because I'm locating these things manually from a JAR and loading them in,
and I do not want to require the developer to create a separate version
that just adds @RequestScoped to every service. It should just be a
@Service - my container will "know" how to bind it to scope and determine
the correct value...
Is this possible to do? How is that default determined? Are @Service
defaulted @Singleton and that is just the way it is, and final? I could
write my own @some.other.package.Service, but that's real ugly, and still
requires code changes...
Thanks again,
-David