1 /*
2  * JBoss, Home of Professional Open Source.
3  * Copyright 2014 Red Hat, Inc., and individual contributors
4  * as indicated by the @author tags.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  */

18
19 package io.undertow.servlet.api;
20
21 import javax.servlet.ServletException;
22
23 import io.undertow.server.HttpHandler;
24
25 /**
26  * Manager that can be used to deploy and undeploy a servlet deployment.
27  *
28  * @author Stuart Douglas
29  */

30 public interface DeploymentManager {
31
32     /**
33      * Perform the initial deployment.
34      *
35      * The builds all the internal metadata needed to support the servlet deployment, but will not actually start
36      * any servlets
37      *
38      */

39     void deploy();
40
41     /**
42      * Starts the container. Any Servlets with init on startup will be created here. This method returns the servlet
43      * path handler, which must then be added into the appropriate place in the path handler tree.
44      *
45      */

46     HttpHandler start() throws ServletException;
47
48     void stop() throws ServletException;
49
50     void undeploy();
51
52     State getState();
53
54     /**
55      *
56      */

57     Deployment getDeployment();
58
59     enum State {
60         UNDEPLOYED,
61         DEPLOYED,
62         STARTED;
63     }
64 }
65