Author: rob.stryker(a)jboss.com
Date: 2010-04-06 05:24:46 -0400 (Tue, 06 Apr 2010)
New Revision: 21279
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java
branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java
Log:
JBIDE-4927 - editing jmx entries
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java
===================================================================
---
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/jmx/JBossServerConnectionProvider.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -192,4 +192,7 @@
public boolean canDelete(IConnectionWrapper wrapper) {
return false;
}
+ public void connectionChanged(IConnectionWrapper connection) {
+ // do nothing
+ }
}
Modified:
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java
===================================================================
---
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/as/plugins/org.jboss.ide.eclipse.as.wtp.ui/src/org/jboss/ide/eclipse/as/wtp/ui/propertypage/NewReferenceWizard.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.ide.eclipse.as.wtp.ui.propertypage;
import java.util.List;
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java
===================================================================
---
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProvider.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -69,6 +69,8 @@
*/
public void addConnection(IConnectionWrapper connection);
public void removeConnection(IConnectionWrapper connection);
+ public void connectionChanged(IConnectionWrapper connection);
+
public void addListener(IConnectionProviderListener listener);
public void removeListener(IConnectionProviderListener listener);
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java
===================================================================
---
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -18,6 +18,7 @@
public static String ExtensionManagerError1;
public static String DefaultConnection_ErrorAdding;
public static String DefaultConnection_ErrorRemoving;
+ public static String DefaultConnection_ErrorChanging;
public static String DefaultConnection_ErrorLoading;
public static String DefaultConnection_ErrorRunningJMXCode;
public static String ProblemWritingToFile;
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties
===================================================================
---
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/JMXCoreMessages.properties 2010-04-06
09:24:46 UTC (rev 21279)
@@ -7,6 +7,7 @@
DefaultConnection_ErrorLoading=Error loading connection
DefaultConnection_ErrorAdding=Error adding connection.
DefaultConnection_ErrorRemoving=Error removing connection.
+DefaultConnection_ErrorChanging=Error changing connection.
DefaultConnection_ErrorRunningJMXCode=Error executing JMX request.
ProblemWritingToFile=Problem writing to file {0}
LoadMBeans=Load MBeans
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
===================================================================
---
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -91,6 +91,10 @@
public boolean canDelete(IConnectionWrapper wrapper) {
return wrapper instanceof DefaultConnectionWrapper;
}
+
+ public boolean canEdit(IConnectionWrapper wrapper) {
+ return wrapper instanceof DefaultConnectionWrapper;
+ }
public DefaultConnectionWrapper createConnection(Map map) throws CoreException {
String id = (String)map.get(ID);
@@ -151,6 +155,17 @@
}
}
}
+ public void connectionChanged(IConnectionWrapper connection) {
+ if( connection instanceof DefaultConnectionWrapper ) {
+ try {
+ save();
+ fireChanged(connection);
+ } catch( IOException ioe ) {
+ IStatus s = new Status(IStatus.ERROR, JMXActivator.PLUGIN_ID,
JMXCoreMessages.DefaultConnection_ErrorChanging, ioe);
+ JMXActivator.log(s);
+ }
+ }
+ }
protected void loadConnections() {
String filename =
JMXActivator.getDefault().getStateLocation().append(STORE_FILE).toOSString();
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
===================================================================
---
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -35,7 +35,6 @@
import org.jboss.tools.jmx.core.tree.Root;
public class DefaultConnectionWrapper implements IConnectionWrapper {
- private JMXServiceURL url;
private JMXConnector connector;
private MBeanServerConnection connection;
private Root root;
@@ -55,8 +54,6 @@
String[] credentials = new String[] { username, descriptor.getPassword() };
environment.put(JMXConnector.CREDENTIALS, credentials);
}
-
- url = new JMXServiceURL(descriptor.getURL());
}
public MBeanServerConnectionDescriptor getDescriptor() {
@@ -77,7 +74,7 @@
public synchronized void connect() throws IOException {
// try to connect
- connector = JMXConnectorFactory.connect(url, environment);
+ connector = JMXConnectorFactory.connect(new JMXServiceURL(descriptor.getURL()),
environment);
connection = connector.getMBeanServerConnection();
isConnected = true;
((DefaultConnectionProvider)getProvider()).fireChanged(this);
Modified:
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java
===================================================================
---
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/MBeanServerConnectionDescriptor.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -17,10 +17,10 @@
private static final long serialVersionUID = -8358701879017195518L;
- private final String id;
- private final String url;
- private final String userName;
- private final String password;
+ private String id;
+ private String url;
+ private String userName;
+ private String password;
public MBeanServerConnectionDescriptor(
String id, String url,
@@ -31,6 +31,22 @@
this.password = password;
}
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
public String getID() {
return id;
}
Modified:
branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java
===================================================================
---
branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java 2010-04-06
08:13:02 UTC (rev 21278)
+++
branches/jbosstools-3.1.x/jmx/tests/org.jboss.tools.jmx.core.test/src/org/jboss/tools/jmx/core/test/DefaultProviderTest.java 2010-04-06
09:24:46 UTC (rev 21279)
@@ -109,8 +109,7 @@
ExtensionManager.getProvider(DefaultConnectionProvider.PROVIDER_ID);
HashMap map = new HashMap();
map.put(DefaultConnectionProvider.ID, "Test Connection");
- map.put(DefaultConnectionProvider.URL,
"service:jmx:rmi:///jndi/rmi://localhost:9999" +
- "/jmxrmi");
+ map.put(DefaultConnectionProvider.URL,
"service:jmx:rmi:///jndi/rmi://localhost:9999/jmxrmi");
map.put(DefaultConnectionProvider.USERNAME, "");
map.put(DefaultConnectionProvider.PASSWORD, "");
IConnectionWrapper wrapper = defProvider.createConnection(map);