Author: bvahdat Date: Fri Oct 5 12:32:20 2012 New Revision: 1394482 URL: http://svn.apache.org/viewvc?rev=1394482&view=rev Log: Merged revisions 1394481 via svnmerge from https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x
................ r1394481 | bvahdat | 2012-10-05 14:29:28 +0200 (Fr, 05 Okt 2012) | 9 lines Merged revisions 1394479 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk ........ r1394479 | bvahdat | 2012-10-05 14:25:46 +0200 (Fr, 05 Okt 2012) | 1 line CAMEL-5686: While stopping the QuickfixjEngine should unregister the MBean being registered for the Initiator at startup. ........ ................ Modified: camel/branches/camel-2.9.x/ (props changed) camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Merged /camel/trunk:r1394479 Merged /camel/branches/camel-2.10.x:r1394481 Propchange: camel/branches/camel-2.9.x/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java?rev=1394482&r1=1394481&r2=1394482&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java (original) +++ camel/branches/camel-2.9.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java Fri Oct 5 12:32:20 2012 @@ -25,6 +25,7 @@ import java.util.Set; import java.util.concurrent.CopyOnWriteArrayList; import javax.management.JMException; +import javax.management.ObjectName; import org.apache.camel.support.ServiceSupport; import org.apache.camel.util.ObjectHelper; @@ -96,6 +97,7 @@ public class QuickfixjEngine extends Ser private final MessageCorrelator messageCorrelator = new MessageCorrelator(); private List<QuickfixjEventListener> eventListeners = new CopyOnWriteArrayList<QuickfixjEventListener>(); private final String uri; + private ObjectName connectorObjectName; public enum ThreadModel { ThreadPerConnector, ThreadPerSession; @@ -200,7 +202,7 @@ public class QuickfixjEngine extends Ser if (initiator != null) { initiator.start(); if (jmxExporter != null) { - jmxExporter.register(initiator); + connectorObjectName = jmxExporter.register(initiator); } } } @@ -212,6 +214,10 @@ public class QuickfixjEngine extends Ser } if (initiator != null) { initiator.stop(); + + if (jmxExporter != null && connectorObjectName != null) { + jmxExporter.getMBeanServer().unregisterMBean(connectorObjectName); + } } } Modified: camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java?rev=1394482&r1=1394481&r2=1394482&view=diff ============================================================================== --- camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java (original) +++ camel/branches/camel-2.9.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java Fri Oct 5 12:32:20 2012 @@ -382,7 +382,6 @@ public class QuickfixjEngineTest { } @Test - @Ignore("The unit test works but we have a collision with the enableJmxForInitiator one") public void enableJmxForAcceptor() throws Exception { settings.setBool(QuickfixjEngine.SETTING_USE_JMX, true); settings.setString(sessionID, SessionFactory.SETTING_CONNECTION_TYPE, SessionFactory.ACCEPTOR_CONNECTION_TYPE);