KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > orb > DataCollectorFactory


1 /*
2  * @(#)DataCollectorFactory.java 1.10 04/06/21
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.corba.se.impl.orb ;
9
10 import java.applet.Applet JavaDoc ;
11 import java.util.Properties JavaDoc ;
12 import java.net.URL JavaDoc ;
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 JavaDoc app, Properties JavaDoc props,
20     String JavaDoc localHostName )
21     {
22     String JavaDoc appletHost = localHostName ;
23
24     if (app != null) {
25         URL JavaDoc 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 JavaDoc[] args, Properties JavaDoc props,
36     String JavaDoc localHostName )
37     {
38     return new NormalDataCollector( args, props, localHostName,
39         localHostName ) ;
40     }
41
42     public static DataCollector create( Properties JavaDoc props,
43     String JavaDoc localHostName )
44     {
45     return new PropertyOnlyDataCollector( props, localHostName,
46         localHostName ) ;
47     }
48 }
49
Popular Tags