directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: rev 1468 - in incubator/directory/ldap/trunk/eve/backend/schema: oid/impl/src/java/org/apache/eve/schema syntax/bootstrap-impl syntax/bootstrap-impl/src/java/org/apache/eve/schema
Date Wed, 24 Dec 2003 18:20:54 GMT
Author: akarasulu
Date: Wed Dec 24 10:20:53 2003
New Revision: 1468

Modified:
   incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
   incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/project.properties
   incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/BootstrapSyntaxRegistry.java
   incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/MerlinBootstrapSyntaxRegistry.java
Log:
Fixed bug causing NullPointerException


Modified: incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
(original)
+++ incubator/directory/ldap/trunk/eve/backend/schema/oid/impl/src/java/org/apache/eve/schema/MerlinOidRegistry.java
Wed Dec 24 10:20:53 2003
@@ -55,8 +55,8 @@
 
 import javax.naming.NamingException ;
 
-import org.apache.avalon.framework.activity.Initializable;
-import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.activity.Initializable ;
+import org.apache.avalon.framework.logger.AbstractLogEnabled ;
 
 
 /**
@@ -132,8 +132,7 @@
     // ------------------------------------------------------------------------ 
     
 
-    /*
-     *  (non-Javadoc)
+    /**
      * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize() 
@@ -142,5 +141,6 @@
         AvalonOidRegistryMonitor l_monitor = new AvalonOidRegistryMonitor() ;
         l_monitor.enableLogging( getLogger() ) ;
         l_delegate.setMonitor( l_monitor ) ;
+        m_delegate = l_delegate ;
     }
 }

Modified: incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/project.properties
==============================================================================
--- incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/project.properties
(original)
+++ incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/project.properties
Wed Dec 24 10:20:53 2003
@@ -12,5 +12,4 @@
 tag2.enabled=false
 tag2.scope=all
 
-merlin.info=true
 merlin.debug=true

Modified: incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/BootstrapSyntaxRegistry.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/BootstrapSyntaxRegistry.java
(original)
+++ incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/BootstrapSyntaxRegistry.java
Wed Dec 24 10:20:53 2003
@@ -72,8 +72,7 @@
     /** the OID registry this registry uses to register new syntax OIDs */
     private final OidRegistry m_registry ;
     /** a monitor used to track noteable registry events */
-    private SyntaxRegistryMonitor m_monitor = 
-        new SyntaxRegistryMonitorAdapter() ;
+    private SyntaxRegistryMonitor m_monitor = null ; 
     
     
     // ------------------------------------------------------------------------
@@ -87,14 +86,38 @@
      * @param a_syntaxes a map of OIDs to their respective Syntax objects
      */
     public BootstrapSyntaxRegistry( Syntax[] a_syntaxes, 
-                                    OidRegistry a_registry ) 
+                                    OidRegistry a_registry )
     {
+        this ( a_syntaxes, a_registry, new SyntaxRegistryMonitorAdapter() ) ;
+    }
+
+        
+    /**
+     * Creates a BootstrapSyntaxRegistry using existing Syntaxes for lookups.
+     * 
+     * @param a_syntaxes a map of OIDs to their respective Syntax objects
+     */
+    public BootstrapSyntaxRegistry( Syntax[] a_syntaxes, 
+                                    OidRegistry a_registry,
+                                    SyntaxRegistryMonitor a_monitor )
+    {
+        m_monitor = a_monitor ; 
         m_registry = a_registry ;
         m_syntaxes = new HashMap() ;
         
         for ( int ii = 0; ii < a_syntaxes.length; ii++ )
         {
             m_syntaxes.put( a_syntaxes[ii].getOid(), a_syntaxes[ii] ) ;
+            
+            m_registry.register( a_syntaxes[ii].getOid(), 
+                    a_syntaxes[ii].getOid() ) ;
+            if ( a_syntaxes[ii].getName() != null )
+            {    
+                m_registry.register( a_syntaxes[ii].getName(), 
+                        a_syntaxes[ii].getOid() ) ;
+            }
+            
+            m_monitor.registered( a_syntaxes[ii] ) ;
         }
     }
     

Modified: incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/MerlinBootstrapSyntaxRegistry.java
==============================================================================
--- incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/MerlinBootstrapSyntaxRegistry.java
(original)
+++ incubator/directory/ldap/trunk/eve/backend/schema/syntax/bootstrap-impl/src/java/org/apache/eve/schema/MerlinBootstrapSyntaxRegistry.java
Wed Dec 24 10:20:53 2003
@@ -159,11 +159,9 @@
     {
         AvalonSyntaxRegistryMonitor l_monitor = 
             new AvalonSyntaxRegistryMonitor() ;
-        BootstrapSyntaxRegistry l_registry = 
-            new BootstrapSyntaxRegistry( m_syntaxes, m_oidReg ) ;
-
         l_monitor.enableLogging( getLogger() ) ;
-        l_registry.setMonitor( l_monitor ) ;
+        BootstrapSyntaxRegistry l_registry = 
+            new BootstrapSyntaxRegistry( m_syntaxes, m_oidReg, l_monitor ) ;
         m_synReg = l_registry ;
     }
 }

Mime
View raw message