| 1 22 23 package apollo; 24 25 import java.io.*; 26 import java.net.*; 27 import apollo.dev.browser.*; 28 import apollo.jnlp.*; 29 import apollo.spi.*; 30 import houston.*; 31 32 public class HouseholdBrowser 33 { 34 35 private static HouseholdBrowser _instance; 36 private BrowserService _service; 37 38 private HouseholdBrowser() 39 { 40 try 42 { 43 Class clazz = Class.forName( "javax.jnlp.ServiceManager" ); 44 45 58 _service = new JnlpBrowserService( new SpencerBrowserService() ); 59 } 60 catch( ClassNotFoundException ex ) 61 { 62 _service = new SpencerBrowserService(); 63 } 64 } 65 66 private BrowserService getService() 67 { 68 return _service; 69 } 70 71 public static void showDocument( URL url ) 72 { 73 if( url == null ) 74 return; 75 76 instance().getService().showDocument( url ); 77 } 78 79 public static void showDocument( String url ) 80 { 81 try 82 { 83 showDocument( new URL( url ) ); 84 } 85 catch( MalformedURLException mex ) 86 { 87 Status.error( "*** invalid URL " + url + ": " + mex.toString() ); 88 } 89 } 90 91 private static HouseholdBrowser instance() 92 { 93 if( _instance == null ) 94 _instance = new HouseholdBrowser(); 95 96 return _instance; 97 } 98 99 } 100 | Popular Tags |