1 package com.quadcap.services; 2 3 40 41 import java.io.BufferedInputStream ; 42 import java.io.FileInputStream ; 43 44 import java.util.Properties ; 45 46 import luxor.browser.albert.BrowserLauncher; 47 48 import com.quadcap.server.ServiceImpl; 49 import com.quadcap.server.ServiceContainer; 50 51 import com.quadcap.http.server22.WebServer; 52 53 import com.quadcap.util.Debug; 54 55 61 public class WebService extends ServiceImpl { 62 WebServer web; 63 64 public void init(ServiceContainer c, Properties p) 65 throws Exception 66 { 67 super.init(c, p); 68 web = new WebServer(); 69 Debug.println(0, "WebService.init(" + p + ")"); 70 Properties props = getProperties(); 71 web.init(props); 72 String launch = props.getProperty("launch-url"); 73 if (launch != null) { 74 Debug.println("Launching initial URL: " + launch); 75 try { 76 BrowserLauncher.openURL(launch); 77 } catch (Throwable t) { 78 Debug.println("Exception launching URL: " + launch); 79 Debug.print(t); 80 } 81 } 82 } 83 84 public void stop() { 85 web.stop(); 86 } 87 } 88 | Popular Tags |