mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
14.22.2007 5d6e9428fedead57a9c9438cebe58b485ff476d2
refs
author matthew_swift <matthew_swift@localhost>
Friday, September 14, 2007 12:22 +0200
committer matthew_swift <matthew_swift@localhost>
Friday, September 14, 2007 12:22 +0200
commit5d6e9428fedead57a9c9438cebe58b485ff476d2
tree f1c1d0c87f18617b63d3d8cf2e8a37724b414405 tree | zip | gz
parent 67e18193aaa82a4c7052eaf1ca4dc668e5492716 view | diff
Avoid managed object definition initialization dependency problems. Using features like inherited default values and aggregation properties it is quite straightforward to encounter initialization dependency problems. For example: the global configuration will contain an aggregation property which references the default password policy. This aggregation definition is defined using a managed object path which, when decoded, contains a reference to the root configuration and its "password-policy" relation. This is what happens during initialization of the root configuration:

1) load the root configuration definition class and start constructing and registering its relation definitions

2) initialize the global configuration relation definition. This forces the JVM to load the global configuration definition

3) the global configuration contains an aggregation property definition which references a default password policy. Password policies are contained in the "password-policy" relation of the root configuration. Since the aggregation property definition references the password policy via a managed object path, decoding the path forces the root configuration definition to be loaded and its "password-policy" relation definition to be retrieved

4) the lookup of the "password-policy" relation definition fails because the root configuration has not finished initializing and the relation has not been constructed yet.

The fix is to "delay" decoding of inter-component references such as these until all the associated classes are loaded and initialized. To that end, property definitions and their default behaviors now have a new method called "initialize()". In addition, each property definition and default behavior has been modified so that any managed object paths and property definitions that they depend upon are not decoded during construction. This is now performed by the initialize() method.

The admin framework class loader provider has been modified so that it now performs this two-phase initialization:

1) load and instantiate each managed object definition class, forcing all property definitions and relation definitions to be constructed and registered

2) initialize each managed object definition instance: the instance invokes initialize() on each of its property definitions and default behaviors. This will force all inter-component references to be decoded and validated.

A positive side-effect of this change is that any inter-component references which have not been specified properly in their XML definition will be flagged during server start-up, rather than on-demand.
16 files modified
553 ■■■■■ changed files
opends/resource/admin/metaMO.xsl 2 ●●● diff | view | raw | blame | history
opends/resource/admin/property-types/aggregation.xsl 13 ●●●● diff | view | raw | blame | history
opends/src/messages/messages/admin.properties 21 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/AbsoluteInheritedDefaultBehaviorProvider.java 43 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/AbstractManagedObjectDefinition.java 17 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java 210 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/AliasDefaultBehaviorProvider.java 2 ●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/ClassLoaderProvider.java 118 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/DefaultBehaviorProvider.java 67 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/DefinedDefaultBehaviorProvider.java 2 ●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/PropertyDefinition.java 17 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/RelativeInheritedDefaultBehaviorProvider.java 6 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/admin/UndefinedDefaultBehaviorProvider.java 2 ●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/TestCfg.java 18 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/TestChildCfgDefn.java 5 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/server/AggregationTest.java 10 ●●●●● diff | view | raw | blame | history