1. package com.sun.corba.se.impl.resolver ;
  2. import com.sun.corba.se.spi.resolver.Resolver ;
  3. import com.sun.corba.se.spi.orb.ORB ;
  4. import com.sun.corba.se.spi.orb.Operation ;
  5. import com.sun.corba.se.spi.orb.StringPair ;
  6. public class ORBInitRefResolverImpl implements Resolver {
  7. Operation urlHandler ;
  8. java.util.Map orbInitRefTable ;
  9. public ORBInitRefResolverImpl( Operation urlHandler, StringPair[] initRefs )
  10. {
  11. this.urlHandler = urlHandler ;
  12. orbInitRefTable = new java.util.HashMap() ;
  13. for( int i = 0; i < initRefs.length ; i++ ) {
  14. StringPair sp = initRefs[i] ;
  15. orbInitRefTable.put( sp.getFirst(), sp.getSecond() ) ;
  16. }
  17. }
  18. public org.omg.CORBA.Object resolve( String ident )
  19. {
  20. String url = (String)orbInitRefTable.get( ident ) ;
  21. if (url == null)
  22. return null ;
  23. org.omg.CORBA.Object result =
  24. (org.omg.CORBA.Object)urlHandler.operate( url ) ;
  25. return result ;
  26. }
  27. public java.util.Set list()
  28. {
  29. return orbInitRefTable.keySet() ;
  30. }
  31. }