summaryrefslogtreecommitdiff
path: root/java/management/eclipse-plugin
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2007-05-03 13:41:35 +0000
committerMartin Ritchie <ritchiem@apache.org>2007-05-03 13:41:35 +0000
commit49c6109ef7370409c93bc35b6a9ddf58e6fca465 (patch)
tree4e3c1d0a7ef8dcb518de078244f946230bfbc88b /java/management/eclipse-plugin
parentb2d3708cb018e4746a1aed79d5089eea5afbb43f (diff)
downloadqpid-python-49c6109ef7370409c93bc35b6a9ddf58e6fca465.tar.gz
Merged revisions 533704-533720,533722-533763,533766-533818,533820-533839,533841-533859,533862-534112,534114-534117 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2 ........ r533704 | bhupendrab | 2007-04-30 12:37:59 +0100 (Mon, 30 Apr 2007) | 1 line Added time-out for secure server connection. ........ r534036 | ritchiem | 2007-05-01 13:28:03 +0100 (Tue, 01 May 2007) | 1 line QPID-461 Update to CommitRollbackTest. Ensuring messages received have the correct redelivered value, regardless of order. Different test case also was problematic. ........ r534117 | ritchiem | 2007-05-01 16:22:17 +0100 (Tue, 01 May 2007) | 4 lines Comments and Test changes VirtualHost Added comments HeapExhaustion - Updated to send transient messages. QpidClientConnection - Allowed specification of type of message to send. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@534856 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/management/eclipse-plugin')
-rw-r--r--java/management/eclipse-plugin/bin/qpidmc.bat2
-rwxr-xr-xjava/management/eclipse-plugin/bin/qpidmc.sh2
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java1
-rw-r--r--java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java43
4 files changed, 32 insertions, 16 deletions
diff --git a/java/management/eclipse-plugin/bin/qpidmc.bat b/java/management/eclipse-plugin/bin/qpidmc.bat
index e444bc5811..1f3207f043 100644
--- a/java/management/eclipse-plugin/bin/qpidmc.bat
+++ b/java/management/eclipse-plugin/bin/qpidmc.bat
@@ -52,4 +52,4 @@ goto exit
rem Slurp the command line arguments. This loop allows for an unlimited number
rem of agruments (up to the command line limit, anyway).
-"%JAVA_HOME%\bin\java" -Xms40m -Xmx256m -Declipse.consoleLog=false -Dsecurity=PLAIN -jar %QPIDMC_HOME%\eclipse\startup.jar org.eclipse.core.launcher.Main -launcher %QPIDMC_HOME%\eclipse\eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:%QPIDMC_HOME%\configuration" -os win32 -ws win32 -arch x86
+"%JAVA_HOME%\bin\java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar %QPIDMC_HOME%\eclipse\startup.jar org.eclipse.core.launcher.Main -launcher %QPIDMC_HOME%\eclipse\eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:%QPIDMC_HOME%\configuration" -os win32 -ws win32 -arch x86
diff --git a/java/management/eclipse-plugin/bin/qpidmc.sh b/java/management/eclipse-plugin/bin/qpidmc.sh
index aae61b14c7..2472545a14 100755
--- a/java/management/eclipse-plugin/bin/qpidmc.sh
+++ b/java/management/eclipse-plugin/bin/qpidmc.sh
@@ -61,4 +61,4 @@ elif [ $os = "Linux" ]; then
os="linux"
fi
-"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -Dsecurity=PLAIN -jar $QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher $QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:$QPIDMC_HOME/configuration" -os $os -ws $ws -arch $arch
+"$JAVA_HOME/bin/java" -Xms40m -Xmx256m -Declipse.consoleLog=false -jar $QPIDMC_HOME/eclipse/startup.jar org.eclipse.core.launcher.Main -launcher $QPIDMC_HOME/eclipse/eclipse -name "Qpid Management Console" -showsplash 600 -configuration "file:$QPIDMC_HOME/configuration" -os $os -ws $ws -arch $arch
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
index 0693a4fc93..f6eace3101 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
@@ -44,6 +44,7 @@ public abstract class ApplicationRegistry
public static final boolean debug = Boolean.getBoolean("eclipse.consoleLog");
public static final String securityMechanism = System.getProperty("security", null);
public static final String connectorClass = System.getProperty("jmxconnector");
+ public static final long timeout = Long.parseLong(System.getProperty("timeout", "5000"));
static
{
diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
index 4d4b3e87e7..f97568e275 100644
--- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
+++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
@@ -59,6 +59,7 @@ import org.apache.qpid.management.ui.sasl.UsernameHashedPasswordCallbackHandler;
public class JMXServerRegistry extends ServerRegistry
{
+ private boolean _connected = false;
private ObjectName _serverObjectName = null;
private Map<String, Object> _env = null;
private JMXServiceURL _jmxUrl = null;
@@ -98,23 +99,12 @@ public class JMXServerRegistry extends ServerRegistry
super(server);
String securityMechanism = ApplicationRegistry.getSecurityMechanism();
String connectorClassName = ApplicationRegistry.getJMXConnectorClass();
-
- boolean saslPluginAvailable = false;
if ((securityMechanism != null) && (connectorClassName != null))
{
- try
- {
- createSASLConnector(securityMechanism, connectorClassName);
- saslPluginAvailable = true;
- }
- catch (Exception ex)
- {
- MBeanUtility.printStackTrace(ex);
- }
+ createSASLConnector(securityMechanism, connectorClassName);
}
-
- if (!saslPluginAvailable)
+ else
{
_jmxUrl = new JMXServiceURL(server.getUrl());
_jmxc = JMXConnectorFactory.connect(_jmxUrl, null);
@@ -179,9 +169,34 @@ public class JMXServerRegistry extends ServerRegistry
Object theObject = cons.newInstance(args);
_jmxc = (JMXConnector)theObject;
- _jmxc.connect();
+
+ Thread connectorThread = new Thread(new ConnectorThread());
+ connectorThread.start();
+ long timeNow = System.currentTimeMillis();
+ connectorThread.join(ApplicationRegistry.timeout);
+
+ if (!_connected && (System.currentTimeMillis() - timeNow >= ApplicationRegistry.timeout))
+ {
+ throw new Exception("Qpid server connection timed out");
+ }
}
+ private class ConnectorThread implements Runnable
+ {
+ public void run()
+ {
+ try
+ {
+ _connected = false;
+ _jmxc.connect();
+ _connected = true;
+ }
+ catch (Exception ex)
+ {
+ MBeanUtility.printStackTrace(ex);
+ }
+ }
+ }
/**
* removes all listeners from the mbean server. This is required when user
* disconnects the Qpid server connection