On 10 Apr 2010, at 19:15, Jordan Ganoff wrote:
On Fri, Apr 9, 2010 at 5:09 AM, Pete Muir <pmuir(a)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.
Yes, this seems like a good approach.
The other issue is that I would like to be able to support programmatic lookup via
Instance.select(...). That requires the annotations be qualifiers.
Yes. If you want to support dynamic selection via Instance itself, it does. However you
can still do dynamic selection without this facility by providing your own API for doing
dynamic selection (which IMO is a much cleaner approach)... So inject some sort of
TopicSelector with a select() method which can take a topic annotation.
WDYT?