Author: bvahdat
Date: Fri Oct 5 12:29:28 2012
New Revision: 1394481
URL: http://svn.apache.org/viewvc?rev=1394481&view=rev
Log:
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.10.x/ (props changed)
camel/branches/camel-2.10.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Merged /camel/trunk:r1394479
Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
camel/branches/camel-2.10.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java?rev=1394481&r1=1394480&r2=1394481&view=diff
==============================================================================
---
camel/branches/camel-2.10.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
(original)
+++
camel/branches/camel-2.10.x/components/camel-quickfix/src/main/java/org/apache/camel/component/quickfixj/QuickfixjEngine.java
Fri Oct 5 12:29:28 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.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
URL:
http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java?rev=1394481&r1=1394480&r2=1394481&view=diff
==============================================================================
---
camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
(original)
+++
camel/branches/camel-2.10.x/components/camel-quickfix/src/test/java/org/apache/camel/component/quickfixj/QuickfixjEngineTest.java
Fri Oct 5 12:29:28 2012
@@ -383,7 +383,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);