I was testing out a simple idea for another JMS injection type and ran into an issue with Instance.get() and additional select annotations.  The InjectionPoint of the producer lacked the additional selected annotations.  I&#39;m trying to create a TopicProducer and need to dynamically inject a topic.  When the topic producer is invoked the InjectionPoint does not contain the JmsDestination (the annotations are only @Inject and @Any, which seems like @Inject shouldn&#39;t be there either).  Is there a better way to do this?<div>
<br></div><div>Here&#39;s the code:</div><div><br></div><div><div><div>@Inject @Any Instance&lt;Topic&gt; anyTopic;</div><div><br></div><div>@Produces @JmsDestination</div><div>public TopicPublisher createTopicProducer(InjectionPoint ip, Session s) throws JMSException</div>
<div>{</div><div>   Topic t = anyTopic.select(ip.getAnnotated().getAnnotation(JmsDestination.class)).get();</div><div>   return TopicPublisher.class.cast(s.createProducer(t));</div><div>}</div><div><br></div><div>...</div>
<div><br></div><div>@Produces</div><div>@JmsDestination</div><div>public Topic getTopic(InjectionPoint ip, @Module Context c) throws NamingException</div><div>{</div><div>   JmsDestination d = ip.getAnnotated().getAnnotation(JmsDestination.class);</div>
<div>   return (Topic) c.lookup(d.jndiName());</div><div>}</div></div><div><br></div>Thanks in advance.</div><div><br></div><div>P.S. Actual code links:</div><div><br></div><div><a href="http://gist.github.com/359673">http://gist.github.com/359673</a></div>
<div><a href="http://gist.github.com/359673"></a><a href="http://github.com/jganoff/seam3-jms/blob/master/src/main/java/org/jboss/seam/jms/impl/inject/DestinationProducer.java">http://github.com/jganoff/seam3-jms/blob/master/src/main/java/org/jboss/seam/jms/impl/inject/DestinationProducer.java</a><br>
-- <br>Jordan Ganoff<br>
</div>