[160510] Null client not working
diff --git a/plugins/org.eclipse.wst.server.core/plugin.properties b/plugins/org.eclipse.wst.server.core/plugin.properties
index cf4ddf5..c81668e 100644
--- a/plugins/org.eclipse.wst.server.core/plugin.properties
+++ b/plugins/org.eclipse.wst.server.core/plugin.properties
@@ -29,3 +29,6 @@
moduleTypeUnknown=Unknown module
moduleTypeStaticWebName=Static Web project
+
+clientNoneName=Do nothing
+clientNoneDescription=Launch the module on the server but do not bring up a client application.
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/plugin.xml b/plugins/org.eclipse.wst.server.core/plugin.xml
index 0f905c9..3eb42a8 100644
--- a/plugins/org.eclipse.wst.server.core/plugin.xml
+++ b/plugins/org.eclipse.wst.server.core/plugin.xml
@@ -17,7 +17,7 @@
<extension-point id="internalStartup" name="%extensionPointServerStartup" schema="schema/startup.exsd"/>
<extension-point id="installableServers" name="%extensionPointInstallableServers" schema="schema/installableServers.exsd"/>
<extension-point id="installableRuntimes" name="%extensionPointInstallableRuntimes" schema="schema/installableRuntimes.exsd"/>
-
+
<extension point="org.eclipse.wst.server.core.moduleTypes">
<moduleType
id="*"
@@ -26,4 +26,19 @@
id="wst.web"
name="%moduleTypeStaticWebName"/>
</extension>
+
+ <extension point="org.eclipse.wst.server.core.launchableAdapters">
+ <launchableAdapter
+ class="org.eclipse.wst.server.core.internal.NullLaunchableAdapterDelegate"
+ id="org.eclipse.wst.server.core.null"/>
+ </extension>
+
+ <extension point="org.eclipse.wst.server.core.clients">
+ <client
+ id="org.eclipse.wst.server.core.null"
+ name="%clientNoneLabel"
+ description="%clientNoneDescription"
+ launchable="org.eclipse.wst.server.core.util.NullModuleArtifact"
+ class="org.eclipse.wst.server.core.internal.NullClientDelegate"/>
+ </extension>
</plugin>
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/NullClientDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/NullClientDelegate.java
new file mode 100644
index 0000000..dc71147
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/NullClientDelegate.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.core.internal;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.debug.core.ILaunch;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.ClientDelegate;
+/**
+ * A client delegate that does nothing. Application will be launched
+ * for the user, but no client application will open.
+ */
+public class NullClientDelegate extends ClientDelegate {
+ public boolean supports(IServer server, Object launchable, String launchMode) {
+ return launchable instanceof NullLaunchableAdapterDelegate.NullLaunchable;
+ }
+
+ public IStatus launch(IServer server, Object launchable, String launchMode, ILaunch launch) {
+ return Status.OK_STATUS;
+ }
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/NullLaunchableAdapterDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/NullLaunchableAdapterDelegate.java
new file mode 100644
index 0000000..6c04f39
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/NullLaunchableAdapterDelegate.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.server.core.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.server.core.IModuleArtifact;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.model.LaunchableAdapterDelegate;
+import org.eclipse.wst.server.core.util.NullModuleArtifact;
+/**
+ * A client delegate that does nothing. Application will be launched
+ * for the user, but no client application will open.
+ */
+public class NullLaunchableAdapterDelegate extends LaunchableAdapterDelegate {
+ public class NullLaunchable {
+ // class is used just for tagging
+ public String toString() {
+ return "NullLaunchable";
+ }
+ }
+
+ public Object NULL_LAUNCHABLE = new NullLaunchable();
+
+ public Object getLaunchable(IServer server, IModuleArtifact moduleArtifact) throws CoreException {
+ if (moduleArtifact instanceof NullModuleArtifact)
+ return NULL_LAUNCHABLE;
+ return null;
+ }
+}
\ No newline at end of file