1 7 8 package com.sun.corba.se.impl.orb ; 9 10 import java.applet.Applet ; 11 import java.util.Properties ; 12 import java.net.URL ; 13 14 import com.sun.corba.se.spi.orb.DataCollector ; 15 16 public abstract class DataCollectorFactory { 17 private DataCollectorFactory() {} 18 19 public static DataCollector create( Applet app, Properties props, 20 String localHostName ) 21 { 22 String appletHost = localHostName ; 23 24 if (app != null) { 25 URL appletCodeBase = app.getCodeBase() ; 26 27 if (appletCodeBase != null) 28 appletHost = appletCodeBase.getHost() ; 29 } 30 31 return new AppletDataCollector( app, props, localHostName, 32 appletHost ) ; 33 } 34 35 public static DataCollector create( String [] args, Properties props, 36 String localHostName ) 37 { 38 return new NormalDataCollector( args, props, localHostName, 39 localHostName ) ; 40 } 41 42 public static DataCollector create( Properties props, 43 String localHostName ) 44 { 45 return new PropertyOnlyDataCollector( props, localHostName, 46 localHostName ) ; 47 } 48 } 49 | Popular Tags |