001/* 002 * (C) Copyright 2010-2011 Nuxeo SAS (http://nuxeo.com/) and contributors. 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the GNU Lesser General Public License 006 * (LGPL) version 2.1 which accompanies this distribution, and is available at 007 * http://www.gnu.org/licenses/lgpl.html 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Lesser General Public License for more details. 013 * 014 * Contributors: 015 * Julien Carsique 016 * 017 * $Id$ 018 */ 019 020package org.nuxeo.launcher; 021 022import java.util.ArrayList; 023import java.util.Collection; 024import java.util.List; 025 026import org.nuxeo.launcher.config.ConfigurationGenerator; 027import org.nuxeo.launcher.config.JettyConfigurator; 028 029/** 030 * Main Nuxeo server thread 031 * 032 * @author jcarsique 033 * @since 5.4.2 034 */ 035public class NuxeoJettyLauncher extends NuxeoLauncher { 036 037 /** 038 * @param configurationGenerator 039 */ 040 public NuxeoJettyLauncher(ConfigurationGenerator configurationGenerator) { 041 super(configurationGenerator); 042 throw new UnsupportedOperationException(); 043 } 044 045 @Override 046 protected String getClassPath() { 047 String cp = "."; 048 cp = addToClassPath(cp, "lib"); 049 cp = addToClassPath(cp, "nuxeo-runtime-launcher-*.jar"); 050 cp = addToClassPath(cp, "bundles"); 051 return cp; 052 } 053 054 @Override 055 protected void setServerStartCommand(List<String> command) { 056 command.add(JettyConfigurator.STARTUP_CLASS); 057 command.add("-home"); 058 command.add(configurationGenerator.getNuxeoHome().getPath()); 059 } 060 061 @Override 062 protected void setServerStopCommand(List<String> command) { 063 command.add(JettyConfigurator.STARTUP_CLASS); 064 command.add("stop"); 065 } 066 067 @Override 068 protected Collection<? extends String> getServerProperties() { 069 ArrayList<String> serverProperties = new ArrayList<>(); 070 return serverProperties; 071 } 072 073 @Override 074 protected String getServerPrint() { 075 return JettyConfigurator.STARTUP_CLASS; 076 } 077 078 @Override 079 protected String getShutdownClassPath() { 080 return getClassPath(); 081 } 082 083}