You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2005/05/28 09:23:25 UTC

svn commit: r178859 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration

Author: gbayon
Date: Sat May 28 00:23:24 2005
New Revision: 178859

URL: http://svn.apache.org/viewcvs?rev=178859&view=rev
Log:
- Impoved JIRA-71
Moved new API from SqlMapper to DomSqlMapBuilder
Usage DomSqlMapBuilder.Configure(...)
and mark SqlMapper.Configure as obsolete

Modified:
    incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ConfigWatcherHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Mapper.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ConfigWatcherHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ConfigWatcherHandler.cs?rev=178859&r1=178858&r2=178859&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ConfigWatcherHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/ConfigWatcherHandler.cs Sat May 28 00:23:24 2005
@@ -51,11 +51,11 @@
 		/// <summary>
 		/// Master Config File name.
 		/// </summary>
-		public string fileName;
+		public string FileName;
 		/// <summary>
 		/// Delegate called when a file is changed, use it to rebuild.
 		/// </summary>
-		public ConfigureHandler configureHandler;
+		public ConfigureHandler ConfigureHandler;
 	}
 
 	/// <summary>

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs?rev=178859&r1=178858&r2=178859&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/BaseTest.cs Sat May 28 00:23:24 2005
@@ -5,7 +5,7 @@
 using System.IO;
 using System.Reflection;
 using System.Configuration;
-
+using IBatisNet.DataMapper.Configuration;
 using log4net;
 
 using NUnit.Framework;
