private void clearContext(Context context) throws NamingException {
  for (NamingEnumeration e=context.listBindings(""); e.hasMoreElements(); ) {
    Binding binding=(Binding)e.nextElement();
    if (binding.getObject() instanceof Context) {
      clearContext((Context)binding.getObject());
    }
    context.unbind(binding.getName());
  }
}

private void clearContext ( Context context ) throws NamingException { for ( NamingEnumeration e = context . listBindings ( "" ) ; e . hasMoreElements ( ) ; ) { Binding binding = ( Binding ) e . nextElement ( ) ; if ( binding . getObject ( ) instanceof Context ) { clearContext ( ( Context ) binding . getObject ( ) ) ; } context . unbind ( binding . getName ( ) ) ; } }
removes all entries from the specified context , including subcontexts .
