question: private void callBindOrRebind ( NameComponent [ ] pth , Name name , java . lang . Object obj , boolean rebind ) throws NamingException { if ( _nc == null ) throw new ConfigurationException ( "Context does not have a corresponding NamingContext" ) ; try { obj = NamingManager . getStateToBind ( obj , name , this , _env ) ; if ( obj instanceof CNCtx ) { obj = ( ( CNCtx ) obj ) . _nc ; } if ( obj instanceof org . omg . CosNaming . NamingContext ) { NamingContext nobj = NamingContextHelper . narrow ( ( org . omg . CORBA . Object ) obj ) ; if ( rebind ) _nc . rebind_context ( pth , nobj ) ; else _nc . bind_context ( pth , nobj ) ; } else if ( obj instanceof org . omg . CORBA . Object ) { if ( rebind ) _nc . rebind ( pth , ( org . omg . CORBA . Object ) obj ) ; else _nc . bind ( pth , ( org . omg . CORBA . Object ) obj ) ; } else throw new IllegalArgumentException ( "Only instances of org.omg.CORBA.Object can be bound" ) ; } catch ( BAD_PARAM e ) { NamingException ne = new NotContextException ( name . toString ( ) ) ; ne . setRootCause ( e ) ; throw ne ; } catch ( Exception e ) { throw ExceptionMapper . mapException ( e , this , pth ) ; } }
target:  Performs bind or rebind in the context depending on whether the flag rebind is set. The only objects allowed to be bound are of types org.omg.CORBA.Object, org.omg.CosNaming.NamingContext. You can use a state factory to turn other objects (such as Remote) into these acceptable forms. Uses the COS Naming apis bind/rebind or bind_context/rebind_context.