directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1228574 - in /directory/apacheds/branches/apacheds-txns: core-shared/src/main/java/org/apache/directory/server/core/shared/partition/ core-shared/src/main/java/org/apache/directory/server/core/shared/txn/ core-shared/src/main/java/org/apac...
Date Sat, 07 Jan 2012 06:48:08 GMT
Author: elecharny
Date: Sat Jan  7 06:48:07 2012
New Revision: 1228574

URL: http://svn.apache.org/viewvc?rev=1228574&view=rev
Log:
o Renamed the uninit() method to shutdown() in OperationExecutionManagerfactory, DefaultTxnLogManager,
DefaultTxnmanager and TxnManagerFactory
o Added some Javadoc

Modified:
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnLogManager.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java
    directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java
    directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/partition/OperationExecutionManagerFactory.java
Sat Jan  7 06:48:07 2012
@@ -41,7 +41,7 @@ public class OperationExecutionManagerFa
     }
 
 
-    public void uninit()
+    public void shutdown()
     {
         //do nothing;
     }

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnLogManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnLogManager.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnLogManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnLogManager.java
Sat Jan  7 06:48:07 2012
@@ -71,7 +71,7 @@ public class DefaultTxnLogManager implem
     }
 
 
-    public void uninit()
+    public void shutdown()
     {
         // Do nothing
     }

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/DefaultTxnManager.java
Sat Jan  7 06:48:07 2012
@@ -138,7 +138,7 @@ class DefaultTxnManager implements TxnMa
     }
 
 
-    public void uninit()
+    public void shutdown()
     {
         syncer.interrupt();
 

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/TxnManagerFactory.java
Sat Jan  7 06:48:07 2012
@@ -20,13 +20,13 @@
 package org.apache.directory.server.core.shared.txn;
 
 
+import java.io.IOException;
+
+import org.apache.directory.server.core.api.log.InvalidLogException;
+import org.apache.directory.server.core.api.log.Log;
 import org.apache.directory.server.core.api.txn.TxnLogManager;
 import org.apache.directory.server.core.api.txn.TxnManager;
 import org.apache.directory.server.core.shared.log.DefaultLog;
-import org.apache.directory.server.core.api.log.Log;
-import org.apache.directory.server.core.api.log.InvalidLogException;
-
-import java.io.IOException;
 
 
 /**
@@ -81,15 +81,15 @@ public class TxnManagerFactory
     }
 
 
-    public void uninit()
+    public void shutdown()
     {
         if ( inited == false )
         {
             return;
         }
 
-        ( ( DefaultTxnManager ) txnManager ).uninit();
-        ( ( DefaultTxnLogManager ) txnLogManager ).uninit();
+        ( ( DefaultTxnManager ) txnManager ).shutdown();
+        ( ( DefaultTxnLogManager ) txnLogManager ).shutdown();
         inited = false;
     }
 

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/DataChangeContainer.java
Sat Jan  7 06:48:07 2012
@@ -247,6 +247,15 @@ public class DataChangeContainer extends
     }
 
 
+    /**
+     * Read back a DataChange container from a stream. The format is : <br/>
+     * <ul>
+     * <li>entryId if we have stored an Entry change, null if it's an Index change</li>
+     * <li>the transaction id</li>
+     * <li>the partition DN</li>
+     * <li>the changes if any</li>
+     * </ul>
+     */
     @Override
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
@@ -267,6 +276,8 @@ public class DataChangeContainer extends
         partitionDn = new Dn();
         partitionDn.readExternal( in );
 
+        // Here, we must find a way to find the Partition from its Dn
+
         DataChange change;
         int numChanges = in.readInt();
 

Modified: directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core-shared/src/main/java/org/apache/directory/server/core/shared/txn/logedit/EntryAddDelete.java
Sat Jan  7 06:48:07 2012
@@ -32,7 +32,8 @@ import org.apache.directory.shared.ldap.
 
 
 /**
- * A Change class for entry addition or deletion
+ * A Change class for entry addition or deletion. Every time we add or delete an entry, we
+ * used this class to store the added or deleted entry.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -44,14 +45,30 @@ public class EntryAddDelete implements E
     /** Type of change */
     Type type;
 
+    /**
+     * The change type : ADD or DELETE
+     */
+    public enum Type
+    {
+        ADD,
+        DELETE
+    }
+
 
-    // For externalizable
+    /**
+     * A default constructor used for deserialisation only
+     */
     public EntryAddDelete()
     {
-
     }
 
 
+    /**
+     * Create a new Add/Del change instance
+     * 
+     * @param entry The entry being added or deleted
+     * @param type ADD for an addition, DELETE for a deletion
+     */
     public EntryAddDelete( Entry entry, Type type )
     {
         this.entry = entry;
@@ -59,12 +76,18 @@ public class EntryAddDelete implements E
     }
 
 
+    /**
+     * @return The stored entry
+     */
     public Entry getChangedEntry()
     {
         return entry;
     }
 
 
+    /**
+     * @return The type, ADD or DELETE
+     */
     public Type getType()
     {
         return type;
@@ -116,26 +139,30 @@ public class EntryAddDelete implements E
     }
 
 
+    /**
+     * Read back the entry from the stream.
+     */
     @Override
     public void readExternal( ObjectInput in ) throws IOException, ClassNotFoundException
     {
+        type = Type.values()[in.readInt()];
         entry = new DefaultEntry();
         entry.readExternal( in );
-        type = Type.values()[in.readInt()];
     }
 
 
+    /**
+     * Write the change in a stream. The format is : <br/>
+     * <ul>
+     * <li>type (0 for ADD, 1 for DELETE</li>
+     * <li>entry</li>
+     * </ul>
+     */
     @Override
     public void writeExternal( ObjectOutput out ) throws IOException
     {
-        entry.writeExternal( out );
         out.writeInt( type.ordinal() );
-    }
-
-    public enum Type
-    {
-        ADD,
-        DELETE
+        entry.writeExternal( out );
     }
 
 

Modified: directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1228574&r1=1228573&r2=1228574&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
(original)
+++ directory/apacheds/branches/apacheds-txns/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
Sat Jan  7 06:48:07 2012
@@ -1416,8 +1416,8 @@ public class DefaultDirectoryService imp
         // --------------------------------------------------------------------
         // Shutdown the txnManager
         //
-        txnManagerFactory.uninit();
-        executionManagerFactory.uninit();
+        txnManagerFactory.shutdown();
+        executionManagerFactory.shutdown();
 
         // --------------------------------------------------------------------
         // Shutdown the changelog



Mime
View raw message