lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r801330 - in /incubator/lucene.net/trunk/C#/src/Lucene.Net: Store/RAMDirectory.cs Util/Parameter.cs
Date Wed, 05 Aug 2009 17:36:28 GMT
Author: digy
Date: Wed Aug  5 17:36:28 2009
New Revision: 801330

URL: http://svn.apache.org/viewvc?rev=801330&view=rev
Log:
LUCENENET-170 & LUCENENET-174 for Lucene.Net 2.4.0

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs
    incubator/lucene.net/trunk/C#/src/Lucene.Net/Util/Parameter.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Store/RAMDirectory.cs?rev=801330&r1=801329&r2=801330&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Store/RAMDirectory.cs Wed Aug  5 17:36:28
2009
@@ -45,6 +45,16 @@
             set { sizeInBytes = value; }
         }
 
+        //https://issues.apache.org/jira/browse/LUCENENET-174
+        [System.Runtime.Serialization.OnDeserialized]
+        void OnDeserialized(System.Runtime.Serialization.StreamingContext context)
+        {
+            if (lockFactory == null)
+            {
+                SetLockFactory(new SingleInstanceLockFactory());
+            }
+        }
+
 		// *****
 		// Lock acquisition sequence:  RAMDirectory, then RAMFile
 		// *****

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/Util/Parameter.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/Util/Parameter.cs?rev=801330&r1=801329&r2=801330&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/Util/Parameter.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/Util/Parameter.cs Wed Aug  5 17:36:28 2009
@@ -22,7 +22,7 @@
 	
 	/// <summary> A serializable Enum class.</summary>
 	[Serializable]
-	public abstract class Parameter
+    public abstract class Parameter : System.Runtime.Serialization.IObjectReference
 	{
 		internal static System.Collections.IDictionary allParameters = new System.Collections.Hashtable();
 		
@@ -71,5 +71,11 @@
 			
 			return par;
 		}
+
+        // "ReadResolve"s equivalent for .NET
+        public Object GetRealObject(System.Runtime.Serialization.StreamingContext context)
+        {
+            return ReadResolve();
+        }
 	}
 }
\ No newline at end of file



Mime
View raw message