[seam-dev] JMS Resource Injection

Jordan Ganoff jganoff at gmail.com
Sat Apr 10 14:15:52 EDT 2010


On Fri, Apr 9, 2010 at 5:09 AM, Pete Muir <pmuir at redhat.com> wrote:

> Hi Jordan,
>
> I don't quite understand what you are doing, but I do wonder why you are
> making the topic definition a qualifier at all. IMO it is simpler to just
> treat the topic annotation a normal annotation, meta annotated with
> @JmsDestination. You can then use the injection point metadata to query the
> annotation and find out the destination name.
>
> WDYT?
>

That's a much cleaner way to handle it.  The reason I went with qualifiers
is to require them on all injection points that had to look up a topic or
queue (injection of Topic, Queue, MessageProducer/MessageConsumer).  That
way it was clear which destination was being used and from where instead of
inferring the name from the InjectionPoint.Annotated.  I suppose observing
ProcessInjectionTarget and adding definition errors for missing annotations
would work.

The other issue is that I would like to be able to support programmatic
lookup via Instance.select(...). That requires the annotations be
qualifiers.

Just brainstorming here... If they were qualifiers I'd need some way of
creating unique producers for each declared one.  I could dynamically create
producer beans during start up for each identified qualifier.  That seems
like it's more work than should be necessary.  If I were able to define some
sort of generic qualifier that could be used to fulfill the injection
request I wouldn't have to worry about creating beans.

--
Jordan


>
> Pete
>
> On 7 Apr 2010, at 13:30, Jordan Ganoff wrote:
>
> > All,
> >
> > I'd like some feedback on how I've implemented JMS destination injection.
>  For reference see the design notes at http://sfwk.org/Seam3/JMSModule.
> >
> > Generic destination injection is realized by decorating the
> AnnotatedTypes which define any transitive annotations of @JmsDestination.
>  The annotations are replaced with the defined @JmsDestination and a simple
> pair of producer methods handle their production (
> http://github.com/jganoff/seam3-jms/blob/master/src/main/java/org/jboss/seam/jms/impl/inject/DestinationProducer.java).
> Although this works it removes the annotations.  I'd much prefer another
> solution which leaves all annotations intact and somehow provides producers
> for each (if not already defined).
> >
> > Any thoughts on the matter would be greatly appreciated.  Am I correct in
> assuming the original annotations should be preserved?
> >
> > Code base is currently on github until the svn repo is set up:
> http://github.com/jganoff/seam3-jms
> > Relevant test cases are here:
> http://github.com/jganoff/seam3-jms/tree/master/src/test/java/org/jboss/seam/jms/test/inject/
> >
> > Thanks!
> >
> > --
> > Jordan Ganoff
> > _______________________________________________
> > seam-dev mailing list
> > seam-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/seam-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/seam-dev/attachments/20100410/a0770b1f/attachment.html 


More information about the seam-dev mailing list