directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1214100 - /directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/
Date Wed, 14 Dec 2011 08:15:11 GMT
Author: saya
Date: Wed Dec 14 08:15:11 2011
New Revision: 1214100

URL: http://svn.apache.org/viewvc?rev=1214100&view=rev
Log:
added refs to txnmanager and execution manger instances in several classes

Modified:
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
    directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/PartitionFactory.java

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
Wed Dec 14 08:15:11 2011
@@ -25,6 +25,8 @@ import java.util.Set;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.api.partition.index.Index;
 import org.apache.directory.server.core.partition.impl.avl.AvlPartition;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -42,10 +44,12 @@ public class AvlPartitionFactory impleme
     /**
      * {@inheritDoc}
      */
-    public AvlPartition createPartition( SchemaManager schemaManager, String id, String suffix,
int cacheSize, File workingDirectory )
+    public AvlPartition createPartition( SchemaManager schemaManager, String id, String suffix,
int cacheSize, File workingDirectory,
+            TxnManagerFactory txnManagerFactory,
+            OperationExecutionManagerFactory executionManagerFactory )
         throws Exception
     {
-        AvlPartition partition = new AvlPartition( schemaManager );
+        AvlPartition partition = new AvlPartition( schemaManager, txnManagerFactory, executionManagerFactory
);
         partition.setId( id );
         partition.setSuffixDn( new Dn( suffix ) );
         partition.setCacheSize( 500 );

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
Wed Dec 14 08:15:11 2011
@@ -43,6 +43,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.authn.DelegatingAuthenticator;
 import org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -146,7 +148,9 @@ public class DSAnnotationProcessor
                         createPartition.name(), 
                         createPartition.suffix(), 
                         createPartition.cacheSize(), 
-                        new File( service.getInstanceLayout().getPartitionsDirectory(), createPartition.name()
) );
+                        new File( service.getInstanceLayout().getPartitionsDirectory(), createPartition.name()
),
+                        dsf.getTxnManagerFactory() ,
+                        dsf.getOperationExecutionManagerFactory() );
 
                 CreateIndex[] indexes = createPartition.indexes();
                 
