/** * Destroy this NamingContext object. If this NamingContext contains no bindings, the * NamingContext is deleted. * * @exception org.omg.CosNaming.NamingContextPackage.NotEmpty This NamingContext is not empty * (i.e., contains bindings). * @exception org.omg.CORBA.SystemException One of a fixed set of CORBA system exceptions. */ public void destroy() throws org.omg.CosNaming.NamingContextPackage.NotEmpty { lifecycleLogger.fine("Destroying Naming Context "); NamingContextDataStore impl = (NamingContextDataStore) this; synchronized (impl) { if (impl.IsEmpty() == true) { // The context is empty so it can be destroyed impl.Destroy(); lifecycleLogger.fine(LogKeywords.LIFECYCLE_DESTROY_SUCCESS); } else { // This context is not empty! // Not a fatal error, warning should do. lifecycleLogger.warning( LogKeywords.LIFECYCLE_DESTROY_FAILURE + " NamingContext children are not destroyed still.."); throw new NotEmpty(); } } }