KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > internal > appserver > IWebappServer


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.help.internal.appserver;
12
13 import org.eclipse.core.runtime.*;
14
15 /**
16  * Interface to be implemented by the app servers that are contributed to the
17  * org.eclipse.webapp.server extension point. The implementors of this class
18  * should ensure that webapps are running in an environment in which they can
19  * see their classes, the J2SE/J2EE classes, as well as classes loaded by the
20  * custom class loader.
21  *
22  * @since 2.1
23  * @deprecated This internal interface is no longer used by the Eclipse Help
24  * system and should not be used by anyone else. It is likely to be removed
25  * in a future release.
26  * Use the HTTP service implementation provided by Equinox that is based
27  * on Jetty, see http://www.eclipse.org/equinox/server.
28  */

29 public interface IWebappServer {
30     /**
31      * Starts the server on specified host/port. Must be called before running a
32      * webapp.
33      *
34      * @param port
35      * port to listen to. Pass 0 to let the system pick up a port.
36      * @param host
37      * server host. Can be an IP address or a server name
38      */

39     public void start(int port, String JavaDoc host) throws CoreException;
40
41     /**
42      * Stops the app server.
43      */

44     public void stop() throws CoreException;
45
46     /**
47      * Checks if the app server is running
48      */

49     public boolean isRunning();
50
51     /**
52      * Runs a webapp on the server.
53      *
54      * @param webappName
55      * the name of the web app (also knowns as application context)
56      * @param path
57      * path to the webapp directory or WAR file.
58      * @param customLoader
59      * optional class loader to add to the default webapp class
60      * loader
61      */

62     public void start(String JavaDoc webappName, IPath path, ClassLoader JavaDoc customLoader)
63             throws CoreException;
64
65     /**
66      * Stops the specified webapp.
67      */

68     public void stop(String JavaDoc webappName) throws CoreException;
69
70     /**
71      * Returns the port number the app server listens on.
72      *
73      * @return integer port number, 0 if server not started
74      */

75     public int getPort();
76
77     /**
78      * Returns the host name or ip the app server runs on.
79      *
80      * @return String representaion of host name of IP, null if server not
81      * started yet
82      */

83     public String JavaDoc getHost();
84 }
85
Popular Tags