1 /******************************************************************************* 2 * Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors 3 * This program and the accompanying materials are made available under 4 * the terms of the Eclipse Public License 2.0 which is available at 5 * http://www.eclipse.org/legal/epl-2.0 6 * 7 * SPDX-License-Identifier: EPL-2.0 8 * 9 * Contributors: 10 * Marc R. Hoffmann - initial API and implementation 11 * 12 *******************************************************************************/ 13 import java.io.File; 14 15 /** 16 * Simple server which runs as long a termination file is created. 17 */ 18 public class Server { 19 main(String[] args)20 public static void main(String[] args) throws Exception { 21 System.out.println("Test server started"); 22 23 // Wait for termination file to turn up 24 // This option puts the target in a pseudo 'server' mode 25 if (args.length == 1) { 26 final File termFile = new File(args[0]); 27 28 while (!termFile.exists()) { 29 Thread.sleep(100); 30 } 31 } 32 33 System.out.println("Test server stopped"); 34 } 35 36 } 37