[jbosstools-commits] JBoss Tools SVN: r44022 - in trunk: jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Sep 26 03:46:23 EDT 2012


Author: rob.stryker at jboss.com
Date: 2012-09-26 03:46:23 -0400 (Wed, 26 Sep 2012)
New Revision: 44022

Added:
   trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java
Modified:
   trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java
   trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
   trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
Log:
JBIDE-12722 to trunk

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java	2012-09-26 05:52:43 UTC (rev 44021)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AbstractJBossJMXConnectionProvider.java	2012-09-26 07:46:23 UTC (rev 44022)
@@ -24,10 +24,12 @@
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
 import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.tools.jmx.core.IConnectionProvider;
+import org.jboss.tools.jmx.core.IConnectionProviderEventEmitter;
 import org.jboss.tools.jmx.core.IConnectionProviderListener;
 import org.jboss.tools.jmx.core.IConnectionWrapper;
 
-public abstract class AbstractJBossJMXConnectionProvider implements IConnectionProvider, IServerLifecycleListener  {
+public abstract class AbstractJBossJMXConnectionProvider implements 
+	IConnectionProvider, IConnectionProviderEventEmitter, IServerLifecycleListener  {
 
 	private ArrayList<IConnectionProviderListener> listeners = 
 		new ArrayList<IConnectionProviderListener>();
@@ -124,7 +126,7 @@
 		listeners.remove(listener);
 	}
 	
-	void fireAdded(IConnectionWrapper wrapper) {
+	public void fireAdded(IConnectionWrapper wrapper) {
 		for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
 			try {
 				i.next().connectionAdded(wrapper);
@@ -133,7 +135,7 @@
 			}
 	}
 
-	void fireChanged(IConnectionWrapper wrapper) {
+	public void fireChanged(IConnectionWrapper wrapper) {
 		for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
 			try {
 				i.next().connectionChanged(wrapper);
@@ -142,7 +144,7 @@
 			}
 	}
 
-	void fireRemoved(IConnectionWrapper wrapper) {
+	public void fireRemoved(IConnectionWrapper wrapper) {
 		for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
 			try {
 				i.next().connectionRemoved(wrapper);

Added: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java	                        (rev 0)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/IConnectionProviderEventEmitter.java	2012-09-26 07:46:23 UTC (rev 44022)
@@ -0,0 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Rob Stryker
+ * All rights reserved. This program and the accompanying materials
+ * are 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
+ *
+ *******************************************************************************/
+package org.jboss.tools.jmx.core;
+
+
+public interface IConnectionProviderEventEmitter {
+	void fireAdded(IConnectionWrapper wrapper);
+	void fireChanged(IConnectionWrapper wrapper);
+	void fireRemoved(IConnectionWrapper wrapper);
+}

Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java	2012-09-26 05:52:43 UTC (rev 44021)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionProvider.java	2012-09-26 07:46:23 UTC (rev 44022)
@@ -20,11 +20,11 @@
 import java.util.List;
 import java.util.Map;
 
-
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
 import org.jboss.tools.jmx.core.IConnectionProvider;
+import org.jboss.tools.jmx.core.IConnectionProviderEventEmitter;
 import org.jboss.tools.jmx.core.IConnectionProviderListener;
 import org.jboss.tools.jmx.core.IConnectionWrapper;
 import org.jboss.tools.jmx.core.IMemento;
@@ -35,7 +35,7 @@
 /**
  * The default connection type that comes bundled
  */
-public class DefaultConnectionProvider implements IConnectionProvider {
+public class DefaultConnectionProvider implements IConnectionProvider, IConnectionProviderEventEmitter {
 	public static final String PROVIDER_ID = "org.jboss.tools.jmx.core.providers.DefaultConnectionProvider"; //$NON-NLS-1$
 	public static final String ID = "id"; //$NON-NLS-1$
 	public static final String URL = "url"; //$NON-NLS-1$
@@ -63,21 +63,21 @@
 		listeners.remove(listener);
 	}
 
-	void fireAdded(IConnectionWrapper wrapper) {
+	public void fireAdded(IConnectionWrapper wrapper) {
 		for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
 			try {
 				i.next().connectionAdded(wrapper);
 			} catch(RuntimeException re) {}
 		}
 
-	void fireChanged(IConnectionWrapper wrapper) {
+	public void fireChanged(IConnectionWrapper wrapper) {
 		for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
 			try {
 				i.next().connectionChanged(wrapper);
 			} catch(RuntimeException re) {}
 	}
 
-	void fireRemoved(IConnectionWrapper wrapper) {
+	public void fireRemoved(IConnectionWrapper wrapper) {
 		for(Iterator<IConnectionProviderListener> i = listeners.iterator(); i.hasNext();)
 			try {
 				i.next().connectionRemoved(wrapper);

Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java	2012-09-26 05:52:43 UTC (rev 44021)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/providers/DefaultConnectionWrapper.java	2012-09-26 07:46:23 UTC (rev 44022)
@@ -26,6 +26,7 @@
 import org.eclipse.core.runtime.Status;
 import org.jboss.tools.jmx.core.ExtensionManager;
 import org.jboss.tools.jmx.core.IConnectionProvider;
+import org.jboss.tools.jmx.core.IConnectionProviderEventEmitter;
 import org.jboss.tools.jmx.core.IConnectionWrapper;
 import org.jboss.tools.jmx.core.IJMXRunnable;
 import org.jboss.tools.jmx.core.JMXActivator;
@@ -77,7 +78,7 @@
         connector = JMXConnectorFactory.connect(new JMXServiceURL(descriptor.getURL()), environment);
         connection = connector.getMBeanServerConnection();
 		isConnected = true;
-		((DefaultConnectionProvider)getProvider()).fireChanged(this);
+		((IConnectionProviderEventEmitter)getProvider()).fireChanged(this);
 	}
 	
 	public synchronized void disconnect() throws IOException {
@@ -87,7 +88,7 @@
 		try {
 			connector.close();
 		} finally {
-			((DefaultConnectionProvider)getProvider()).fireChanged(this);
+			((IConnectionProviderEventEmitter)getProvider()).fireChanged(this);
 		}
         connector = null;
         connection = null;



More information about the jbosstools-commits mailing list