[170967] Add API for IServerModule
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java
new file mode 100644
index 0000000..ec8c2f9
--- /dev/null
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/IServerModule.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 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.ui;
+
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+/**
+ * A helper interface for modules that are deployed to a server, commonly
+ * used to help actions interact with modules in the Servers view.
+ */
+public interface IServerModule {
+ /**
+ * Return the server that the module belongs to.
+ *
+ * @return the server
+ */
+ public IServer getServer();
+
+ /**
+ * Returns the module.
+ *
+ * @return the module
+ */
+ public IModule[] getModule();
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleServer.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleServer.java
index b20224d..2abe705 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleServer.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/view/servers/ModuleServer.java
@@ -12,10 +12,11 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.IServerModule;
/**
* A utility class for referencing a server and a module at the same time.
*/
-public class ModuleServer {
+public class ModuleServer implements IServerModule {
/**
* The server
*/
@@ -40,6 +41,24 @@
}
/**
+ * Return the server that the module belongs to.
+ *
+ * @return the server
+ */
+ public IServer getServer() {
+ return server;
+ }
+
+ /**
+ * Returns the module.
+ *
+ * @return the module
+ */
+ public IModule[] getModule() {
+ return module;
+ }
+
+ /**
* @see Object#equals(Object)
*/
public boolean equals(Object obj) {