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.Operation ;
  4. public class ORBDefaultInitRefResolverImpl implements Resolver {
  5. Operation urlHandler ;
  6. String orbDefaultInitRef ;
  7. public ORBDefaultInitRefResolverImpl( Operation urlHandler, String orbDefaultInitRef )
  8. {
  9. this.urlHandler = urlHandler ;
  10. // XXX Validate the URL?
  11. this.orbDefaultInitRef = orbDefaultInitRef ;
  12. }
  13. public org.omg.CORBA.Object resolve( String ident )
  14. {
  15. // If the ORBDefaultInitRef is not defined simply return null
  16. if( orbDefaultInitRef == null ) {
  17. return null;
  18. }
  19. String urlString;
  20. // If the ORBDefaultInitDef is defined as corbaloc: then create the
  21. // corbaloc String in the format
  22. // <ORBInitDefaultInitDef Param>/<Identifier>
  23. // and resolve it using resolveCorbaloc method
  24. if( orbDefaultInitRef.startsWith( "corbaloc:" ) ) {
  25. urlString = orbDefaultInitRef + "/" + ident;
  26. } else {
  27. urlString = orbDefaultInitRef + "#" + ident;
  28. }
  29. return (org.omg.CORBA.Object)urlHandler.operate( urlString ) ;
  30. }
  31. public java.util.Set list()
  32. {
  33. return new java.util.HashSet() ;
  34. }
  35. }