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.ORB ; 6 7 import com.sun.corba.se.spi.orb.Operation ; 8 import com.sun.corba.se.spi.orb.StringPair ; 9 10 public class ORBInitRefResolverImpl implements Resolver { 11 Operation urlHandler ; 12 java.util.Map orbInitRefTable ; 13 14 public ORBInitRefResolverImpl( Operation urlHandler, StringPair[] initRefs ) 15 { 16 this.urlHandler = urlHandler ; 17 orbInitRefTable = new java.util.HashMap () ; 18 19 for( int i = 0; i < initRefs.length ; i++ ) { 20 StringPair sp = initRefs[i] ; 21 orbInitRefTable.put( sp.getFirst(), sp.getSecond() ) ; 22 } 23 } 24 25 public org.omg.CORBA.Object resolve( String ident ) 26 { 27 String url = (String )orbInitRefTable.get( ident ) ; 28 if (url == null) 29 return null ; 30 31 org.omg.CORBA.Object result = 32 (org.omg.CORBA.Object )urlHandler.operate( url ) ; 33 return result ; 34 } 35 36 public java.util.Set list() 37 { 38 return orbInitRefTable.keySet() ; 39 } 40 } 41 | Popular Tags |