1 /* Copyright 2004-2005 Graeme Rocher
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *      http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 package grails.web.container;
16 
17 /**
18  * Defines the container implementation used by Grails during development.
19  *
20  * @author Graeme Rocher
21  * @since 1.1
22  */
23 public interface EmbeddableServer {
24 
25     int DEFAULT_SECURE_PORT = 8443;
26     int DEFAULT_PORT = 8080;
27     String DEFAULT_HOST = "localhost";
28 
29     /**
30      * Starts the container on the default port
31      */
start()32     void start();
33 
34     /**
35      * Starts the container on the given port
36      * @param port The port number
37      */
start(int port)38     void start(int port);
39 
40     /**
41      * Starts the container on the given port
42      * @param host The host to start on
43      * @param port The port number
44      */
start(String host, int port)45     void start(String host, int port);
46 
47     /**
48      * Starts a secure container running over HTTPS
49      */
startSecure()50     void startSecure();
51 
52     /**
53      * Starts a secure container running over HTTPS for the given port
54      * @param port The port
55      */
startSecure(int port)56     void startSecure(int port);
57 
58     /**
59      * Starts a secure container running over HTTPS for the given port and host.
60      * @param host The server host
61      * @param httpPort The port for HTTP traffic.
62      * @param httpsPort The port for HTTPS traffic.
63      */
startSecure(String host, int httpPort, int httpsPort)64     void startSecure(String host, int httpPort, int httpsPort);
65 
66     /**
67      * Stops the container
68      */
stop()69     void stop();
70 
71     /**
72      * Typically combines the stop() and start() methods in order to restart the container
73      */
restart()74     void restart();
75 }
76