<div dir="ltr">Hi Jeff,<div><br></div><div>Big thanks for your answer. Alternative with JNDI binding sounds good - think that might just do the trick for me here.</div><div><br></div><div>Dejan</div></div><div class="gmail_extra">

<br><br><div class="gmail_quote">On Tue, Jun 17, 2014 at 2:16 PM, Jeff Mesnil <span dir="ltr">&lt;<a href="mailto:jmesnil@redhat.com" target="_blank">jmesnil@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class=""><br>
On 17 Jun 2014, at 13:27, Dejan Kitic &lt;<a href="mailto:kdejan@gmail.com">kdejan@gmail.com</a>&gt; wrote:<br>
<br>
&gt; Hi guys,<br>
&gt;<br>
&gt; I am trying to figure out if it&#39;s possible to make HornetQ RemoteConnectionFactory available within subsystem using something like:<br>
&gt;<br>
&gt;  final CastingInjector&lt;ConnectionFactory&gt; connFactInjector = new CastingInjector&lt;ConnectionFactory&gt;(connFactInjector,<br>
&gt;                 ConnectionFactory.class);<br>
&gt; and then doing something like:<br>
&gt;<br>
&gt; ...<br>
&gt; .addDependency(ConnectionFactoryService.SERVICE_NAME, connFactInjector)<br>
&gt;<br>
&gt;<br>
&gt; within SubsystemAdd performRuntime.<br>
&gt;<br>
&gt; Above is just thinking on the subject, the actual problem would be what to put in the addDependency call for service name, and even how to specify that I need to wait for the RemoteConnectionFactory to become available.<br>


<br>
</div>Unfortunately, that will not work.<br>
<br>
You could create a dependency on the connection factory name but the service does not return the JMS ConnectionFactory as its value (long story short, HornetQ creates the object internally and does not expose it from its management API).<br>


An alternative would be to depend on the JNDI binding of the remote connection factory instead.<br>
<span class="HOEnZb"><font color="#888888"><br>
jeff<br>
<br>
<br>
--<br>
Jeff Mesnil<br>
JBoss, a division of Red Hat<br>
<a href="http://jmesnil.net/" target="_blank">http://jmesnil.net/</a><br>
<br>
</font></span></blockquote></div><br></div>