public static synchronized void rebind ( Name name , Object target , boolean createSubcontexts ) throws NamingException { String key = name . toString ( ) ; InitialContext ctx = new InitialContext ( ) ; if ( createSubcontexts == true && name . size ( ) > 1 ) { int size = name . size ( ) - 1 ; Util . createSubcontext ( ctx , name . getPrefix ( size ) ) ; } rebind ( ctx , key , target ) ; }
A convenience method that simplifies the process of rebinding a non - serializable object into a JNDI context . This version binds the target object into the default IntitialContext using name path .