@@ -52,8 +52,10 @@
 		{
 			//DateTime start = DateTime.Now;
 
-			ConfigureHandler handler = new ConfigureHandler(Configure);
-			sqlMap = SqlMapper.ConfigureAndWatch("sqlmap" + "_" + ConfigurationSettings.AppSettings["database"] + "_" + ConfigurationSettings.AppSettings["providerType"] + ".config", handler);
+//			ConfigureHandler handler = new ConfigureHandler(Configure);
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			string fileName = "sqlmap" + "_" + ConfigurationSettings.AppSettings["database"] + "_" + ConfigurationSettings.AppSettings["providerType"] + ".config";
+			sqlMap = builder.Configure(fileName);
 
 			if ( sqlMap.DataSource.Provider.Name.IndexOf("PostgreSql")>=0)
 			{
@@ -98,7 +100,7 @@
 		/// </param>
 		protected static void Configure(object obj)
 		{
-			sqlMap = (SqlMapper) obj;
+			sqlMap = null;//(SqlMapper) obj;
 		}
 
 		/// <summary>

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs?rev=178859&r1=178858&r2=178859&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/ConfigureTest.cs Sat May 28 00:23:24 2005
@@ -4,6 +4,7 @@
 using System.Reflection;
 using IBatisNet.Common.Utilities;
 using IBatisNet.DataMapper; // SqlMap API
+using IBatisNet.DataMapper.Configuration;
 using NUnit.Framework;
 
 namespace IBatisNet.DataMapper.Test.NUnit.SqlMapTests
@@ -37,8 +38,8 @@
 		public void TestConfigureRelativePath()
 		{
 			SqlMapper sqlMap = SqlMapper.Configure( _fileName );
-			Assert.IsNotNull(sqlMap);
 
+			Assert.IsNotNull(sqlMap);
 		}
 
 		/// <summary>
@@ -48,10 +49,37 @@
 		public void TestConfigureAndWatchRelativePath()
 		{
 			ConfigureHandler handler = new ConfigureHandler(Configure);
-			sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
+			SqlMapper sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
+
+			Assert.IsNotNull(sqlMap);
+		}
+
+		/// <summary>
+		/// Test Configure via relative path
+		/// </summary>
+		[Test] 
+		public void TestConfigureRelativePathViaBuilder()
+		{
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.Configure( _fileName );
+
 			Assert.IsNotNull(sqlMap);
 
 		}
+
+		/// <summary>
+		/// Test ConfigureAndWatch via relative path
+		/// </summary>
+		[Test] 
+		public void TestConfigureAndWatchRelativePathViaBuilder()
+		{
+			ConfigureHandler handler = new ConfigureHandler(Configure);
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.ConfigureAndWatch( _fileName , handler);
+
+			Assert.IsNotNull(sqlMap);
+		}
 		#endregion 
 
 		#region Absolute Paths
@@ -63,7 +91,23 @@
 		public void TestConfigureAbsolutePath()
 		{
 			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
+
 			SqlMapper sqlMap = SqlMapper.Configure( _fileName );
+
+			Assert.IsNotNull(sqlMap);
+		}
+
+		/// <summary>
+		/// Test Configure via absolute path
+		/// </summary>
+		[Test] 
+		public void TestConfigureAbsolutePathViaBuilder()
+		{
+			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.Configure( _fileName );
+
 			Assert.IsNotNull(sqlMap);
 		}
 
@@ -74,7 +118,23 @@
 		public void TestConfigureAbsolutePathWithFileSuffix()
 		{
 			_fileName = "file://"+Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
+
 			SqlMapper sqlMap = SqlMapper.Configure( _fileName );
+
+			Assert.IsNotNull(sqlMap);
+		}
+
+		/// <summary>
+		/// Test Configure via absolute path with file suffix
+		/// </summary>
+		[Test] 
+		public void TestConfigureAbsolutePathWithFileSuffixViaBuilder()
+		{
+			_fileName = "file://"+Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.Configure( _fileName );
+
 			Assert.IsNotNull(sqlMap);
 		}
 
@@ -86,7 +146,10 @@
 		{
 			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
 			FileInfo fileInfo = new FileInfo(_fileName);
-			SqlMapper sqlMap = SqlMapper.Configure( fileInfo );
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.Configure( fileInfo );
+
 			Assert.IsNotNull(sqlMap);
 		}
 
@@ -98,7 +161,10 @@
 		{
 			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
 			Uri uri = new Uri(_fileName);
-			SqlMapper sqlMap = SqlMapper.Configure( uri );
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.Configure( uri );
+
 			Assert.IsNotNull(sqlMap);
 		}
 
@@ -110,7 +176,23 @@
 		{
 			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
 			ConfigureHandler handler = new ConfigureHandler(Configure);
-			sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
+
+			SqlMapper sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
+
+			Assert.IsNotNull(sqlMap);
+		}
+
+		/// <summary>
+		/// Test Configure via absolute path
+		/// </summary>
+		[Test] 
+		public void TestConfigureAndWatchAbsolutePathViaBuilder()
+		{
+			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
+			ConfigureHandler handler = new ConfigureHandler(Configure);
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
 
 			Assert.IsNotNull(sqlMap);
 		}
@@ -123,7 +205,23 @@
 		{
 			_fileName = "file://"+Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
 			ConfigureHandler handler = new ConfigureHandler(Configure);
-			sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
+
+			SqlMapper sqlMap = SqlMapper.ConfigureAndWatch( _fileName , handler);
+
+			Assert.IsNotNull(sqlMap);
+		}
+
+		/// <summary>
+		/// Test Configure via absolute path 
+		/// </summary>
+		[Test] 
+		public void TestConfigureAndWatchAbsolutePathWithFileSuffixViaBuilder()
+		{
+			_fileName = "file://"+Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
+			ConfigureHandler handler = new ConfigureHandler(Configure);
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.ConfigureAndWatch( _fileName , handler);
 
 			Assert.IsNotNull(sqlMap);
 		}
@@ -136,8 +234,11 @@
 		{
 			_fileName = Resources.BaseDirectory+Path.DirectorySeparatorChar+_fileName;
 			FileInfo fileInfo = new FileInfo(_fileName);
+
 			ConfigureHandler handler = new ConfigureHandler(Configure);
-			sqlMap = SqlMapper.ConfigureAndWatch( fileInfo , handler);
+
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.ConfigureAndWatch( fileInfo , handler);
 
 			Assert.IsNotNull(sqlMap);
 		}
@@ -156,7 +257,9 @@
 			Assembly assembly = Assembly.LoadWithPartialName ("IBatisNet.DataMapper.Test");
 			Stream stream = assembly.GetManifestResourceStream("IBatisNet.DataMapper.Test.bin.Debug.SqlMap_MSSQL_SqlClient.config");
 
-			SqlMapper sqlMap = SqlMapper.Configure( stream );
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			SqlMapper sqlMap = builder.Configure( stream );
+
 			Assert.IsNotNull(sqlMap);
 		}
 		#endregion 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs?rev=178859&r1=178858&r2=178859&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs Sat May 28 00:23:24 2005
@@ -31,6 +31,7 @@
 using System.IO;
 using System.Reflection;
 using System.Text;
+using System.Threading;
 using System.Xml;
 using System.Xml.Schema;
 using System.Xml.Serialization;
@@ -56,7 +57,7 @@
 namespace IBatisNet.DataMapper.Configuration
 {
 	/// <summary>
-	/// Builds SqlMapClient instances from a supplied resource (e.g. XML configuration file)
+	/// Builds SqlMapper instances from a supplied resource (e.g. XML configuration file)
 	/// </summary>
 	public class DomSqlMapBuilder
 	{
@@ -73,7 +74,17 @@
 		#endregion
 
 		#region Constant
+
+		/// <summary>
+		/// Default congig name
+		/// </summary>
+		public const string DEFAULT_FILE_CONFIG_NAME = "sqlmap.config";
+
+		/// <summary>
+		/// Default provider name
+		/// </summary>
 		private const string DEFAULT_PROVIDER_NAME = "_DEFAULT_PROVIDER_NAME";
+
 		/// <summary>
 		/// Dot representation
 		/// </summary>
@@ -138,6 +149,171 @@
 			_paramParser = new InlineParameterMapParser(_configScope.ErrorContext);
 		}
 		#endregion 
+
+		#region Configure
+
+		/// <summary>
+		/// Configure an SqlMap from default resource file named SqlMap.config.
+		/// </summary>
+		/// <returns>An SqlMap</returns>
+		/// <remarks>The file path is relative to the application root.</remarks>
+		public SqlMapper Configure()
+		{
+			return Configure( Resources.GetConfigAsXmlDocument(DomSqlMapBuilder.DEFAULT_FILE_CONFIG_NAME) );
+		}
+
+		/// <summary>
+		/// Configure an SqlMap.
+		/// </summary>
+		/// <param name="document">An xml sql map configuration document.</param>
+		/// <returns>the SqlMap</returns>
+		public SqlMapper Configure( XmlDocument document )
+		{
+			return Build( document, false );
+		}
+
+		/// <summary>
+		/// Configure an SqlMap from via a relative ressource path.
+		/// </summary>
+		/// <param name="resource">
+		/// A relative ressource path from your Application root.
+		/// </param>
+		/// <returns>An SqlMap</returns>
+		public SqlMapper Configure(string resource)
+		{
+			XmlDocument document = null;
+			if (resource.StartsWith("file://"))
+			{
+				document = Resources.GetUrlAsXmlDocument( resource.Remove(0, 7) );	
+			}
+			else
+			{
+				document = Resources.GetResourceAsXmlDocument( resource );	
+			}
+			return Build( document, false);
+		}
+
+		/// <summary>
+		///  Configure an SqlMap from via a stream.
+		/// </summary>
+		/// <param name="resource">A stream resource</param>
+		/// <returns>An SqlMap</returns>
+		public SqlMapper Configure(Stream resource)
+		{
+			XmlDocument document = Resources.GetStreamAsXmlDocument( resource );
+			return Build( document, false);
+		}
+
+		/// <summary>
+		///  Configure an SqlMap from via a FileInfo.
+		/// </summary>
+		/// <param name="resource">A FileInfo resource</param>
+		/// <returns>An SqlMap</returns>
+		public SqlMapper Configure(FileInfo resource)
+		{
+			XmlDocument document = Resources.GetFileInfoAsXmlDocument( resource );
+			return Build( document, false);
+		}
+
+		/// <summary>
+		///  Configure an SqlMap from via an Uri.
+		/// </summary>
+		/// <param name="resource">A Uri resource</param>
+		/// <returns></returns>
+		public SqlMapper Configure(Uri resource)
+		{
+			XmlDocument document = Resources.GetUriAsXmlDocument( resource );
+			return Build( document, false);
+		}
+
+		/// <summary>
+		/// Configure and monitor the default configuration file for modifications 
+		/// and automatically reconfigure SqlMap. 
+		/// </summary>
+		/// <returns>An SqlMap</returns>
+		public SqlMapper ConfigureAndWatch(ConfigureHandler configureDelegate)
+		{
+			return ConfigureAndWatch( DEFAULT_FILE_CONFIG_NAME, configureDelegate ) ;
+		}
+
+		/// <summary>
+		/// Configure and monitor the configuration file for modifications 
+		/// and automatically reconfigure SqlMap. 
+		/// </summary>
+		/// <param name="resource">
+		/// A relative ressource path from your Application root.
+		/// </param>
+		///<param name="configureDelegate">
+		/// Delegate called when the file has changed, to rebuild the dal.
+		/// </param>
+		/// <returns>An SqlMap</returns>
+		public SqlMapper ConfigureAndWatch( string resource, ConfigureHandler configureDelegate )
+		{
+			XmlDocument document = null;
+			if (resource.StartsWith("file://"))
+			{
+				document = Resources.GetUrlAsXmlDocument( resource.Remove(0, 7) );	
+			}
+			else
+			{
+				document = Resources.GetResourceAsXmlDocument( resource );	
+			}
+
+			ConfigWatcherHandler.ClearFilesMonitored();
+			ConfigWatcherHandler.AddFileToWatch( Resources.GetFileInfo( resource ) );
+
+			TimerCallback callBakDelegate = new TimerCallback( DomSqlMapBuilder.OnConfigFileChange );
+
+			StateConfig state = new StateConfig();
+			state.FileName = resource;
+			state.ConfigureHandler = configureDelegate;
+
+			new ConfigWatcherHandler( callBakDelegate, state );
+
+			return Build( document, true );
+		}
+
+		/// <summary>
+		/// Configure and monitor the configuration file for modifications 
+		/// and automatically reconfigure SqlMap. 
+		/// </summary>
+		/// <param name="resource">
+		/// A relative ressource path from your Application root.
+		/// </param>
+		///<param name="configureDelegate">
+		/// Delegate called when the file has changed, to rebuild the dal.
+		/// </param>
+		/// <returns>An SqlMap</returns>
+		public SqlMapper ConfigureAndWatch( FileInfo resource, ConfigureHandler configureDelegate )
+		{
+			XmlDocument document = Resources.GetFileInfoAsXmlDocument(resource);
+
+			ConfigWatcherHandler.ClearFilesMonitored();
+			ConfigWatcherHandler.AddFileToWatch( resource );
+
+			TimerCallback callBakDelegate = new TimerCallback( DomSqlMapBuilder.OnConfigFileChange );
+
+			StateConfig state = new StateConfig();
+			state.FileName = resource.FullName;
+			state.ConfigureHandler = configureDelegate;
+
+			new ConfigWatcherHandler( callBakDelegate, state );
+
+			return Build( document, true );
+		}
+
+		/// <summary>
+		/// Callback called when the SqlMap.config changed.
+		/// </summary>
+		/// <param name="obj">The state config.</param>
+		public static void OnConfigFileChange(object obj)
+		{
+			StateConfig state = (StateConfig)obj;
+			state.ConfigureHandler( null );
+		}
+		#endregion 
+
+
 
 		#region Methods
 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Mapper.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Mapper.cs?rev=178859&r1=178858&r2=178859&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Mapper.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Mapper.cs Sat May 28 00:23:24 2005
@@ -25,6 +25,7 @@
 
 using IBatisNet.Common.Utilities;
 using IBatisNet.DataMapper;
+using IBatisNet.DataMapper.Configuration;
 
 namespace IBatisNet.DataMapper
 {
@@ -43,7 +44,7 @@
 		/// <param name="obj"></param>
 		protected static void Configure (object obj)
 		{
-			_mapper = (SqlMapper) obj;
+			_mapper = null;
 		}
 
 		/// <summary>
@@ -52,8 +53,8 @@
 		protected static void InitMapper()
 		{
 			ConfigureHandler handler = new ConfigureHandler (Configure);
-			_mapper = SqlMapper.ConfigureAndWatch (handler);
-		}
+			DomSqlMapBuilder builder = new DomSqlMapBuilder();
+			_mapper = builder.ConfigureAndWatch (handler);		}
 
 		/// <summary>
 		/// Get the instance of the SqlMapper defined by the SqlMap.Config file.
@@ -66,7 +67,9 @@
 				lock (typeof (SqlMapper))
 				{
 					if (_mapper == null) // double-check
+					{	
 						InitMapper();
+					}
 				}
 			}
 			return _mapper;

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs?rev=178859&r1=178858&r2=178859&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs Sat May 28 00:23:24 2005
@@ -30,12 +30,10 @@
 using System.Collections;
 using System.Collections.Specialized;
 using System.Data;
-using System.IO;
 using System.Text;
 using System.Threading;
 using System.Xml;
 using IBatisNet.Common;
-using IBatisNet.Common.Exceptions;
 using IBatisNet.Common.Utilities;
 using IBatisNet.DataMapper.Configuration;
 using IBatisNet.DataMapper.Configuration.Alias;
@@ -62,10 +60,6 @@
 		/// </summary>
 		public delegate void RowDelegate(object obj, IList list);
 
-		#region Contants
-		private const string DEFAULT_FILE_CONFIG_NAME = "sqlmap.config";
-		#endregion
-
 		#region Fields
 		//(MappedStatement Name, MappedStatement)
 		private HybridDictionary _mappedStatements = new HybridDictionary();
@@ -174,8 +168,9 @@
 		/// <summary>
 		/// Configure an SqlMap.
 		/// </summary>
-		/// <param name="document">An xml sql map onfiguration document.</param>
+		/// <param name="document">An xml sql map configuration document.</param>
 		/// <returns>the SqlMap</returns>
+		[Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
 		static public SqlMapper Configure( XmlDocument document )
 		{
 			return new DomSqlMapBuilder().Build( document, false );
@@ -186,9 +181,10 @@
 		/// </summary>
 		/// <returns>An SqlMap</returns>
 		/// <remarks>The file path is relative to the application root.</remarks>
+		[Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
 		static public SqlMapper Configure()
 		{
-			return Configure( Resources.GetConfigAsXmlDocument(DEFAULT_FILE_CONFIG_NAME) );
+			return Configure( Resources.GetConfigAsXmlDocument(DomSqlMapBuilder.DEFAULT_FILE_CONFIG_NAME) );
 		}
 
 
@@ -199,6 +195,7 @@
 		/// A relative ressource path from your Application root.
 		/// </param>
 		/// <returns>An SqlMap</returns>
+		[Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
 		public static SqlMapper Configure(string resource)
 		{
 			XmlDocument document = null;
@@ -213,48 +210,16 @@
 			return new DomSqlMapBuilder().Build( document, false);
 		}
 
-		/// <summary>
-		///  Configure an SqlMap from via a stream.
-		/// </summary>
-		/// <param name="resource">A stream resource</param>
-		/// <returns>An SqlMap</returns>
-		public static SqlMapper Configure(Stream resource)
-		{
-			XmlDocument document = Resources.GetStreamAsXmlDocument( resource );
-			return new DomSqlMapBuilder().Build( document, false);
-		}
-
-		/// <summary>
-		///  Configure an SqlMap from via a FileInfo.
-		/// </summary>
-		/// <param name="resource">A FileInfo resource</param>
-		/// <returns>An SqlMap</returns>
-		public static SqlMapper Configure(FileInfo resource)
-		{
-			XmlDocument document = Resources.GetFileInfoAsXmlDocument( resource );
-			return new DomSqlMapBuilder().Build( document, false);
-		}
-
-
-		/// <summary>
-		///  Configure an SqlMap from via an Uri.
-		/// </summary>
-		/// <param name="resource">A Uri resource</param>
-		/// <returns></returns>
-		public static SqlMapper Configure(Uri resource)
-		{
-			XmlDocument document = Resources.GetUriAsXmlDocument( resource );
-			return new DomSqlMapBuilder().Build( document, false);
-		}
 
 		/// <summary>
 		/// Configure and monitor the default configuration file for modifications 
 		/// and automatically reconfigure SqlMap. 
 		/// </summary>
 		/// <returns>An SqlMap</returns>
+		[Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
 		public static SqlMapper ConfigureAndWatch(ConfigureHandler configureDelegate)
 		{
-			return ConfigureAndWatch( DEFAULT_FILE_CONFIG_NAME, configureDelegate ) ;
+			return ConfigureAndWatch( DomSqlMapBuilder.DEFAULT_FILE_CONFIG_NAME, configureDelegate ) ;
 		}
 
 
@@ -269,6 +234,7 @@
 		/// Delegate called when the file has changed, to rebuild the dal.
 		/// </param>
 		/// <returns>An SqlMap</returns>
+		[Obsolete("This method will be remove in next version, use DomSqlMapBuilder.Configure.", false)]
 		public static SqlMapper ConfigureAndWatch( string resource, ConfigureHandler configureDelegate )
 		{
 			XmlDocument document = null;
@@ -284,55 +250,17 @@
 			ConfigWatcherHandler.ClearFilesMonitored();
 			ConfigWatcherHandler.AddFileToWatch( Resources.GetFileInfo( resource ) );
 
-			TimerCallback callBakDelegate = new TimerCallback( SqlMapper.OnConfigFileChange );
-
-			StateConfig state = new StateConfig();
-			state.fileName = resource;
-			state.configureHandler = configureDelegate;
-
-			new ConfigWatcherHandler( callBakDelegate, state );
-
-			return new DomSqlMapBuilder().Build( document, true );
-		}
-
-		/// <summary>
-		/// Configure and monitor the configuration file for modifications 
-		/// and automatically reconfigure SqlMap. 
-		/// </summary>
-		/// <param name="resource">
-		/// A relative ressource path from your Application root.
-		/// </param>
-		///<param name="configureDelegate">
-		/// Delegate called when the file has changed, to rebuild the dal.
-		/// </param>
-		/// <returns>An SqlMap</returns>
-		public static SqlMapper ConfigureAndWatch( FileInfo resource, ConfigureHandler configureDelegate )
-		{
-			XmlDocument document = Resources.GetFileInfoAsXmlDocument(resource);
-
-			ConfigWatcherHandler.ClearFilesMonitored();
-			ConfigWatcherHandler.AddFileToWatch( resource );
-
-			TimerCallback callBakDelegate = new TimerCallback( SqlMapper.OnConfigFileChange );
+			TimerCallback callBakDelegate = new TimerCallback( DomSqlMapBuilder.OnConfigFileChange );
 
 			StateConfig state = new StateConfig();
-			state.fileName = resource.FullName;
-			state.configureHandler = configureDelegate;
+			state.FileName = resource;
+			state.ConfigureHandler = configureDelegate;
 
 			new ConfigWatcherHandler( callBakDelegate, state );
 
 			return new DomSqlMapBuilder().Build( document, true );
 		}
 
-		/// <summary>
-		/// Callback called when the SqlMap.config changed.
-		/// </summary>
-		/// <param name="obj">The state config.</param>
-		public static void OnConfigFileChange(object obj)
-		{
-			StateConfig state = (StateConfig)obj;
-			state.configureHandler( null );
-		}
 
 		#endregion