JBoss Tools SVN: r40050 - in trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui: internal/views/navigator and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-04-05 02:34:35 -0400 (Thu, 05 Apr 2012)
New Revision: 40050
Modified:
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java
trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/MBeanExplorerLabelProvider.java
Log:
/JBIDE-11452 - damage control
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java 2012-04-05 06:18:15 UTC (rev 40049)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.java 2012-04-05 06:34:35 UTC (rev 40050)
@@ -89,6 +89,8 @@
public static String Loading;
public static String UpdatingSelectionJob;
+ public static String JMXUIImageDescriptorNotFound;
+
static {
NLS.initializeMessages("org.jboss.tools.jmx.ui.Messages", //$NON-NLS-1$
Messages.class);
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties 2012-04-05 06:18:15 UTC (rev 40049)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/Messages.properties 2012-04-05 06:34:35 UTC (rev 40050)
@@ -36,9 +36,7 @@
MBeanServerConnectAction_text=Connect...
MBeanServerDisconnectAction_text=Disconnect
MBeanServerDisconnectAction_dialogTitle=JMX Disconnection
-MBeanServerDisconnectAction_dialogText=You are managing MBeans from this server.\n\
-If you disconnect, you will no longer be able to manage them.\n\n\
-Are you sure you want to disconnect?
+MBeanServerDisconnectAction_dialogText=You are managing MBeans from this server.\nIf you disconnect, you will no longer be able to manage them.\n\nAre you sure you want to disconnect?
name=Name
NotificationsPage_clearActionToolTip=Clear received notifications
NotificationsPage_message=Message
@@ -77,4 +75,6 @@
TypeInAFilter=Type in a filter
LoadingJMXNodes=Loading JMX Nodes
Loading=Loading...
-UpdatingSelectionJob=Updating selection job
\ No newline at end of file
+UpdatingSelectionJob=Updating selection job
+
+JMXUIImageDescriptorNotFound=Unable to load image {0} from plugin {1}
\ No newline at end of file
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java 2012-04-05 06:18:15 UTC (rev 40049)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/UIExtensionManager.java 2012-04-05 06:34:35 UTC (rev 40050)
@@ -18,10 +18,13 @@
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.InvalidRegistryObjectException;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.plugin.AbstractUIPlugin;
/**
@@ -48,6 +51,11 @@
wizardPages = element.getChildren();
String pluginName = element.getDeclaringExtension().getContributor().getName();
imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginName, icon);
+ if( imageDescriptor == null ) {
+ IStatus s = new Status(IStatus.WARNING, JMXUIActivator.PLUGIN_ID,
+ NLS.bind(Messages.JMXUIImageDescriptorNotFound, icon, pluginName));
+ JMXUIActivator.getDefault().log(s);
+ }
}
public String getId() {
return id;
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/MBeanExplorerLabelProvider.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/MBeanExplorerLabelProvider.java 2012-04-05 06:18:15 UTC (rev 40049)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.ui/src/org/jboss/tools/jmx/ui/internal/views/navigator/MBeanExplorerLabelProvider.java 2012-04-05 06:34:35 UTC (rev 40050)
@@ -105,9 +105,13 @@
IConnectionProvider provider = ((IConnectionWrapper)obj).getProvider();
ConnectionProviderUI ui = UIExtensionManager.getConnectionProviderUI(provider.getId());
if( ui != null ) {
- if(!images.containsKey(ui.getId()) || images.get(ui.getId()).isDisposed())
- images.put(ui.getId(),
- ui.getImageDescriptor().createImage());
+ if(!images.containsKey(ui.getId()) || images.get(ui.getId()).isDisposed()) {
+ Image i = null;
+ if( ui.getImageDescriptor() != null ) {
+ i = ui.getImageDescriptor().createImage();
+ }
+ images.put(ui.getId(), i);
+ }
return images.get(ui.getId());
}
}
13 years, 8 months
JBoss Tools SVN: r40049 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-04-05 02:18:15 -0400 (Thu, 05 Apr 2012)
New Revision: 40049
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IManagementPortProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossEAP60ExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss3To6ConnectionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ConnectionProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
Log:
JBIDE-11483, JBIDE-11479, JBIDE-11482, jmx related stuff with addition of verifier for segregating module state verification
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IManagementPortProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IManagementPortProvider.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IManagementPortProvider.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.server;
+
+/**
+ * An object that can provide an as7-style management port
+ */
+public interface IManagementPortProvider {
+ public int getManagementPort();
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.server;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+
+/**
+ * An interface for checking the state of remote modules by
+ * actually communicating with the server to check it.
+ *
+ */
+public interface IServerModuleStateVerifier {
+ /**
+ * Check to see if the module is started on the server
+ */
+ public boolean isModuleStarted(IServer server, IModule module, IProgressMonitor monitor);
+
+ /**
+ * Wait until the module is started on the server
+ */
+ public void waitModuleStarted(IServer server, IModule module, IProgressMonitor monitor);
+
+ /**
+ * Wait until the module is started on the server with a max delay as provided
+ */
+ public void waitModuleStarted(IServer server, IModule module, int maxDelay);
+
+
+}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.server.internal;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.ExtensionManager;
+import org.jboss.ide.eclipse.as.core.ExtensionManager.IServerJMXRunnable;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
+
+public class JBossLT6ModuleStateVerifier implements IServerModuleStateVerifier {
+ public boolean isModuleStarted(final IServer server, final IModule module,
+ final IProgressMonitor monitor) {
+ final boolean[] result = new boolean[1];
+ result[0] = false;
+ IServerJMXRunnable r = new IServerJMXRunnable() {
+ public void run(MBeanServerConnection connection) throws Exception {
+ result[0] = checkDeploymentStarted(server, module, connection, monitor);
+ }
+ };
+ try {
+ ExtensionManager.getDefault().getJMXRunner().run(server, r);
+ } catch( CoreException jmxe ) {
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.RESUME_DEPLOYMENT_SCANNER, Messages.JMXResumeScannerError, jmxe);
+ ServerLogger.getDefault().log(server, status);
+ } finally {
+ ExtensionManager.getDefault().getJMXRunner().endTransaction(server, this);
+ }
+ return result[0];
+ }
+
+ public void waitModuleStarted(IServer server, IModule module, int maxDelay) {
+ final NullProgressMonitor monitor = new NullProgressMonitor();
+ Thread t = new Thread(){
+ public void run() {
+ try {
+ Thread.sleep(20000);
+ } catch(InterruptedException ie) {
+ return;
+ }
+ synchronized(monitor) {
+ monitor.setCanceled(false);
+ }
+ }
+ };
+ t.start();
+
+ // synchronous call to wait
+ waitModuleStarted(server, module, monitor);
+
+ // call is over, can notify the thread to go finish itself
+ synchronized(monitor) {
+ if( !monitor.isCanceled() )
+ t.notify();
+ }
+ }
+ public void waitModuleStarted(IServer server, IModule module,
+ IProgressMonitor monitor) {
+ waitJMX(server, module);
+ }
+
+ protected void waitJMX(final IServer server, final IModule module) {
+ IServerJMXRunnable r = new IServerJMXRunnable() {
+ public void run(MBeanServerConnection connection) throws Exception {
+ jmxWaitForDeploymentStarted(server, module, connection, null);
+ }
+ };
+ try {
+ ExtensionManager.getDefault().getJMXRunner().run(server, r);
+ } catch( CoreException jmxe ) {
+ IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.RESUME_DEPLOYMENT_SCANNER, Messages.JMXResumeScannerError, jmxe);
+ ServerLogger.getDefault().log(server, status);
+ } finally {
+ ExtensionManager.getDefault().getJMXRunner().endTransaction(server, this);
+ }
+ }
+
+ protected void jmxWaitForDeploymentStarted(final IServer server, final IModule module,
+ final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
+ monitor = monitor == null ? new NullProgressMonitor() : monitor;
+ monitor.beginTask("Ensuring Deployments are Loaded", 10000); //$NON-NLS-1$
+ while( !monitor.isCanceled()) {
+ boolean done = checkDeploymentStarted(server, module, connection, monitor);
+ if( done ) {
+ monitor.done();
+ return;
+ }
+ try {
+ Thread.sleep(1000);
+ } catch(InterruptedException ie) {
+ // Intentional ignore
+ }
+ }
+ }
+
+ protected boolean checkDeploymentStarted(final IServer server, final IModule module,
+ final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
+ String typeId;
+ typeId = module.getModuleType().getId();
+
+ if( typeId.equals("wst.web") || typeId.equals("jst.web")) { //$NON-NLS-1$ //$NON-NLS-2$
+ String mbeanName = null;
+ IModule earParent = findEarParent(server, module);
+ String stateAttribute;
+ Object result;
+ if( earParent == null ) {
+ mbeanName = "jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/" + module.getName(); //$NON-NLS-1$
+ stateAttribute = "state"; //$NON-NLS-1$
+ result = getAttributeResult(connection, mbeanName, stateAttribute);
+ if(result == null || !(result instanceof Integer) || ((Integer)result).intValue() != 1 ) {
+ return false;
+ }
+ } else {
+ mbeanName = "jboss.deployment:id=\"jboss.web.deployment:war=/" + module.getName() + "\",type=Component"; //$NON-NLS-1$//$NON-NLS-2$
+ stateAttribute = "State"; //$NON-NLS-1$
+ result = getAttributeResult(connection, mbeanName, stateAttribute);
+ if( result == null || !result.toString().equals("DEPLOYED")) //$NON-NLS-1$
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private Object getAttributeResult(final MBeanServerConnection connection, String mbeanName, String stateAttribute) throws Exception {
+ ObjectName on = new ObjectName(mbeanName);
+ try {
+ return connection.getAttribute(on, stateAttribute);
+ } catch(InstanceNotFoundException infe) {
+ return false;
+ }
+ }
+
+ /* TODO Unify findEarParent with findRootModule */
+ private IModule findEarParent(IServer server, IModule module) {
+ try {
+ IModule[] deployed = server.getModules();
+ ArrayList<IModule> deployedAsList = new ArrayList<IModule>();
+ deployedAsList.addAll(Arrays.asList(deployed));
+ IModule[] possibleParents = server.getRootModules(module, new NullProgressMonitor());
+ for( int i = 0; i < possibleParents.length; i++ ) {
+ if( possibleParents[i].getModuleType().getId().equals("jst.ear") && deployedAsList.contains(possibleParents[i])) //$NON-NLS-1$
+ return possibleParents[i];
+ }
+ } catch(CoreException ce) {
+ // Should never be reached
+ }
+ return null;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS710ExtendedProperties.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -22,6 +22,9 @@
}
public int getJMXProviderType() {
- return JMX_AS_710_PROVIDER;
+ return JMX_OVER_AS_MANAGEMENT_PORT_PROVIDER;
}
+ public boolean runtimeSupportsBindingToAllInterfaces() {
+ return true;
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossAS7ExtendedProperties.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -16,6 +16,8 @@
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IRuntime;
import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
+import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7ModuleStateVerifier;
import org.jboss.ide.eclipse.as.core.server.internal.v7.LocalJBoss7ServerRuntime;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
@@ -37,6 +39,8 @@
public boolean runtimeSupportsBindingToAllInterfaces() {
String version = getServerBeanLoader().getFullServerVersion();
+ if( version == null )
+ return true;
if( version.startsWith("7.0.1") || version.startsWith("7.0.0")) //$NON-NLS-1$//$NON-NLS-2$
return false;
return true;
@@ -60,4 +64,12 @@
return null;
}
+ public boolean canVerifyRemoteModuleState() {
+ return true;
+ }
+
+ public IServerModuleStateVerifier getModuleStateVerifier() {
+ return new JBoss7ModuleStateVerifier();
+ }
+
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossEAP60ExtendedProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossEAP60ExtendedProperties.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossEAP60ExtendedProperties.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.server.internal.extendedproperties;
+
+import org.eclipse.core.runtime.IAdaptable;
+
+/**
+ *
+ */
+public class JBossEAP60ExtendedProperties extends JBossAS710ExtendedProperties {
+
+ public JBossEAP60ExtendedProperties(IAdaptable obj) {
+ super(obj);
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/JBossExtendedProperties.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -12,16 +12,33 @@
import java.io.File;
import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.ExtensionManager;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.ExtensionManager.IServerJMXRunnable;
+import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
+import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
import org.jboss.ide.eclipse.as.core.server.bean.ServerBeanLoader;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossLT6ModuleStateVerifier;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
@@ -56,7 +73,7 @@
}
public int getJMXProviderType() {
- return JMX_AS_3_TO_6_PROVIDER;
+ return JMX_OVER_JNDI_PROVIDER;
}
public boolean hasWelcomePage() {
@@ -102,4 +119,12 @@
return null;
}
+ public boolean canVerifyRemoteModuleState() {
+ return true;
+ }
+
+ public IServerModuleStateVerifier getModuleStateVerifier() {
+ return new JBossLT6ModuleStateVerifier();
+ }
+
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/extendedproperties/ServerExtendedProperties.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -16,6 +16,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerAttributes;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
public class ServerExtendedProperties {
protected IServerAttributes server;
@@ -35,8 +36,15 @@
public static final int JMX_NULL_PROVIDER = -1;
public static final int JMX_DEFAULT_PROVIDER = 0;
- public static final int JMX_AS_3_TO_6_PROVIDER = 1;
- public static final int JMX_AS_710_PROVIDER = 2;
+ public static final int JMX_OVER_JNDI_PROVIDER = 1;
+
+ /**
+ * Server types that have JMX_OVER_AS_MANAGEMENT_PORT as their jmx type
+ * are expected to implement IManagementPortProvider, so the jmx
+ * knows what port to check. Any servers that use JMX_OVER_AS_MANAGEMENT_PORT
+ * but do not implement the interface will have a default port of 9999 used.
+ */
+ public static final int JMX_OVER_AS_MANAGEMENT_PORT_PROVIDER = 2;
public int getJMXProviderType() {
return JMX_NULL_PROVIDER;
}
@@ -60,4 +68,12 @@
public IStatus verifyServerStructure() {
return Status.OK_STATUS;
}
+
+ public boolean canVerifyRemoteModuleState() {
+ return false;
+ }
+
+ public IServerModuleStateVerifier getModuleStateVerifier() {
+ return null;
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugEvent;
@@ -27,6 +28,7 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.model.IProcess;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
import org.jboss.ide.eclipse.as.core.Trace;
@@ -35,8 +37,10 @@
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
import org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
+import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.core.server.internal.launch.DelegatingStartLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.util.LaunchCommandPreferences;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -102,6 +106,22 @@
}
@Override
+ public void stopModule(IModule[] module, IProgressMonitor monitor) throws CoreException {
+ IDeployableServer ds = ServerConverter.getDeployableServer(getServer());
+ if( ds == null )
+ return;
+
+ IJBossServerPublishMethod method = createPublishMethod();
+ DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
+ setModuleState(module, IServer.STATE_STOPPED );
+ }
+
+ @Override
+ public void startModule(IModule[] module, IProgressMonitor monitor) throws CoreException {
+ restartModule(module, monitor);
+ }
+
+ @Override
public void restartModule(IModule[] module, IProgressMonitor monitor) throws CoreException {
IDeployableServer ds = ServerConverter.getDeployableServer(getServer());
if( ds == null )
@@ -109,7 +129,16 @@
IJBossServerPublishMethod method = createPublishMethod();
IPath depPath = PublishUtil.getDeployPath(method, module, ds);
- createDoDeployMarker(method, new IPath[]{depPath}, monitor);
+ createDoDeployMarker(method, Arrays.asList(new IPath[]{depPath}), monitor);
+ setModuleState(module, IServer.STATE_STARTING);
+ ServerExtendedProperties props = (ServerExtendedProperties)getServer()
+ .loadAdapter(ServerExtendedProperties.class, new NullProgressMonitor());
+ if( props != null && props.canVerifyRemoteModuleState()) {
+ IServerModuleStateVerifier verifier = props.getModuleStateVerifier();
+ if( verifier != null ) {
+ verifier.waitModuleStarted(getServer(), module[module.length-1], 20000);
+ }
+ }
}
@Override
@@ -177,10 +206,7 @@
}
return (List<IPath>) o;
}
- private void createDoDeployMarker(IJBossServerPublishMethod method, IPath[] paths, IProgressMonitor monitor) throws CoreException {
- List<IPath> allPaths = Arrays.asList(paths);
- createDoDeployMarker(method, allPaths, monitor);
- }
+
private void createDoDeployMarker(IJBossServerPublishMethod method, List<IPath> paths, IProgressMonitor monitor) throws CoreException {
if( method == null )
method = createPublishMethod();
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.server.internal.v7;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
+import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.management.core.IJBoss7ManagerService;
+import org.jboss.ide.eclipse.as.management.core.JBoss7DeploymentState;
+import org.jboss.ide.eclipse.as.management.core.JBoss7ManagerUtil;
+
+public class JBoss7ModuleStateVerifier implements IServerModuleStateVerifier {
+ public void waitModuleStarted(IServer server, IModule module, int maxDelay) {
+ final NullProgressMonitor monitor = new NullProgressMonitor();
+ Thread t = new Thread(){
+ public void run() {
+ try {
+ Thread.sleep(20000);
+ } catch(InterruptedException ie) {
+ return;
+ }
+ synchronized(monitor) {
+ monitor.setCanceled(true);
+ }
+ }
+ };
+ t.start();
+
+ // synchronous call to wait
+ waitModuleStarted(server, module, monitor);
+
+ // call is over, can notify the thread to go finish itself
+ synchronized(monitor) {
+ if( !monitor.isCanceled() )
+ t.notify();
+ }
+ }
+
+ public boolean isModuleStarted(IServer server, IModule module,
+ IProgressMonitor monitor) {
+ IModule rootModule = findRootModule(server, module);
+ try {
+ return isRootModuleStarted(server, rootModule, monitor);
+ } catch(Exception e ) {
+ String er = "Error occurred while checking module state for {0} on server {1}"; //$NON-NLS-1$
+ IStatus s = new Status(
+ IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(er, rootModule.getName(), server.getName()), e);
+ ServerLogger.getDefault().log(server, s);
+ return false;
+ }
+ }
+
+ private boolean isRootModuleStarted(IServer server, IModule root, IProgressMonitor monitor) throws Exception {
+ JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
+ IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
+ IPath deployPath = PublishUtil.getDeployPath(new IModule[]{root}, jbossServer);
+ return isRootModuleStarted(server, root, service, deployPath, monitor);
+ }
+
+ private boolean isRootModuleStarted(IServer server, IModule root,
+ IJBoss7ManagerService service, IPath deployPath, IProgressMonitor monitor) throws Exception {
+ AS7ManagementDetails details = new AS7ManagementDetails(server);
+ boolean done = false;
+ if (service.isRunning(details)) { // to avoid asking while server is starting up.
+ JBoss7DeploymentState state = service.getDeploymentState(
+ details, deployPath.lastSegment());
+ done = (state == JBoss7DeploymentState.STARTED);
+ }
+ return done;
+ }
+
+
+ public void waitModuleStarted(IServer server, IModule module, IProgressMonitor monitor) {
+ IModule rootModule = findRootModule(server, module);
+ try {
+ JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
+ IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
+ IPath deployPath = PublishUtil.getDeployPath(new IModule[]{rootModule}, jbossServer);
+ boolean waitedOnce = false;
+
+ while (!monitor.isCanceled()) {
+ boolean done = isRootModuleStarted(server, rootModule, service, deployPath, monitor);
+ if (done) {
+ return;
+ }
+ if(!waitedOnce) {
+ String info = "Module {0} on {1} not yet fully deployed. Waiting..."; //$NON-NLS-1$
+ IStatus s = new Status( IStatus.INFO, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(info, rootModule.getName(), server.getName()),null);
+ ServerLogger.getDefault().log(server, s);
+ }
+ waitedOnce = true;
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException ie) {
+ // Ignore, intentional
+ }
+ }
+
+ String warning = "Module {0} on {1} still not ready to be shown in browser. Aborting delay."; //$NON-NLS-1$
+ IStatus s = new Status(
+ IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(warning, rootModule.getName(), server.getName()), null);
+ ServerLogger.getDefault().log(server, s);
+ } catch (Exception e) {
+ String er = "Error occurred while waiting for {0} to start on server {1}"; //$NON-NLS-1$
+ IStatus s = new Status(
+ IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID,
+ NLS.bind(er, rootModule.getName(), server.getName()), e);
+ ServerLogger.getDefault().log(server, s);
+ }
+ }
+
+ private IModule findRootModule(IServer server, IModule module) {
+ IModule[] rootMods = null;
+ try {
+ rootMods = server.getRootModules(module, new NullProgressMonitor());
+ } catch( CoreException ce ) {
+ return module; // No need to log this
+ }
+ if( rootMods == null || rootMods.length == 0 )
+ return module;
+ List<IModule> serverHas = Arrays.asList(server.getModules());
+ for( int i = 0; i < rootMods.length; i++ ) {
+ if( serverHas.contains(rootMods[i]))
+ // Grab the first parent module that's already on the server
+ return rootMods[i];
+ }
+ return module;
+ }
+
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7Server.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -23,13 +23,14 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IRuntime;
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
+import org.jboss.ide.eclipse.as.core.server.IManagementPortProvider;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.core.util.ExpressionResolverUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-public class JBoss7Server extends JBossServer implements IJBoss7Deployment {
+public class JBoss7Server extends JBossServer implements IJBoss7Deployment, IManagementPortProvider {
public void setDefaults(IProgressMonitor monitor) {
super.setDefaults(monitor);
setAttribute(DEPLOY_DIRECTORY_TYPE, DEPLOY_SERVER);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2012-04-05 06:18:15 UTC (rev 40049)
@@ -1202,6 +1202,16 @@
type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties">
</adapter>
</factory>
+ <factory
+ adaptableType="org.eclipse.wst.server.core.IRuntime"
+ class="org.jboss.ide.eclipse.as.core.server.internal.ExtendedServerPropertiesAdapterFactory">
+ <adapter
+ type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties">
+ </adapter>
+ <adapter
+ type="org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties">
+ </adapter>
+ </factory>
</extension>
</plugin>
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss3To6ConnectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss3To6ConnectionProvider.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss3To6ConnectionProvider.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -23,7 +23,7 @@
public JBoss3To6ConnectionProvider() {
super();
repository = new JMXClassLoaderRepository();
- JBossJMXConnectionProviderModel.getDefault().registerProvider(ServerExtendedProperties.JMX_AS_3_TO_6_PROVIDER, this);
+ JBossJMXConnectionProviderModel.getDefault().registerProvider(ServerExtendedProperties.JMX_OVER_JNDI_PROVIDER, this);
}
public String getName(IConnectionWrapper wrapper) {
@@ -36,7 +36,7 @@
protected boolean belongsHere(IServer server) {
JBossExtendedProperties props = ExtendedServerPropertiesAdapterFactory.getJBossExtendedProperties(server);
int type = props == null ? -1 : props.getJMXProviderType();
- return type == JBossExtendedProperties.JMX_AS_3_TO_6_PROVIDER;
+ return type == JBossExtendedProperties.JMX_OVER_JNDI_PROVIDER;
}
protected IConnectionWrapper createConnection(IServer server) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ConnectionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ConnectionProvider.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ConnectionProvider.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -23,7 +23,7 @@
public JBoss71ConnectionProvider() {
super();
repository = new AS71JMXClassLoaderRepository();
- JBossJMXConnectionProviderModel.getDefault().registerProvider(ServerExtendedProperties.JMX_AS_710_PROVIDER, this);
+ JBossJMXConnectionProviderModel.getDefault().registerProvider(ServerExtendedProperties.JMX_OVER_AS_MANAGEMENT_PORT_PROVIDER, this);
}
@@ -37,7 +37,7 @@
protected boolean belongsHere(IServer server) {
JBossExtendedProperties props = ExtendedServerPropertiesAdapterFactory.getJBossExtendedProperties(server);
int type = props == null ? -1 : props.getJMXProviderType();
- return type == JBossExtendedProperties.JMX_AS_710_PROVIDER;
+ return type == JBossExtendedProperties.JMX_OVER_AS_MANAGEMENT_PORT_PROVIDER;
}
protected IConnectionWrapper createConnection(IServer server) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/JBoss71ServerConnection.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -19,6 +19,9 @@
import javax.management.remote.JMXServiceURL;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.jboss.ide.eclipse.as.core.server.IManagementPortProvider;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.jmx.integration.JMXUtil.CredentialException;
import org.jboss.tools.jmx.core.ExtensionManager;
import org.jboss.tools.jmx.core.IConnectionProvider;
@@ -37,8 +40,15 @@
}
protected MBeanServerConnection createConnection(IServer s) throws Exception {
+ ServerDelegate sd = (ServerDelegate)s.loadAdapter(ServerDelegate.class, null);
+ int port = -1;
+ if( !(sd instanceof IManagementPortProvider))
+ port = IJBossToolingConstants.AS7_MANAGEMENT_PORT_DEFAULT_PORT;
+ else {
+ port = ((IManagementPortProvider)sd).getManagementPort();
+ }
try {
- String url = "service:jmx:remoting-jmx://" + s.getHost() + ":9999"; // TODO externalize this?
+ String url = "service:jmx:remoting-jmx://" + s.getHost() + ":" + port;
Map<String, String[]> environment = new HashMap<String, String[]>();
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(url), environment);
MBeanServerConnection connection = connector.getMBeanServerConnection();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2012-04-05 06:08:00 UTC (rev 40048)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2012-04-05 06:18:15 UTC (rev 40049)
@@ -13,24 +13,12 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunch;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
@@ -41,22 +29,9 @@
import org.eclipse.wst.server.core.IServerListener;
import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.core.model.ClientDelegate;
-import org.jboss.ide.eclipse.as.core.ExtensionManager;
-import org.jboss.ide.eclipse.as.core.ExtensionManager.IServerJMXRunnable;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
-import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
-import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.server.IServerModuleStateVerifier;
import org.jboss.ide.eclipse.as.core.server.internal.JBossLaunchAdapter.JBTCustomHttpLaunchable;
-import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.JBoss7Server;
-import org.jboss.ide.eclipse.as.core.server.v7.management.AS7ManagementDetails;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.core.util.ServerUtil;
-import org.jboss.ide.eclipse.as.management.core.IJBoss7ManagerService;
-import org.jboss.ide.eclipse.as.management.core.JBoss7DeploymentState;
-import org.jboss.ide.eclipse.as.management.core.JBoss7ManagerUtil;
+import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
public class JBTWebLaunchableClient extends ClientDelegate {
@@ -68,11 +43,6 @@
return (launchable instanceof JBTCustomHttpLaunchable);
}
- protected boolean isJMXServer(IServer server) {
- JBossServer jbs = ServerConverter.getJBossServer(server);
- return jbs != null && jbs.hasJMXProvider() && ExtensionManager.getDefault().getJMXRunner() != null;
- }
-
public IStatus launch(final IServer server, final Object launchable, final String launchMode, final ILaunch launch) {
if( server.getServerState() == IServer.STATE_STOPPED || server.getServerState() == IServer.STATE_STOPPING)
return Status.CANCEL_STATUS;
@@ -97,17 +67,26 @@
});
} else {
JBossServerUIPlugin.getDefault().getLog().log(
- new Status(IStatus.WARNING, JBossServerUIPlugin.PLUGIN_ID, "Server stopped before before browser could be opened.", null));
+ new Status(IStatus.WARNING, JBossServerUIPlugin.PLUGIN_ID,
+ "Server stopped before before browser could be opened.", null));
}
return null;
}
protected void wait(final IServer server, final IModule module) {
+ // Wait for the server to be started. No remote polling necessary.
+ // Framework poller is handling that. Here just wait in the state event framework
waitServerStarted(server);
- if( isJMXServer(server)) {
- waitJMX(server, module);
- } else if( ServerUtil.isJBoss7(server)) {
- waitJBoss7(server, module);
+
+ // Now check if we are able to poll the server on module state or not
+ ServerExtendedProperties props = (ServerExtendedProperties)server
+ .loadAdapter(ServerExtendedProperties.class, new NullProgressMonitor());
+ if( props != null && props.canVerifyRemoteModuleState()) {
+ IServerModuleStateVerifier verifier = props.getModuleStateVerifier();
+ if( verifier != null ) {
+ // we can verify the remote state, so go do it, so go wait for the module to be deployed
+ verifier.waitModuleStarted(server, module, 20000);
+ }
}
}
@@ -135,168 +114,6 @@
server.removeServerListener(listener);
}
- private IModule findRootModule(IServer server, IModule module) {
- IModule[] rootMods = null;
- try {
- rootMods = server.getRootModules(module, new NullProgressMonitor());
- } catch( CoreException ce ) {
- return module; // No need to log this
- }
- if( rootMods == null || rootMods.length == 0 )
- return module;
- List<IModule> serverHas = Arrays.asList(server.getModules());
- for( int i = 0; i < rootMods.length; i++ ) {
- if( serverHas.contains(rootMods[i]))
- // Grab the first parent module that's already on the server
- return rootMods[i];
- }
- return module;
- }
-
- //TODO: the waiting/timeout logic in here should be done for waitJMX too.
- //TODO: should return true for succss or false if timeout so upper layer can report it.
- protected void waitJBoss7(final IServer server, final IModule module2) {
- IModule rootModule = findRootModule(server, module2);
- try {
- JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
- IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{rootModule}, jbossServer);
- long time = new Date().getTime();
- long endTime = time + getMaxDelay();
- boolean waitedOnce = false;
-
- while (new Date().getTime() < endTime) { // no need to keep doing this if timed out or server stopping/stopped but not sure how to avoid race condition.
- AS7ManagementDetails details = new AS7ManagementDetails(server);
- boolean done = false;
- if (service.isRunning(details)) { // to avoid asking while server is starting up.
- JBoss7DeploymentState state = service.getDeploymentState(
- details, deployPath.lastSegment());
- done = (state == JBoss7DeploymentState.STARTED);
- }
- if (done) {
- return;
- }
- if(!waitedOnce) {
- JBossServerUIPlugin.log(new Status(
- IStatus.INFO, JBossServerUIPlugin.PLUGIN_ID,
- "Module " + rootModule.getName() + " on " + server.getName() + " not ready to be shown in web browser. Waiting...", null));
- }
- waitedOnce = true;
- try {
- Thread.sleep(2000);
- } catch (InterruptedException ie) {
- // Ignore, intentional
- }
- }
- } catch (Exception e) {
- IStatus s = new Status(
- IStatus.WARNING,
- JBossServerCorePlugin.PLUGIN_ID,
- NLS.bind(
- "Error occurred while waiting for " + rootModule.getName() + " to start on " + server.getName(),
- server.getName()), e);
- JBossServerUIPlugin.log(s.getMessage(), e);
- }
-
- }
-
- protected void waitJMX(final IServer server, final IModule module) {
- IServerJMXRunnable r = new IServerJMXRunnable() {
- public void run(MBeanServerConnection connection) throws Exception {
- jmxWaitForDeploymentStarted(server, module, connection, null);
- }
- };
- try {
- ExtensionManager.getDefault().getJMXRunner().run(server, r);
- } catch( CoreException jmxe ) {
- IStatus status = new Status(IStatus.WARNING, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.RESUME_DEPLOYMENT_SCANNER, Messages.JMXResumeScannerError, jmxe);
- ServerLogger.getDefault().log(server, status);
- } finally {
- ExtensionManager.getDefault().getJMXRunner().endTransaction(server, this);
- }
- }
-
- protected void jmxWaitForDeploymentStarted(final IServer server, final IModule module,
- final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
- monitor = monitor == null ? new NullProgressMonitor() : monitor;
- monitor.beginTask("Ensuring Deployments are Loaded", 10000); //$NON-NLS-1$
- long time = new Date().getTime();
- long endTime = time + getMaxDelay();
- while( new Date().getTime() < endTime ) {
- boolean done = checkDeploymentStarted(server, module, connection, monitor);
- if( done ) {
- monitor.done();
- return;
- }
- try {
- Thread.sleep(1000);
- } catch(InterruptedException ie) {
- // Intentional ignore
- }
- }
- }
-
- protected long getMaxDelay() {
- return 20000;
- }
-
- protected boolean checkDeploymentStarted(final IServer server, final IModule module,
- final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
- String typeId;
- typeId = module.getModuleType().getId();
-
- if( typeId.equals("wst.web") || typeId.equals("jst.web")) { //$NON-NLS-1$ //$NON-NLS-2$
- String mbeanName = null;
- IModule earParent = findEarParent(server, module);
- String stateAttribute;
- Object result;
- if( earParent == null ) {
- mbeanName = "jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/" + module.getName(); //$NON-NLS-1$
- stateAttribute = "state"; //$NON-NLS-1$
- result = getAttributeResult(connection, mbeanName, stateAttribute);
- if(result == null || !(result instanceof Integer) || ((Integer)result).intValue() != 1 ) {
- return false;
- }
- } else {
- mbeanName = "jboss.deployment:id=\"jboss.web.deployment:war=/" + module.getName() + "\",type=Component"; //$NON-NLS-1$//$NON-NLS-2$
- stateAttribute = "State"; //$NON-NLS-1$
- result = getAttributeResult(connection, mbeanName, stateAttribute);
- if( result == null || !result.toString().equals("DEPLOYED")) //$NON-NLS-1$
- return false;
- }
- }
- return true;
- }
-
- private Object getAttributeResult(final MBeanServerConnection connection, String mbeanName, String stateAttribute) throws Exception {
- ObjectName on = new ObjectName(mbeanName);
- try {
- return connection.getAttribute(on, stateAttribute);
- } catch(InstanceNotFoundException infe) {
- return false;
- }
- }
-
- /* TODO Unify findEarParent with findRootModule */
- private IModule findEarParent(IServer server, IModule module) {
- try {
- IModule[] deployed = server.getModules();
- ArrayList<IModule> deployedAsList = new ArrayList<IModule>();
- deployedAsList.addAll(Arrays.asList(deployed));
- IModule[] possibleParents = server.getRootModules(module, new NullProgressMonitor());
- for( int i = 0; i < possibleParents.length; i++ ) {
- if( possibleParents[i].getModuleType().getId().equals("jst.ear") && deployedAsList.contains(possibleParents[i]))
- return possibleParents[i];
- }
- } catch(CoreException ce) {
- // Should never be reached
- }
- return null;
- }
-
-
-
-
/*
* Stolen from BrowserUtil
*/
13 years, 8 months
JBoss Tools SVN: r40048 - trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-04-05 02:08:00 -0400 (Thu, 05 Apr 2012)
New Revision: 40048
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AS71JMXClassLoaderRepository.java
Log:
https://issues.jboss.org/browse/JBIDE-11481 - client jar name changed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AS71JMXClassLoaderRepository.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AS71JMXClassLoaderRepository.java 2012-04-05 05:35:49 UTC (rev 40047)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.jmx.integration/src/org/jboss/ide/eclipse/as/jmx/integration/AS71JMXClassLoaderRepository.java 2012-04-05 06:08:00 UTC (rev 40048)
@@ -38,7 +38,7 @@
.append(IJBossRuntimeResourceConstants.CLIENT);
String[] children = p2.toFile().list();
for( int i = 0; i < children.length; i++ ) {
- if( children[i].endsWith(".jar") && children[i].startsWith("jboss-client-"))
+ if( children[i].endsWith(".jar") && children[i].startsWith("jboss-client"))
return p2.append(children[i]);
}
return null;
13 years, 8 months
JBoss Tools SVN: r40047 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-04-05 01:35:49 -0400 (Thu, 05 Apr 2012)
New Revision: 40047
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
Log:
JBIDE-11479
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2012-04-05 05:33:15 UTC (rev 40046)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2012-04-05 05:35:49 UTC (rev 40047)
@@ -167,7 +167,11 @@
return true;
}
protected boolean showListenOnAllHostsCheckbox() {
-
+ IRuntime rt = callback.getRuntime();
+ JBossExtendedProperties props2 = (JBossExtendedProperties)rt
+ .loadAdapter(JBossExtendedProperties.class,
+ new NullProgressMonitor());
+ props2.runtimeSupportsBindingToAllInterfaces();
IServerWorkingCopy wc = callback.getServer();
JBossExtendedProperties props = (JBossExtendedProperties)wc
.loadAdapter(JBossExtendedProperties.class,
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java 2012-04-05 05:33:15 UTC (rev 40046)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBoss7RuntimeWizardFragment.java 2012-04-05 05:35:49 UTC (rev 40047)
@@ -182,6 +182,7 @@
selectedVM = null;
configDirTextVal = configDirText.getText();
updateErrorMessage();
+ saveDetailsInRuntime();
}
protected String getWarningString() {
if( getHomeVersionWarning() != null )
@@ -258,19 +259,22 @@
}
@Override
- public void exit() {
+ protected void saveDetailsInRuntime() {
IRuntime r = (IRuntime) getTaskModel()
.getObject(TaskModel.TASK_RUNTIME);
IRuntimeWorkingCopy runtimeWC = r.isWorkingCopy() ? ((IRuntimeWorkingCopy) r)
: r.createWorkingCopy();
- runtimeWC.setName(name);
- runtimeWC.setLocation(new Path(homeDir));
+ if( name != null )
+ runtimeWC.setName(name);
+ if( homeDir != null )
+ runtimeWC.setLocation(new Path(homeDir));
LocalJBoss7ServerRuntime srt = (LocalJBoss7ServerRuntime) runtimeWC.loadAdapter(
LocalJBoss7ServerRuntime.class, new NullProgressMonitor());
- srt.setVM(selectedVM);
- srt.setConfigurationFile(configDirTextVal);
-
+ if( selectedVM != null )
+ srt.setVM(selectedVM);
+ if( configDirTextVal != null && !"".equals(configDirTextVal))
+ srt.setConfigurationFile(configDirTextVal);
getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2012-04-05 05:33:15 UTC (rev 40046)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/wizards/JBossRuntimeWizardFragment.java 2012-04-05 05:35:49 UTC (rev 40047)
@@ -596,6 +596,7 @@
selectedVM = null;
configDirTextVal = configDirText.getText();
updateErrorMessage();
+ saveDetailsInRuntime();
}
protected void updateErrorMessage() {
@@ -776,18 +777,27 @@
}
public void exit() {
+ saveDetailsInRuntime();
+ }
+
+ protected void saveDetailsInRuntime() {
IRuntime r = (IRuntime) getTaskModel()
.getObject(TaskModel.TASK_RUNTIME);
IRuntimeWorkingCopy runtimeWC = r.isWorkingCopy() ? ((IRuntimeWorkingCopy) r)
: r.createWorkingCopy();
- runtimeWC.setName(name);
- runtimeWC.setLocation(new Path(homeDir));
+ if( name != null )
+ runtimeWC.setName(name);
+ if( homeDir != null)
+ runtimeWC.setLocation(new Path(homeDir));
IJBossServerRuntime srt = (IJBossServerRuntime) runtimeWC.loadAdapter(
IJBossServerRuntime.class, new NullProgressMonitor());
- srt.setVM(selectedVM);
- srt.setJBossConfiguration(configurations.getSelectedConfiguration());
- srt.setConfigLocation(configDirTextVal);
+ if( selectedVM != null )
+ srt.setVM(selectedVM);
+ if( configurations != null && configurations.getSelectedConfiguration() != null )
+ srt.setJBossConfiguration(configurations.getSelectedConfiguration());
+ if( configDirText != null )
+ srt.setConfigLocation(configDirTextVal);
getTaskModel().putObject(TaskModel.TASK_RUNTIME, runtimeWC);
}
13 years, 8 months
JBoss Tools SVN: r40046 - trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/tree.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-04-05 01:33:15 -0400 (Thu, 05 Apr 2012)
New Revision: 40046
Modified:
trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/tree/ObjectNameNode.java
Log:
JBIDE-11480
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/tree/ObjectNameNode.java
===================================================================
--- trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/tree/ObjectNameNode.java 2012-04-05 02:49:10 UTC (rev 40045)
+++ trunk/jmx/plugins/org.jboss.tools.jmx.core/src/org/jboss/tools/jmx/core/tree/ObjectNameNode.java 2012-04-05 05:33:15 UTC (rev 40046)
@@ -12,7 +12,6 @@
import org.jboss.tools.jmx.core.IConnectionWrapper;
import org.jboss.tools.jmx.core.IJMXRunnable;
-import org.jboss.tools.jmx.core.JMXException;
import org.jboss.tools.jmx.core.MBeanInfoWrapper;
public class ObjectNameNode extends PropertyNode {
@@ -22,22 +21,7 @@
private MBeanInfoWrapper wrapper;
public ObjectNameNode(Node parent, String key, String value, ObjectName on) {
- super(parent, key, value);
- Root root = getRoot(parent);
- IConnectionWrapper connectionWrapper = root.getConnection();
- this.on = on;
- final MBeanInfoWrapper[] array = new MBeanInfoWrapper[1];
- final ObjectName on2 = on;
- try {
- connectionWrapper.run(new IJMXRunnable() {
- public void run(MBeanServerConnection mbsc) throws Exception {
- array[0] = new MBeanInfoWrapper(on2, mbsc.getMBeanInfo(on2), mbsc, ObjectNameNode.this);
- }
- });
- } catch( JMXException ce ) {
- // TODO LOG
- }
- wrapper = array[0];
+ this(parent, key, value, on, null);
}
public ObjectNameNode(Node parent, String key, String value, ObjectName on, MBeanServerConnection mbsc) {
@@ -49,7 +33,7 @@
final ObjectName on2 = on;
try {
if( mbsc != null )
- wrapper = new MBeanInfoWrapper(on2, mbsc.getMBeanInfo(on2), mbsc, ObjectNameNode.this);
+ array[0] = new MBeanInfoWrapper(on2, mbsc.getMBeanInfo(on2), mbsc, ObjectNameNode.this);
else {
connectionWrapper.run(new IJMXRunnable() {
public void run(MBeanServerConnection mbsc) throws Exception {
13 years, 8 months
JBoss Tools SVN: r40045 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-04-04 22:49:10 -0400 (Wed, 04 Apr 2012)
New Revision: 40045
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IExtendedPropertiesProvider.java
Log:
JBIDE-11478 npe on tomcat server
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java 2012-04-05 00:36:53 UTC (rev 40044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/ExtendedServerPropertiesAdapterFactory.java 2012-04-05 02:49:10 UTC (rev 40045)
@@ -18,6 +18,7 @@
import org.eclipse.wst.server.core.IServerAttributes;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS710ExtendedProperties;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossAS7ExtendedProperties;
+import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossEAP60ExtendedProperties;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.JBossExtendedProperties;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
@@ -36,7 +37,7 @@
public Object getAdapter(Object adaptableObject, Class adapterType) {
ServerExtendedProperties props = getExtendedProperties(adaptableObject);
- if( adapterType.isAssignableFrom(props.getClass()))
+ if( props != null && adapterType.isAssignableFrom(props.getClass()))
return props;
return null;
}
@@ -76,7 +77,7 @@
if( SERVER_AS_71.equals(typeId) || AS_71.equals(typeId))
return new JBossAS710ExtendedProperties(adaptable);
if( SERVER_EAP_60.equals(typeId) || EAP_60.equals(typeId))
- return new JBossAS710ExtendedProperties(adaptable);
+ return new JBossEAP60ExtendedProperties(adaptable);
// NEW_SERVER_ADAPTER
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IExtendedPropertiesProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IExtendedPropertiesProvider.java 2012-04-05 00:36:53 UTC (rev 40044)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/IExtendedPropertiesProvider.java 2012-04-05 02:49:10 UTC (rev 40045)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.core.server.internal;
import org.jboss.ide.eclipse.as.core.server.internal.extendedproperties.ServerExtendedProperties;
13 years, 8 months
JBoss Tools SVN: r40044 - trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-04-04 20:36:53 -0400 (Wed, 04 Apr 2012)
New Revision: 40044
Modified:
trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/AllTests.java
trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java
Log:
Copyright comments added to GWT test plug-in classes
Modified: trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/AllTests.java
===================================================================
--- trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/AllTests.java 2012-04-05 00:35:08 UTC (rev 40043)
+++ trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/AllTests.java 2012-04-05 00:36:53 UTC (rev 40044)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.tools.gwt.tests;
import org.junit.runner.RunWith;
Modified: trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java
===================================================================
--- trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java 2012-04-05 00:35:08 UTC (rev 40043)
+++ trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java 2012-04-05 00:36:53 UTC (rev 40044)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.tools.gwt.tests;
import org.eclipse.core.runtime.Platform;
13 years, 8 months
JBoss Tools SVN: r40043 - in trunk/gwt/tests/org.jboss.tools.gwt.tests: src/org/jboss/tools/gwt/tests and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2012-04-04 20:35:08 -0400 (Wed, 04 Apr 2012)
New Revision: 40043
Modified:
trunk/gwt/tests/org.jboss.tools.gwt.tests/META-INF/MANIFEST.MF
trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java
Log:
added simple GWT test for plugin activation
Modified: trunk/gwt/tests/org.jboss.tools.gwt.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/gwt/tests/org.jboss.tools.gwt.tests/META-INF/MANIFEST.MF 2012-04-04 22:32:27 UTC (rev 40042)
+++ trunk/gwt/tests/org.jboss.tools.gwt.tests/META-INF/MANIFEST.MF 2012-04-05 00:35:08 UTC (rev 40043)
@@ -5,4 +5,7 @@
Bundle-Version: 1.0.2.qualifier
Bundle-Vendor: JBoss by Red Hat
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.junit;bundle-version="4.8.2"
+Require-Bundle: org.junit;bundle-version="4.8.2",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.gwt.core;bundle-version="1.0.0",
+ org.jboss.tools.gwt.ui;bundle-version="1.0.0"
Modified: trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java
===================================================================
--- trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java 2012-04-04 22:32:27 UTC (rev 40042)
+++ trunk/gwt/tests/org.jboss.tools.gwt.tests/src/org/jboss/tools/gwt/tests/GWTTest.java 2012-04-05 00:35:08 UTC (rev 40043)
@@ -1,13 +1,18 @@
package org.jboss.tools.gwt.tests;
+import org.eclipse.core.runtime.Platform;
import org.junit.Test;
+import org.osgi.framework.Bundle;
+
import static org.junit.Assert.*;
public class GWTTest {
@Test
- public void test() {
- fail("Not yet implemented");
+ public void testGwtPlugisArePresentAndActivated() {
+ Bundle bundle = Platform.getBundle("org.jboss.tools.gwt.core");
+ assertNotNull(bundle);
+ bundle = Platform.getBundle("org.jboss.tools.gwt.ui");
+ assertNotNull(bundle);
}
-
}
13 years, 8 months
JBoss Tools SVN: r40042 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-04 18:32:27 -0400 (Wed, 04 Apr 2012)
New Revision: 40042
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
Log:
JBIDE-11449
https://issues.jboss.org/browse/JBIDE-11449
Specialized Bean can set bean name if it is not inherited.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2012-04-04 22:16:37 UTC (rev 40041)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ClassBean.java 2012-04-04 22:32:27 UTC (rev 40042)
@@ -371,7 +371,10 @@
public String getName() {
ClassBean specialized = getSpecializedBean();
if(specialized != null) {
- return specialized.getName();
+ String name = specialized.getName();
+ if(name != null) {
+ return name;
+ }
}
AnnotationDeclaration named = findNamedAnnotation();
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2012-04-04 22:16:37 UTC (rev 40041)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/ProducerMethod.java 2012-04-04 22:32:27 UTC (rev 40042)
@@ -116,7 +116,10 @@
public String getName() {
ProducerMethod specialized = getSpecializedBean();
if(specialized != null) {
- return specialized.getName();
+ String name = specialized.getName();
+ if(name != null) {
+ return name;
+ }
}
AnnotationDeclaration named = findNamedAnnotation();
13 years, 8 months
JBoss Tools SVN: r40041 - trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2012-04-04 18:16:37 -0400 (Wed, 04 Apr 2012)
New Revision: 40041
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
Log:
JBIDE-11473
https://issues.jboss.org/browse/JBIDE-11473
also fix for JBIDE-11474
The order of types in hierarchy is preserved and infinite loop is prevented if the hierarchy is broken.
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2012-04-04 18:13:23 UTC (rev 40040)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/TypeInfoCollector.java 2012-04-04 22:16:37 UTC (rev 40041)
@@ -809,10 +809,13 @@
fTypeInfo = new TypeInfo(binType, fMember, fMember.isDataModel());
}
TypeInfo parent = fTypeInfo;
- Set<IType> allTypes = new HashSet<IType>();
+ List<IType> allTypes = new ArrayList<IType>();
+ Set<IType> allTypesSet = new HashSet<IType>();
Set<IType> superinterfaces = new HashSet<IType>();
while (binType != null) {
+ if(allTypesSet.contains(binType)) break;
allTypes.add(binType);
+ allTypesSet.add(binType);
initSuperinterfaces(binType, superinterfaces); // JBIDE-10809
binType = getSuperclass(binType);
if(binType!=null) {
13 years, 8 months