1 /******************************************************************************* 2 * Copyright (c) 2009, 2019 Mountainminds GmbH & Co. KG and Contributors 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * Marc R. Hoffmann - initial API and implementation 10 * 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