private String getNamingContextName ( ) { if ( namingContextName == null ) { Container parent = getParent ( ) ; if ( parent == null ) { namingContextName = getName ( ) ; } else { Stack < String > stk = new Stack < String > ( ) ; StringBuffer buff = new StringBuffer ( ) ; while ( parent != null ) { stk . push ( parent . getName ( ) ) ; parent = parent . getParent ( ) ; } while ( ! stk . empty ( ) ) { buff . append ( "/" + stk . pop ( ) ) ; } buff . append ( getName ( ) ) ; namingContextName = buff . toString ( ) ; } } return namingContextName ; }
Get naming context full name .