[jboss-cvs] JBoss Messaging SVN: r5475 - in trunk: tests/src/org/jboss/messaging/tests/integration/jms/management and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Dec 8 08:39:33 EST 2008
Author: jmesnil
Date: 2008-12-08 08:39:33 -0500 (Mon, 08 Dec 2008)
New Revision: 5475
Modified:
trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingServiceImpl.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java
Log:
added a InVMAcceptorFactory to the transports when starting the RemotingService if JMX is enabled.
JMX support requires a InVM acceptor to translate the JMX calls into core messages which are sent to a well-known address (doing so to preserve replication of management operations).
Enabling JMX now implies to have a proper InVM acceptor ready to use.
The acceptor is only added if there is not already an InVM acceptor in the transports configured by the user
Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingServiceImpl.java 2008-12-08 13:03:12 UTC (rev 5474)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingServiceImpl.java 2008-12-08 13:39:33 UTC (rev 5475)
@@ -30,6 +30,7 @@
import org.jboss.messaging.core.remoting.Interceptor;
import org.jboss.messaging.core.remoting.RemotingConnection;
import org.jboss.messaging.core.remoting.RemotingService;
+import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.spi.Acceptor;
import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
import org.jboss.messaging.core.remoting.spi.BufferHandler;
@@ -71,11 +72,14 @@
private final long connectionTTL;
+ private final boolean jmxEnabled;
+
private final BufferHandler bufferHandler = new DelegatingBufferHandler();
private volatile boolean backup;
private volatile MessagingServer server;
+
// Static --------------------------------------------------------
@@ -103,7 +107,9 @@
connectionTTL = config.getConnectionTTLOverride();
- backup = config.isBackup();
+ backup = config.isBackup();
+
+ jmxEnabled= config.isJMXManagementEnabled();
}
// RemotingService implementation -------------------------------
@@ -114,7 +120,26 @@
{
return;
}
+
+ // when JMX is enabled, it requires a INVM acceptor to send the core messages
+ // corresponding to the JMX management operations (@see ReplicationAwareStandardMBeanWrapper)
+ if (jmxEnabled)
+ {
+ boolean invmAcceptorConfigured = false;
+ for (TransportConfiguration config : transportConfigs)
+ {
+ if (InVMAcceptorFactory.class.getName().equals(config.getFactoryClassName()))
+ {
+ invmAcceptorConfigured = true;
+ }
+ }
+ if (!invmAcceptorConfigured)
+ {
+ transportConfigs.add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
+ }
+ }
+
ClassLoader loader = Thread.currentThread().getContextClassLoader();
for (TransportConfiguration info : transportConfigs)
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java 2008-12-08 13:03:12 UTC (rev 5474)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/management/JMSServerControlTest.java 2008-12-08 13:39:33 UTC (rev 5475)
@@ -97,7 +97,6 @@
conf.setSecurityEnabled(false);
conf.setJMXManagementEnabled(true);
conf.getAcceptorConfigurations().add(new TransportConfiguration(acceptorFactory));
- conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
MessagingService service = MessagingServiceImpl.newNullStorageMessagingServer(conf);
service.start();
More information about the jboss-cvs-commits
mailing list