Author: rob.stryker(a)jboss.com
Date: 2012-05-04 08:17:57 -0400 (Fri, 04 May 2012)
New Revision: 40789
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.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/JBoss6ModuleStateVerifier.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/JBossLaunchAdapter.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/JBoss7ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java
Log:
JBIDE-11514 - moved the discovering of the module tree up into the artifact, rather than
at the verifier level.
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/modules/EarArtifactAdapter.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -15,9 +15,11 @@
import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
import org.eclipse.wst.server.core.model.ModuleArtifactAdapterDelegate;
import org.eclipse.wst.server.core.model.ModuleDelegate;
+import org.jboss.ide.eclipse.as.core.server.IModuleArtifact2;
public class EarArtifactAdapter extends ModuleArtifactAdapterDelegate {
@@ -53,18 +55,21 @@
return null;
}
- public static class EarModuleArtifact implements IModuleArtifact {
+ public static class EarModuleArtifact implements IModuleArtifact2 {
private IModule earModule;
- private IModuleArtifact webArtifact;
- public EarModuleArtifact(IModule ear, IModuleArtifact web) {
+ private IModuleArtifact childArtifact;
+ public EarModuleArtifact(IModule ear, IModuleArtifact child) {
this.earModule = ear;
- this.webArtifact = web;
+ this.childArtifact = child;
}
public IModule getModule() {
return earModule;
}
- public IModuleArtifact getWebArtifact() {
- return webArtifact;
+ public IModuleArtifact getChildArtifact() {
+ return childArtifact;
}
+ public IModule[] getModuleTree(IServer server) {
+ return new IModule[]{earModule, childArtifact.getModule()};
+ }
}
}
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IModuleArtifact2.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * 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.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
+
+public interface IModuleArtifact2 extends IModuleArtifact {
+ public IModule getModule();
+ public IModule[] getModuleTree(IServer server);
+ public IModuleArtifact getChildArtifact();
+}
Modified:
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 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IServerModuleStateVerifier.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -23,17 +23,17 @@
/**
* Check to see if the module is started on the server
*/
- public boolean isModuleStarted(IServer server, IModule module, IProgressMonitor
monitor);
+ 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);
+ 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);
+ public void waitModuleStarted(IServer server, IModule module[], int maxDelay);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBoss6ModuleStateVerifier.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -18,13 +18,16 @@
public class JBoss6ModuleStateVerifier extends JBossLT6ModuleStateVerifier implements
IServerModuleStateVerifier {
- protected boolean checkNestedWebModuleStarted(IServer server, IModule module,
MBeanServerConnection connection) throws Exception {
+ @Override
+ protected boolean checkNestedWebModuleStarted(IServer server, IModule module[],
MBeanServerConnection connection) throws Exception {
boolean val = checkStandaloneWebModuleStarted(server, module, connection);
return val;
}
- protected boolean checkStandaloneWebModuleStarted(IServer server, IModule module,
MBeanServerConnection connection) throws Exception {
- String mbeanName =
"jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/"
+ module.getName(); //$NON-NLS-1$
+ @Override
+ protected boolean checkStandaloneWebModuleStarted(IServer server, IModule[] module,
MBeanServerConnection connection) throws Exception {
+ String name =module[module.length-1].getName();
+ String mbeanName =
"jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/"
+ name; //$NON-NLS-1$
String stateAttribute = "state"; //$NON-NLS-1$
Object result = getAttributeResult(connection, mbeanName, stateAttribute);
if(result == null || !(result instanceof Integer) || ((Integer)result).intValue() != 1
) {
Modified:
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 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLT6ModuleStateVerifier.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -10,9 +10,6 @@
******************************************************************************/
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;
@@ -36,7 +33,7 @@
public JBossLT6ModuleStateVerifier() {
// Nothing
}
- public boolean isModuleStarted(final IServer server, final IModule module,
+ public boolean isModuleStarted(final IServer server, final IModule[] module,
final IProgressMonitor monitor) {
final boolean[] result = new boolean[1];
result[0] = false;
@@ -56,7 +53,7 @@
return result[0];
}
- public void waitModuleStarted(IServer server, IModule module, int maxDelay) {
+ public void waitModuleStarted(IServer server, IModule[] module, int maxDelay) {
final NullProgressMonitor monitor = new NullProgressMonitor();
Thread t = new Thread(){
public void run() {
@@ -81,12 +78,12 @@
t.interrupt();
}
}
- public void waitModuleStarted(IServer server, IModule module,
+ public void waitModuleStarted(IServer server, IModule[] module,
IProgressMonitor monitor) {
waitJMX(server, module);
}
- protected void waitJMX(final IServer server, final IModule 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);
@@ -102,7 +99,7 @@
}
}
- protected void jmxWaitForDeploymentStarted(final IServer server, final IModule module,
+ 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$
@@ -120,26 +117,26 @@
}
}
- protected boolean checkDeploymentStarted(final IServer server, final IModule module,
+ protected boolean checkDeploymentStarted(final IServer server, final IModule[] module,
final MBeanServerConnection connection, IProgressMonitor monitor) throws Exception {
- String typeId = module.getModuleType().getId();
+ String typeId = module[module.length-1].getModuleType().getId();
if( typeId.equals("wst.web") || typeId.equals("jst.web")) {
//$NON-NLS-1$ //$NON-NLS-2$
return checkWebModuleStarted(server, module, connection);
}
return true;
}
- protected boolean checkWebModuleStarted(IServer server, IModule module,
MBeanServerConnection connection) throws Exception {
- IModule earParent = findEarParent(server, module);
- if( earParent == null ) {
- return checkStandaloneWebModuleStarted(server, module, connection);
- } else {
+ protected boolean checkWebModuleStarted(IServer server, IModule[] module,
MBeanServerConnection connection) throws Exception {
+ if( module.length > 1) {
return checkNestedWebModuleStarted(server, module, connection);
+ } else {
+ return checkStandaloneWebModuleStarted(server, module, connection);
}
}
- protected boolean checkNestedWebModuleStarted(IServer server, IModule module,
MBeanServerConnection connection) throws Exception {
- String mbeanName = "jboss.deployment:id=\"jboss.web.deployment:war=/" +
module.getName() + "\",type=Component"; //$NON-NLS-1$//$NON-NLS-2$
+ protected boolean checkNestedWebModuleStarted(IServer server, IModule[] module,
MBeanServerConnection connection) throws Exception {
+ String n = module[module.length-1].getName();
+ String mbeanName = "jboss.deployment:id=\"jboss.web.deployment:war=/" +
n + "\",type=Component"; //$NON-NLS-1$//$NON-NLS-2$
String stateAttribute = "State"; //$NON-NLS-1$
Object result = getAttributeResult(connection, mbeanName, stateAttribute);
if( result == null || !result.toString().equals("DEPLOYED")) //$NON-NLS-1$
@@ -147,8 +144,9 @@
return true;
}
- protected boolean checkStandaloneWebModuleStarted(IServer server, IModule module,
MBeanServerConnection connection) throws Exception {
- String mbeanName =
"jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/"
+ module.getName(); //$NON-NLS-1$
+ protected boolean checkStandaloneWebModuleStarted(IServer server, IModule[] module,
MBeanServerConnection connection) throws Exception {
+ String n = module[module.length-1].getName();
+ String mbeanName =
"jboss.web:J2EEApplication=none,J2EEServer=none,j2eeType=WebModule,name=//localhost/"
+ n; //$NON-NLS-1$
String stateAttribute = "state"; //$NON-NLS-1$
Object result = getAttributeResult(connection, mbeanName, stateAttribute);
if(result == null || !(result instanceof Integer) || ((Integer)result).intValue() != 1
) {
@@ -165,21 +163,4 @@
return false;
}
}
-
- /* TODO Unify findEarParent with findRootModule */
- protected 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/JBossLaunchAdapter.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -20,7 +20,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.project.WebUtilities;
import org.eclipse.jst.server.core.EJBBean;
import org.eclipse.jst.server.core.JndiLaunchable;
import org.eclipse.jst.server.core.JndiObject;
@@ -35,8 +34,8 @@
import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.eclipse.wst.server.core.util.WebResource;
-import org.jboss.ide.eclipse.as.core.modules.EarArtifactAdapter.EarModuleArtifact;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.server.IModuleArtifact2;
import org.jboss.ide.eclipse.as.core.server.IMultiModuleURLProvider;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
@@ -63,17 +62,16 @@
public Object getLaunchable(IServer server, IModuleArtifact moduleObject) {
if (server != null) {
ServerDelegate delegate =
(ServerDelegate)server.loadAdapter(ServerDelegate.class,null);
- if( moduleObject instanceof EarModuleArtifact ) {
- EarModuleArtifact earArt = ((EarModuleArtifact)moduleObject);
- IModuleArtifact webArtifact = earArt.getWebArtifact();
+ if( moduleObject instanceof IModuleArtifact2 ) {
+ IModuleArtifact2 rootArt = ((IModuleArtifact2)moduleObject);
+ IModuleArtifact childArt = rootArt.getChildArtifact();
+ IModule[] tree = rootArt.getModuleTree(server);
if( delegate instanceof IMultiModuleURLProvider) {
- URL root = ((IMultiModuleURLProvider)delegate).getModuleRootURL(new
IModule[]{
- earArt.getModule(), webArtifact.getModule()
- });
- return prepareHttpLaunchable(moduleObject, delegate, server, root);
+ URL root = ((IMultiModuleURLProvider)delegate).getModuleRootURL(tree);
+ return prepareHttpLaunchable(rootArt, delegate, server, root);
} else {
// Cannot calculate root url from application.xml for this server type.
- moduleObject = webArtifact;
+ moduleObject = childArt;
}
}
if ((moduleObject instanceof Servlet) ||(moduleObject instanceof WebResource)) {
@@ -214,5 +212,13 @@
public IModule getModule() {
return artifact.getModule();
}
+ public IModuleArtifact getArtifact() {
+ return artifact;
+ }
+ public IModule[] getModuleTree(IServer server) {
+ return artifact instanceof IModuleArtifact2 ?
+ ((IModuleArtifact2)artifact).getModuleTree(server) :
+ new IModule[]{getModule()};
+ }
}
}
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-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -25,7 +25,6 @@
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
-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;
@@ -41,7 +40,6 @@
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;
@@ -129,7 +127,7 @@
if( props != null && props.canVerifyRemoteModuleState()) {
IServerModuleStateVerifier verifier = props.getModuleStateVerifier();
if( verifier != null ) {
- verifier.waitModuleStarted(getServer(), module[module.length-1], 20000);
+ verifier.waitModuleStarted(getServer(), module, 20000);
}
}
}
Modified:
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 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -11,10 +11,6 @@
******************************************************************************/
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;
@@ -34,7 +30,7 @@
import org.jboss.ide.eclipse.as.management.core.JBoss7ManagerUtil;
public class JBoss7ModuleStateVerifier implements IServerModuleStateVerifier {
- public void waitModuleStarted(IServer server, IModule module, int maxDelay) {
+ public void waitModuleStarted(IServer server, IModule[] module, int maxDelay) {
final NullProgressMonitor monitor = new NullProgressMonitor();
Thread t = new Thread(){
public void run() {
@@ -60,16 +56,15 @@
}
}
- public boolean isModuleStarted(IServer server, IModule module,
+ public boolean isModuleStarted(IServer server, IModule[] module,
IProgressMonitor monitor) {
- IModule rootModule = findRootModule(server, module);
try {
- return isRootModuleStarted(server, rootModule, monitor);
+ return isRootModuleStarted(server, module[0], 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);
+ NLS.bind(er, module[0].getName(), server.getName()), e);
ServerLogger.getDefault().log(server, s);
return false;
}
@@ -95,23 +90,22 @@
}
- public void waitModuleStarted(IServer server, IModule module, IProgressMonitor monitor)
{
- IModule rootModule = findRootModule(server, module);
+ public void waitModuleStarted(IServer server, IModule[] module, IProgressMonitor
monitor) {
try {
JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server,
JBoss7Server.class);
IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{rootModule}, jbossServer);
+ IPath deployPath = PublishUtil.getDeployPath(new IModule[]{module[0]}, jbossServer);
boolean waitedOnce = false;
while (!monitor.isCanceled()) {
- boolean done = isRootModuleStarted(server, rootModule, service, deployPath,
monitor);
+ boolean done = isRootModuleStarted(server, module[0], 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);
+ NLS.bind(info, module[0].getName(), server.getName()),null);
ServerLogger.getDefault().log(server, s);
}
waitedOnce = true;
@@ -125,33 +119,14 @@
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);
+ NLS.bind(warning, module[0].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);
+ NLS.bind(er, module[0].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/LocalJBoss7DeploymentScannerAdditions.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -15,7 +15,10 @@
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerEvent;
@@ -116,9 +119,14 @@
return AS7DeploymentScannerUtility.SCANNER_PREFIX + i;
}
- public void serverChanged(ServerEvent event) {
+ public void serverChanged(final ServerEvent event) {
if( accepts(event.getServer()) && serverSwitchesToState(event,
IServer.STATE_STARTED)){
- modifyDeploymentScanners(event);
+ new Job("Update AS7 Deployment Scanners") { //$NON-NLS-1$
+ protected IStatus run(IProgressMonitor monitor) {
+ modifyDeploymentScanners(event);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
}
}
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-05-04
11:50:06 UTC (rev 40788)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/launch/JBTWebLaunchableClient.java 2012-05-04
12:17:57 UTC (rev 40789)
@@ -57,7 +57,7 @@
public IStatus launch2(IServer server, Object launchable, String launchMode, ILaunch
launch) {
final JBTCustomHttpLaunchable http = (JBTCustomHttpLaunchable) launchable;
- wait(server, http.getModule());
+ wait(server, http.getModuleTree(server));
if(server.getServerState() == server.STATE_STARTED) {
Display.getDefault().asyncExec(new Runnable(){
@@ -73,7 +73,7 @@
return null;
}
- protected void wait(final IServer server, final IModule module) {
+ 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);