View Javadoc

1   /**
2    * Copyright 2006 Matthew Purland (m.purland@gmail.com)
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  package net.sf.mud4j.web.server;
17  
18  import java.io.IOException;
19  
20  /**
21   * Provide interface for configuring a web server.
22   * 
23   * @author Matthew Purland
24   */
25  public interface WebServer {
26      /**
27       * Start the webserver.
28       *
29       * @throws IOException in case of I/O problems or the server won't start.
30       */
31      void start() throws IOException;
32      
33      /**
34       * Stop the webserver.
35       * 
36       * @throws IOException in case of I/O problems or if it can't stop the server.
37       */
38      void stop() throws IOException;
39      
40      /**
41       * Whether the web server is started.
42       * 
43       * @return Returns whether the web server is currently started.
44       */
45      boolean isStarted();
46      
47      /**
48       * Whether the web server is stopped.
49       * 
50       * @returns Returns whether the web server is stopped.
51       */
52      boolean isStopped();
53  }