<br><br><div class="gmail_quote">On Wed, Jun 1, 2011 at 19:29, John D. Ament <span dir="ltr">&lt;<a href="mailto:john.d.ament@gmail.com">john.d.ament@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Something I&#39;ve been thinking about for a while now is the mapping APIs used by Seam JMS.  Currently, you write an interface to define routes used by JMS events.  This requires a bit of extra code that I&#39;m not a big fan of.  What I was thinking was put an extra annotation on either the injection point of the event or the observer method.  The idea is that the annotation would include all of the destination configuration necessary.  For example:<br>


<br>@Inject @JMS(&quot;jms/QueueOne&quot;,&quot;jms/QueueTwo&quot;,&quot;jms/QueueThree&quot;) Event&lt;MyType&gt; myTypeEvent;<br><br>@JMS(&quot;jms/MyTopic&quot;)<br>public void handleMessages(@Observes Long longsInTopic) {<br>


<br>....<br><br>}<br><br>The issues I see, since essentially I have to create an extra observer/firing pair to support each of these, is how to determine the observed type in the event.  In general, any thoughts? Is it possible to determine the event&#39;s type in this case? If so, does the approach make sense?<br>

<font color="#888888">
<br>- John</font><br></blockquote></div><br>In Catch I added the qualifiers as optional arguments to the constructor of the event payload. Until an observer can get the meta info on the payload that&#39;s basically what you have to do. There may be a way to hack through it with an extension though.<br clear="all">

<br>-- <br>Jason Porter<br><a href="http://lightguard-jp.blogspot.com" target="_blank">http://lightguard-jp.blogspot.com</a><br><a href="http://twitter.com/lightguardjp" target="_blank">http://twitter.com/lightguardjp</a><br>

<br>Software Engineer<br>Open Source Advocate<br>Author of Seam Catch - Next Generation Java Exception Handling<br><br>PGP key id: 926CCFF5<br>PGP key available at: <a href="http://keyserver.net" target="_blank">keyserver.net</a>, <a href="http://pgp.mit.edu" target="_blank">pgp.mit.edu</a><br>