From 5ceb2e9601d2501d021d0c61188ec913076555a0 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 26 Sep 2007 12:21:02 +0000
Subject: [PATCH] Merge branches/temp-admin@3208 onto trunk@3208.

---
 opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java |   99 +++++++++++++++++++++++++++++++------------------
 1 files changed, 63 insertions(+), 36 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java b/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java
index 6c043bb..846bb70 100644
--- a/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java
+++ b/opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java
@@ -137,7 +137,7 @@
 
     // If we have a parent definition then inherit its features.
     if (parent != null) {
-      parent.children.put(name, this);
+      registerInParent();
 
       for (PropertyDefinition<?> pd : parent.getAllPropertyDefinitions()) {
         allPropertyDefinitions.put(pd.getName(), pd);
@@ -740,41 +740,6 @@
 
 
   /**
-   * Deregister a constraint from the managed object definition.
-   * <p>
-   * This method <b>must not</b> be called by applications and is
-   * only intended for internal testing.
-   *
-   * @param constraint
-   *          The constraint to be deregistered.
-   */
-  protected final void deregisterConstraint(Constraint constraint) {
-    constraints.remove(constraint);
-  }
-
-
-
-  /**
-   * Deregister a relation definition from the managed object
-   * definition.
-   * <p>
-   * This method <b>must not</b> be called by applications and is
-   * only intended for internal testing.
-   *
-   * @param d
-   *          The relation definition to be deregistered.
-   */
-  protected final void deregisterRelationDefinition(
-      RelationDefinition<?, ?> d) {
-    String name = d.getName();
-
-    relationDefinitions.remove(name);
-    allRelationDefinitions.remove(name);
-  }
-
-
-
-  /**
    * Initializes all of the property definitions associated with this
    * managed object definition.
    *
@@ -855,6 +820,68 @@
 
 
 
+  /**
+   * Deregister a constraint from the managed object definition.
+   * <p>
+   * This method <b>must not</b> be called by applications and is
+   * only intended for internal testing.
+   *
+   * @param constraint
+   *          The constraint to be deregistered.
+   */
+  final void deregisterConstraint(Constraint constraint) {
+    constraints.remove(constraint);
+  }
+
+
+
+  /**
+   * Deregister this managed object definition from its parent.
+   * <p>
+   * This method <b>must not</b> be called by applications and is
+   * only intended for internal testing.
+   */
+  final void deregisterFromParent() {
+    if (parent != null) {
+      parent.children.remove(name);
+    }
+  }
+
+
+
+  /**
+   * Deregister a relation definition from the managed object
+   * definition.
+   * <p>
+   * This method <b>must not</b> be called by applications and is
+   * only intended for internal testing.
+   *
+   * @param d
+   *          The relation definition to be deregistered.
+   */
+  final void deregisterRelationDefinition(
+      RelationDefinition<?, ?> d) {
+    String name = d.getName();
+    relationDefinitions.remove(name);
+    allRelationDefinitions.remove(name);
+  }
+
+
+
+  /**
+   * Register this managed object definition in its parent.
+   * <p>
+   * This method <b>must not</b> be called by applications and is
+   * only intended for internal testing.
+   */
+  final void registerInParent() {
+    if (parent != null) {
+      parent.children.put(name, this);
+    }
+  }
+
+
+
   // Recursively descend definition hierarchy to find the best match definition.
   private AbstractManagedObjectDefinition<? extends C, ? extends S>
       resolveManagedObjectDefinitionAux(

--
Gitblit v1.10.0