| 1 | /* | |
| 2 | * Copyright (c) 2015 Maxim Yunusov | |
| 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 | ||
| 16 | package org.maxur.perfmodel.backend.service; | |
| 17 | ||
| 18 | import org.slf4j.Logger; | |
| 19 | ||
| 20 | import javax.inject.Named; | |
| 21 | ||
| 22 | import static org.slf4j.LoggerFactory.getLogger; | |
| 23 | ||
| 24 | /** | |
| 25 | * This Abstract class represents interface of Web Server. | |
| 26 | * | |
| 27 | * @author myunusov | |
| 28 | * @version 1.0 | |
| 29 | * @since <pre>30.08.2015</pre> | |
| 30 | */ | |
| 31 | public abstract class WebServer { | |
| 32 | ||
| 33 | private static final Logger LOGGER = getLogger(WebServer.class); | |
| 34 | ||
| 35 | protected static final String WEB_APP_URL = "/"; | |
| 36 | ||
| 37 | public static final String REST_APP_URL = "api/"; | |
| 38 | ||
| 39 | @SuppressWarnings("unused") | |
| 40 | @Named("webapp.folderName") | |
| 41 | private String webappUrl; | |
| 42 | ||
| 43 | /** | |
| 44 | * Start Web server. | |
| 45 | */ | |
| 46 | public void start() { | |
| 47 | LOGGER.info("Start Web Server ({})", version()); | |
| 48 |
1
1. start : removed call to org/maxur/perfmodel/backend/service/WebServer::launch → NO_COVERAGE |
launch(); |
| 49 | LOGGER.info("Starting on " + webappUrl); | |
| 50 | } | |
| 51 | ||
| 52 | /** | |
| 53 | * Restart Web server. | |
| 54 | */ | |
| 55 | public void restart() { | |
| 56 | LOGGER.info("Restart Web Server"); | |
| 57 |
1
1. restart : removed call to org/maxur/perfmodel/backend/service/WebServer::launch → NO_COVERAGE |
launch(); |
| 58 | LOGGER.info("Starting on " + webappUrl); | |
| 59 | } | |
| 60 | ||
| 61 | /** | |
| 62 | * Stop Web server. | |
| 63 | */ | |
| 64 | public void stop() { | |
| 65 | LOGGER.info("Stop Web Server"); | |
| 66 |
1
1. stop : removed call to org/maxur/perfmodel/backend/service/WebServer::shutdown → NO_COVERAGE |
shutdown(); |
| 67 | } | |
| 68 | ||
| 69 | protected abstract String version(); | |
| 70 | ||
| 71 | protected abstract void launch(); | |
| 72 | ||
| 73 | protected abstract void shutdown(); | |
| 74 | ||
| 75 | public abstract boolean isStarted(); | |
| 76 | ||
| 77 | } | |
Mutations | ||
| 48 |
1.1 |
|
| 57 |
1.1 |
|
| 66 |
1.1 |