<p>These properties are explained in the Java 5 <ahref="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#remote">Management guide</a>
(please note that for this example, we will disable user authentication for simplicity).</p>
<p>With these properties, HornetQ server will be manageable remotely using standard JMX URL on port <code>3000</code>.</p>
</p>
<h2>Example step-by-step</h2>
<p><em>To run the example, simply type <code>mvn verify</code> from this directory</em></p>
<ol>
<li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get its properties from <ahref="src/main/resources/hornetq/server0/client-jndi.properties">client-jndi.properties</a></li>
<code>org.apache.activemq.jms.example.SpawnedJMSServer out:11:22:33,034 WARN @RMI TCP Connection(3)-192.168.0.10 [RemotingConnectionImpl] Connection failure has been detected connections for /192.168.0.10:52707 closed by management:0
org.apache.activemq.jms.example.SpawnedJMSServer out:11:22:33,035 WARN @RMI TCP Connection(3)-192.168.0.10 [ServerSessionImpl] Client connection failed, clearing up resources for session 4646da35-2fe8-11de-9ce9-752ccc2b26e4
org.apache.activemq.jms.example.SpawnedJMSServer out:11:22:33,035 WARN @RMI TCP Connection(3)-192.168.0.10 [ServerSessionImpl] Cleared up resources for session 4646da35-2fe8-11de-9ce9-752ccc2b26e4
<li>We display the exception received by the connection's ExceptionListener</li>
<preclass="prettyprint">
<code>exception.get().printStackTrace();</code>
</pre>
<p>When the connection was closed on the server-side by the call to <code>serverControl.closeConnectionsForAddress()</code>,
the client's connection was disconnected and its exception listener was notified.</p>
<li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>