directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1351038 - in /directory/shared/branches/shared-txns/ldap: model/src/main/java/org/apache/directory/shared/ldap/model/schema/ schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/
Date Sun, 17 Jun 2012 01:50:56 GMT
Author: saya
Date: Sun Jun 17 01:50:55 2012
New Revision: 1351038

URL: http://svn.apache.org/viewvc?rev=1351038&view=rev
Log:
scheman manager changes to get crash recovery working

Modified:
    directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java
    directory/shared/branches/shared-txns/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java

Modified: directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java?rev=1351038&r1=1351037&r2=1351038&view=diff
==============================================================================
--- directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java
(original)
+++ directory/shared/branches/shared-txns/ldap/model/src/main/java/org/apache/directory/shared/ldap/model/schema/SchemaManager.java
Sun Jun 17 01:50:55 2012
@@ -55,6 +55,15 @@ public interface SchemaManager
     //---------------------------------------------------------------------------------
     // Schema loading methods
     //---------------------------------------------------------------------------------
+    /**                                                                         
+     *                                                                          
+     * Realoads all enabled schemas into the registries                         
+     *                                                                          
+     * @return True if reload was successful                                    
+     */
+    boolean reloadAllEnabled() throws LdapException;
+
+
     /**
      * Load some Schemas into the registries. The Registries is checked after the 
      * schemas have been loaded, and if there is an error, the method returns false

Modified: directory/shared/branches/shared-txns/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-txns/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java?rev=1351038&r1=1351037&r2=1351038&view=diff
==============================================================================
--- directory/shared/branches/shared-txns/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-txns/ldap/schema/data/src/main/java/org/apache/directory/shared/ldap/schemamanager/impl/DefaultSchemaManager.java
Sun Jun 17 01:50:55 2012
@@ -977,6 +977,56 @@ public class DefaultSchemaManager implem
         return schemaObject;
     }
 
+    /**                                                                         
+     * {@inheritDoc}                                                            
+     */
+    public boolean reloadAllEnabled() throws LdapException
+    {
+        boolean loaded = false;
+
+        try
+	    {
+		Schema[] schemas = schemaLoader.getAllEnabled().toArray( new Schema[0] );
+
+		// Reset the errors if not null                                     
+		if ( errors != null )
+		    {
+			errors.clear();
+		    }
+
+		Registries newRegistries = new Registries( this );
+		newRegistries.setRelaxed();
+
+		// Load the schemas                                                 
+		for ( Schema schema : schemas )
+		    {
+			loadDepsFirst( newRegistries, schema );
+		    }
+
+		// Build the cross references                                       
+		errors = newRegistries.buildReferences();
+
+		if ( errors.isEmpty() )
+		    {
+			// Check the registries now                                     
+			errors = newRegistries.checkRefInteg();
+
+			if ( errors.isEmpty() )
+			    {
+				registries = newRegistries;
+				registries.setStrict();
+				loaded = true;
+			    }
+		    }
+	    }
+        catch ( Exception e )
+	    {
+		throw new LdapException( e );
+	    }
+
+        return loaded;
+    }
+
 
     /**
      * {@inheritDoc}



Mime
View raw message