| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| NotificationServer |
|
| 3.0;3 |
| 1 | /* | |
| 2 | * Copyright 2007-2008 The Kuali Foundation | |
| 3 | * | |
| 4 | * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php | |
| 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 org.kuali.rice.ken.util; | |
| 17 | ||
| 18 | import org.mortbay.jetty.Server; | |
| 19 | import org.mortbay.jetty.deployer.WebAppDeployer; | |
| 20 | ||
| 21 | /** | |
| 22 | * Starts up Jetty pointing to an existing installation location. | |
| 23 | * This is useful for testing/debugging. To use this class (with the default | |
| 24 | * webapp dir location), generate a Quickstart in dist/ before running | |
| 25 | * this class. | |
| 26 | * Implementation derived from this discussion: http://www.nabble.com/Re:-Embedded-Jetty6-with-AXIS2-p8960637.html | |
| 27 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 28 | */ | |
| 29 | 0 | public class NotificationServer { |
| 30 | public static void main(String[] args) throws Exception { | |
| 31 | // default to quickstart location | |
| 32 | 0 | String webappDir = "./dist/quickstart/webapps"; |
| 33 | 0 | if (args.length > 0) { |
| 34 | 0 | webappDir = args[0]; |
| 35 | } | |
| 36 | 0 | int port = 8080; |
| 37 | 0 | if (args.length > 1) { |
| 38 | 0 | port = Integer.parseInt(args[1]); |
| 39 | } | |
| 40 | ||
| 41 | 0 | Server server = new Server(port); |
| 42 | ||
| 43 | 0 | WebAppDeployer webAppDeployer = new WebAppDeployer(); |
| 44 | 0 | webAppDeployer.setContexts(server); |
| 45 | 0 | webAppDeployer.setWebAppDir(webappDir); |
| 46 | 0 | webAppDeployer.setParentLoaderPriority(false); |
| 47 | 0 | webAppDeployer.setExtract(true); |
| 48 | ||
| 49 | 0 | server.addLifeCycle(webAppDeployer); |
| 50 | ||
| 51 | 0 | server.setStopAtShutdown(true); |
| 52 | 0 | server.setSendServerVersion(true); |
| 53 | ||
| 54 | 0 | server.start(); |
| 55 | 0 | server.join(); |
| 56 | 0 | } |
| 57 | } |