public java.lang.Object lookup(Name name) throws NamingException {
  if (_nc == null)   throw new ConfigurationException("Context does not have a corresponding NamingContext");
  if (name.size() == 0)   return this;
  NameComponent[] path=CNNameParser.nameToCosName(name);
  try {
    java.lang.Object answer=callResolve(path);
    try {
      return NamingManager.getObjectInstance(answer,name,this,_env);
    }
 catch (    NamingException e) {
      throw e;
    }
catch (    Exception e) {
      NamingException ne=new NamingException("problem generating object using object factory");
      ne.setRootCause(e);
      throw ne;
    }
  }
 catch (  CannotProceedException cpe) {
    javax.naming.Context cctx=getContinuationContext(cpe);
    return cctx.lookup(cpe.getRemainingName());
  }
}

public java . lang . Object lookup ( Name name ) throws NamingException { if ( _nc == null ) throw new ConfigurationException ( "Context does not have a corresponding NamingContext" ) ; if ( name . size ( ) == 0 ) return this ; NameComponent [ ] path = CNNameParser . nameToCosName ( name ) ; try { java . lang . Object answer = callResolve ( path ) ; try { return NamingManager . getObjectInstance ( answer , name , this , _env ) ; } catch ( NamingException e ) { throw e ; } catch ( Exception e ) { NamingException ne = new NamingException ( "problem generating object using object factory" ) ; ne . setRootCause ( e ) ; throw ne ; } } catch ( CannotProceedException cpe ) { javax . naming . Context cctx = getContinuationContext ( cpe ) ; return cctx . lookup ( cpe . getRemainingName ( ) ) ; } }
converts the " name " name into a namecomponent [ ] object and returns the object resolved by the cos naming api , resolve . returns the current context if the name is empty . returns either an org . omg . corba . object or javax . naming . context object .
