KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > resolver > ORBDefaultInitRefResolverImpl


1 package com.sun.corba.se.impl.resolver ;
2
3 import com.sun.corba.se.spi.resolver.Resolver ;
4
5 import com.sun.corba.se.spi.orb.Operation ;
6
7 public class ORBDefaultInitRefResolverImpl implements Resolver {
8     Operation urlHandler ;
9     String JavaDoc orbDefaultInitRef ;
10
11     public ORBDefaultInitRefResolverImpl( Operation urlHandler, String JavaDoc orbDefaultInitRef )
12     {
13     this.urlHandler = urlHandler ;
14
15     // XXX Validate the URL?
16
this.orbDefaultInitRef = orbDefaultInitRef ;
17     }
18
19     public org.omg.CORBA.Object JavaDoc resolve( String JavaDoc ident )
20     {
21         // If the ORBDefaultInitRef is not defined simply return null
22
if( orbDefaultInitRef == null ) {
23         return null;
24         }
25
26         String JavaDoc urlString;
27         // If the ORBDefaultInitDef is defined as corbaloc: then create the
28
// corbaloc String in the format
29
// <ORBInitDefaultInitDef Param>/<Identifier>
30
// and resolve it using resolveCorbaloc method
31
if( orbDefaultInitRef.startsWith( "corbaloc:" ) ) {
32             urlString = orbDefaultInitRef + "/" + ident;
33         } else {
34             urlString = orbDefaultInitRef + "#" + ident;
35         }
36
37     return (org.omg.CORBA.Object JavaDoc)urlHandler.operate( urlString ) ;
38     }
39
40     public java.util.Set JavaDoc list()
41     {
42     return new java.util.HashSet JavaDoc() ;
43     }
44 }
45
Popular Tags