Browse Source

TARGET_J2EE/JVM fixes

svn path=/trunk/mcs/; revision=49261
Eyal Alalouf 20 years ago
parent
commit
b4cf914e5a

+ 10 - 1
mcs/class/System.Web/System.Web.Caching/CacheDependency.cs

@@ -38,7 +38,9 @@ namespace System.Web.Caching
 		CacheDependency dependency;
 		DateTime start;
 		Cache cache;
+#if !TARGET_JVM
 		FileSystemWatcher[] watchers;
+#endif
 		bool hasChanged;
 		object locker = new object ();
 		
@@ -73,6 +75,7 @@ namespace System.Web.Caching
 		
 		public CacheDependency (string[] filenames, string[] cachekeys, CacheDependency dependency, DateTime start)
 		{
+#if !TARGET_JVM
 			if (filenames != null) {
 				watchers = new FileSystemWatcher [filenames.Length];
 				for (int n=0; n<filenames.Length; n++) {
@@ -95,6 +98,7 @@ namespace System.Web.Caching
 					watchers [n] = watcher;
 				}
 			}
+#endif
 			this.cachekeys = cachekeys;
 			this.dependency = dependency;
 			if (dependency != null)
@@ -113,6 +117,11 @@ namespace System.Web.Caching
 				cache.CheckExpiration ();
 		}
 		
+#if TARGET_JVM
+		void DisposeWatchers ()
+		{
+		}
+#else
 		void DisposeWatchers ()
 		{
 			lock (locker) {
@@ -124,7 +133,7 @@ namespace System.Web.Caching
 				watchers = null;
 			}
 		}
-		
+#endif
 		public void Dispose ()
 		{
 			DisposeWatchers ();

+ 3 - 0
mcs/class/System.Web/System.Web.Caching/ChangeLog

@@ -1,3 +1,6 @@
+2005-09-01 Eyal Alaluf <[email protected]>
+	* CacheDependency.cs: TARGET_J2EE fixes.
+
 2005-08-20 Gonzalo Paniagua Javier <[email protected]>
 
 	* CacheDependency.cs: add missing ctor.

+ 5 - 0
mcs/class/System.Web/System.Web.SessionState/ChangeLog

@@ -1,3 +1,8 @@
+2005-09-01 Eyal Alaluf <[email protected]>
+	* SessionStateModule.cs: Under TARGET_J2EE we let the J2EE app server handle
+	  session persistence, so we don't support SQL/Remoting session servers
+	  at the ASP.Net level.
+
 2005-08-30 Gonzalo Paniagua Javier <[email protected]>
 
 	* SessionStateModule.cs: added lock around 'config'.

+ 9 - 5
mcs/class/System.Web/System.Web.SessionState/SessionStateModule.cs

@@ -43,10 +43,7 @@ namespace System.Web.SessionState
 		internal static readonly string HeaderName = "AspFilterSessionId";
 		static object locker = new object ();
 		
-#if !TARGET_J2EE		
-		static SessionConfig config;
-		static Type handlerType;
-#else
+#if TARGET_J2EE		
 		static private SessionConfig config {
 			get {
 				return (SessionConfig)AppDomain.CurrentDomain.GetData("SessionStateModule.config");
@@ -63,6 +60,9 @@ namespace System.Web.SessionState
 				AppDomain.CurrentDomain.SetData("SessionStateModule.handlerType", value);
 			}
 		}
+#else
+		static SessionConfig config;
+		static Type handlerType;
 #endif		
 		ISessionHandler handler;
 		bool sessionForStaticFiles;
@@ -93,12 +93,16 @@ namespace System.Web.SessionState
 				if (config ==  null)
 					config = new SessionConfig (null);
 
+#if TARGET_J2EE
+				if (config.Mode == SessionStateMode.SQLServer || config.Mode == SessionStateMode.StateServer)
+					throw new NotImplementedException("You must use web.xml to specify session state handling");
+#else
 				if (config.Mode == SessionStateMode.StateServer)
 					handlerType = typeof (SessionStateServerHandler);
 
 				if (config.Mode == SessionStateMode.SQLServer)
 					handlerType = typeof (SessionSQLServerHandler);
-				
+#endif
 				if (config.Mode == SessionStateMode.InProc)
 					handlerType = typeof (SessionInProcHandler);