@@ -160,9 +164,9 @@ public class DSAnnotationProcessor
             {
                 // The annotation contains a specific partition type, we use
                 // that type.
-                Class<?> partypes[] = new Class[]{SchemaManager.class};
+                Class<?> partypes[] = new Class[]{SchemaManager.class, TxnManagerFactory.class,
OperationExecutionManagerFactory.class };
                 Constructor<?> constructor = createPartition.type().getConstructor(partypes);
-                partition = (Partition)constructor.newInstance( new Object[]{service.getSchemaManager()}
);
+                partition = (Partition)constructor.newInstance( new Object[]{service.getSchemaManager(),
dsf.getTxnManagerFactory(), dsf.getOperationExecutionManagerFactory() } );
                 partition.setId( createPartition.name() );
                 partition.setSuffixDn( new Dn( service.getSchemaManager(), createPartition.suffix()
) );
 

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
Wed Dec 14 08:15:11 2011
@@ -61,13 +61,6 @@ public class DefaultDirectoryServiceFact
 
     /** The partition factory. */
     private PartitionFactory partitionFactory;
-    
-    /** Default txn log file size */
-    private final static long TXN_LOG_FILE_SIZE = 1 << 27;
-    
-    /** Default txn log buffer size */
-    private final static int TXN_LOG_BUFFER_SIZE = 1 << 22;
-
 
     public DefaultDirectoryServiceFactory()
     {
@@ -184,7 +177,7 @@ public class DefaultDirectoryServiceFact
         directoryService.setSchemaManager( schemaManager );
 
         // Init the LdifPartition
-        LdifPartition ldifPartition = new LdifPartition( schemaManager );
+        LdifPartition ldifPartition = new LdifPartition( schemaManager, getTxnManagerFactory(),
getOperationExecutionManagerFactory() );
         ldifPartition.setPartitionPath( new File(workingDirectory, "schema" ).toURI() );
         SchemaPartition schemaPartition = new SchemaPartition( schemaManager );
         schemaPartition.setWrappedPartition( ldifPartition );
@@ -213,7 +206,8 @@ public class DefaultDirectoryServiceFact
         // Inject the System Partition
         Partition systemPartition = partitionFactory.createPartition( directoryService.getSchemaManager(),
             "system", ServerDNConstants.SYSTEM_DN, 500,
-            new File( directoryService.getInstanceLayout().getPartitionsDirectory(), "system"
) );
+            new File( directoryService.getInstanceLayout().getPartitionsDirectory(), "system"
),
+            getTxnManagerFactory(), getOperationExecutionManagerFactory() );
         systemPartition.setSchemaManager( directoryService.getSchemaManager() );
 
         partitionFactory.addIndex( systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100
);
@@ -233,8 +227,12 @@ public class DefaultDirectoryServiceFact
         buildInstanceDirectory( name );
 
         // Initialize the txn subsystem and the operation execution manager
-        TxnManagerFactory.init( directoryService.getInstanceLayout().getTxnLogDirectory().getPath(),
TXN_LOG_BUFFER_SIZE, TXN_LOG_FILE_SIZE );
-        OperationExecutionManagerFactory.init();
+        TxnManagerFactory txnManagerFactory = new TxnManagerFactory( directoryService.getInstanceLayout().getTxnLogDirectory().getPath(),

+            DefaultDirectoryService.TXN_LOG_BUFFER_SIZE, DefaultDirectoryService.TXN_LOG_FILE_SIZE
);
+        OperationExecutionManagerFactory  executionManagerFactory = new OperationExecutionManagerFactory(
txnManagerFactory );
+        
+        ( ( DefaultDirectoryService )directoryService ).setTxnManagerFactory( txnManagerFactory
);
+        ( ( DefaultDirectoryService )directoryService ).setExecutionManagerFactory( executionManagerFactory
);
         
         // Init the service now
         initSchema();
@@ -260,4 +258,24 @@ public class DefaultDirectoryServiceFact
     {
         return partitionFactory;
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public TxnManagerFactory getTxnManagerFactory()
+    {
+        return ( ( DefaultDirectoryService )directoryService ).getTxnManagerFactory();
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public OperationExecutionManagerFactory getOperationExecutionManagerFactory()
+    {
+        return ( ( DefaultDirectoryService )directoryService ).getOperationExecutionManagerFactory();
+    }
+    
+    
 }

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/DirectoryServiceFactory.java
Wed Dec 14 08:15:11 2011
@@ -19,7 +19,10 @@
 package org.apache.directory.server.core.factory;
 
 
+import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 
 
 /**
@@ -55,4 +58,10 @@ public interface DirectoryServiceFactory
      * @return the partition factory
      */
     PartitionFactory getPartitionFactory() throws Exception;
+    
+    
+    TxnManagerFactory getTxnManagerFactory();
+    
+    
+    OperationExecutionManagerFactory getOperationExecutionManagerFactory();
 }

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
Wed Dec 14 08:15:11 2011
@@ -25,6 +25,8 @@ import java.util.Set;
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmIndex;
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 import org.apache.directory.server.core.api.partition.index.Index;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -42,10 +44,12 @@ public class JdbmPartitionFactory implem
     /**
      * {@inheritDoc}
      */
-    public JdbmPartition createPartition( SchemaManager schemaManager, String id, String
suffix, int cacheSize, File workingDirectory )
+    public JdbmPartition createPartition( SchemaManager schemaManager, String id, String
suffix, int cacheSize, File workingDirectory,
+        TxnManagerFactory txnManagerFactory,
+        OperationExecutionManagerFactory executionManagerFactory )
         throws Exception
     {
-        JdbmPartition partition = new JdbmPartition( schemaManager );
+        JdbmPartition partition = new JdbmPartition( schemaManager, txnManagerFactory, executionManagerFactory
);
         partition.setId( id );
         partition.setSuffixDn( new Dn( suffix ) );
         partition.setCacheSize( 500 );

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
Wed Dec 14 08:15:11 2011
@@ -24,6 +24,8 @@ import java.util.Set;
 
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.partition.ldif.LdifPartition;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 import org.apache.directory.server.core.api.partition.index.Index;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -42,10 +44,12 @@ public class LdifPartitionFactory implem
     /**
      * {@inheritDoc}
      */
-    public LdifPartition createPartition( SchemaManager schemaManager, String id, String
suffix, int cacheSize, File workingDirectory )
+    public LdifPartition createPartition( SchemaManager schemaManager, String id, String
suffix, int cacheSize, File workingDirectory,
+        TxnManagerFactory txnManagerFactory,
+        OperationExecutionManagerFactory executionManagerFactory )
         throws Exception
     {
-        LdifPartition partition = new LdifPartition( schemaManager );
+        LdifPartition partition = new LdifPartition( schemaManager, txnManagerFactory, executionManagerFactory
 );
         partition.setId( id );
         partition.setSuffixDn( new Dn( suffix ) );
         partition.setCacheSize( 500 );

Modified: directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/PartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/PartitionFactory.java?rev=1214100&r1=1214099&r2=1214100&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/PartitionFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-annotations/src/main/java/org/apache/directory/server/core/factory/PartitionFactory.java
Wed Dec 14 08:15:11 2011
@@ -23,6 +23,8 @@ import java.io.File;
 
 import org.apache.directory.server.core.api.partition.Partition;
 import org.apache.directory.server.core.api.partition.index.Index;
+import org.apache.directory.server.core.shared.partition.OperationExecutionManagerFactory;
+import org.apache.directory.server.core.shared.txn.TxnManagerFactory;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 
 
@@ -42,10 +44,14 @@ public interface PartitionFactory
      * @param suffix the suffix
      * @param cacheSize the cache size
      * @param workingDirectory the working directory
+     * @param txnManagerFactory  txn manager factory
+     * @param operationExecutionManagerFactory execution manager factory
      * @return the partition
      * @throws Exception the exception
      */
-    Partition createPartition( SchemaManager schemaManager, String id, String suffix, int
cacheSize, File workingDirectory ) throws Exception;
+    Partition createPartition( SchemaManager schemaManager, String id, String suffix, int
cacheSize, File workingDirectory,
+            TxnManagerFactory txnManagerFactory,
+            OperationExecutionManagerFactory executionManagerFactory ) throws Exception;
 
 
     /**



Mime
View raw message