KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > spi > resolver > ResolverDefault


1 /*
2  * @(#)ResolverDefault.java 1.7 03/12/19
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.spi.resolver ;
9
10 import java.io.File JavaDoc ;
11
12 import com.sun.corba.se.impl.resolver.LocalResolverImpl ;
13 import com.sun.corba.se.impl.resolver.ORBInitRefResolverImpl ;
14 import com.sun.corba.se.impl.resolver.ORBDefaultInitRefResolverImpl ;
15 import com.sun.corba.se.impl.resolver.BootstrapResolverImpl ;
16 import com.sun.corba.se.impl.resolver.CompositeResolverImpl ;
17 import com.sun.corba.se.impl.resolver.INSURLOperationImpl ;
18 import com.sun.corba.se.impl.resolver.SplitLocalResolverImpl ;
19 import com.sun.corba.se.impl.resolver.FileResolverImpl ;
20
21 import com.sun.corba.se.spi.orb.ORB ;
22 import com.sun.corba.se.spi.orb.Operation ;
23 import com.sun.corba.se.spi.orb.StringPair ;
24
25 /** Utility class that provides factory methods for all of the
26  * standard resolvers that we provide.
27  */

28 public class ResolverDefault {
29     /** Return a local resolver that simply stores bindings in a map.
30     */

31     public static LocalResolver makeLocalResolver( )
32     {
33     return new LocalResolverImpl() ;
34     }
35
36     /** Return a resolver that relies on configured values of ORBInitRef for data.
37     */

38     public static Resolver makeORBInitRefResolver( Operation urlOperation,
39     StringPair[] initRefs )
40     {
41     return new ORBInitRefResolverImpl( urlOperation, initRefs ) ;
42     }
43
44     public static Resolver makeORBDefaultInitRefResolver( Operation urlOperation,
45     String JavaDoc defaultInitRef )
46     {
47     return new ORBDefaultInitRefResolverImpl( urlOperation,
48         defaultInitRef ) ;
49     }
50
51     /** Return a resolver that uses the proprietary bootstrap protocol
52     * to implement a resolver. Obtains the necessary host and port
53     * information from the ORB.
54     */

55     public static Resolver makeBootstrapResolver( ORB orb, String JavaDoc host, int port )
56     {
57     return new BootstrapResolverImpl( orb, host, port ) ;
58     }
59
60     /** Return a resolver composed of the two given resolvers. result.list() is the
61     * union of first.list() and second.list(). result.resolve( name ) returns
62     * first.resolve( name ) if that is not null, otherwise returns the result of
63     * second.resolve( name ).
64     */

65     public static Resolver makeCompositeResolver( Resolver first, Resolver second )
66     {
67     return new CompositeResolverImpl( first, second ) ;
68     }
69
70     public static Operation makeINSURLOperation( ORB orb, Resolver bootstrapResolver )
71     {
72     return new INSURLOperationImpl(
73         (com.sun.corba.se.spi.orb.ORB)orb, bootstrapResolver ) ;
74     }
75
76     public static LocalResolver makeSplitLocalResolver( Resolver resolver,
77     LocalResolver localResolver )
78     {
79     return new SplitLocalResolverImpl( resolver, localResolver ) ;
80     }
81
82     public static Resolver makeFileResolver( ORB orb, File JavaDoc file )
83     {
84     return new FileResolverImpl( orb, file ) ;
85     }
86 }
87
88
Popular Tags