Author: rob.stryker(a)jboss.com
Date: 2012-01-13 02:36:48 -0500 (Fri, 13 Jan 2012)
New Revision: 37809
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/JBossServer.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
Log:
JBIDE-10514 - recent change caused a regression for run on server. (Changed heirarchy of
ExpressServer, forgot to implement IURLProvider)
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-01-13
07:11:12 UTC (rev 37808)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossLaunchAdapter.java 2012-01-13
07:36:48 UTC (rev 37809)
@@ -76,8 +76,8 @@
public Object getLaunchable(IServer server, IModuleArtifact moduleObject) {
if (server != null) {
ServerDelegate delegate =
(ServerDelegate)server.loadAdapter(ServerDelegate.class,null);
- if (!(delegate instanceof JBossServer ))
- return null;
+// if (!(delegate instanceof JBossServer ))
+// return null;
if ((moduleObject instanceof Servlet) ||(moduleObject instanceof WebResource))
return prepareHttpLaunchable(moduleObject, delegate, server);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2012-01-13
07:11:12 UTC (rev 37808)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2012-01-13
07:36:48 UTC (rev 37809)
@@ -210,17 +210,19 @@
}
public URL getModuleRootURL(IModule module) {
+ return getModuleRootURL(module, getHost(), getJBossWebPort());
+ }
+
+ public static URL getModuleRootURL(IModule module, String host, int port) {
if (module == null || module.loadAdapter(IWebModule.class,null)==null )
return null;
IWebModule webModule =(IWebModule)module.loadAdapter(IWebModule.class,null);
- String host = getHost();
String url = host;
if( !url.startsWith("http://") &&
!url.startsWith("https://") ) { //$NON-NLS-1$ //$NON-NLS-2$
url = "http://"+host; //$NON-NLS-1$
}
- int port = getJBossWebPort();
if (port != 80)
url += ":" + port; //$NON-NLS-1$
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-01-13
07:11:12 UTC (rev 37808)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressServer.java 2012-01-13
07:36:48 UTC (rev 37809)
@@ -10,17 +10,21 @@
*******************************************************************************/
package org.jboss.tools.openshift.express.internal.core.behaviour;
+import java.net.URL;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.ServerDelegate;
+import org.eclipse.wst.server.core.model.IURLProvider;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-public class ExpressServer extends ServerDelegate {
+public class ExpressServer extends ServerDelegate implements IURLProvider {
public void setDefaults(IProgressMonitor monitor) {
super.setDefaults(monitor);
setAttribute(IDeployableServer.SERVER_MODE, ExpressBehaviourDelegate.OPENSHIFT_ID);
@@ -33,6 +37,9 @@
// Can only add a module if the server has zero, and even then, can only add 1.
IModule[] mods = getServer().getModules();
+ if( mods.length == 1 && add.length == 1 && add[0].equals(mods[0]))
+ return Status.OK_STATUS;
+
boolean canModify = mods.length == 0 && add.length == 1;
canModify &= remove.length == 0;
return canModify ? Status.OK_STATUS : new Status(IStatus.ERROR,
@@ -57,4 +64,8 @@
IProgressMonitor monitor) throws CoreException {
}
+ @Override
+ public URL getModuleRootURL(IModule module) {
+ return JBossServer.getModuleRootURL(module, getServer().getHost(), 80);
+ }
}
Show replies by date