springnet-commits Mailing List for Spring Framework .NET (Page 5)
Brought to you by:
aseovic,
markpollack
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(33) |
Aug
(163) |
Sep
(491) |
Oct
(289) |
Nov
(336) |
Dec
(84) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(227) |
Feb
(413) |
Mar
(128) |
Apr
(232) |
May
(92) |
Jun
(299) |
Jul
(386) |
Aug
(228) |
Sep
(237) |
Oct
(426) |
Nov
(325) |
Dec
(405) |
2006 |
Jan
(315) |
Feb
(311) |
Mar
(152) |
Apr
(177) |
May
(443) |
Jun
(92) |
Jul
(88) |
Aug
(80) |
Sep
(288) |
Oct
(515) |
Nov
(1049) |
Dec
(440) |
2007 |
Jan
(179) |
Feb
(406) |
Mar
(294) |
Apr
(80) |
May
(432) |
Jun
(242) |
Jul
(452) |
Aug
(710) |
Sep
(206) |
Oct
(240) |
Nov
(65) |
Dec
(227) |
2008 |
Jan
(80) |
Feb
(90) |
Mar
(98) |
Apr
(136) |
May
(101) |
Jun
(12) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark P. <mar...@us...> - 2008-05-03 01:01:32
|
Update of /cvsroot/springnet/Spring.Net/installer/installaware/Spring.NET-1.1 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28596 Modified Files: Spring.NET-1.1.mpr Log Message: 1.1.1 installer Index: Spring.NET-1.1.mpr =================================================================== RCS file: /cvsroot/springnet/Spring.Net/installer/installaware/Spring.NET-1.1/Spring.NET-1.1.mpr,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Spring.NET-1.1.mpr 7 Apr 2008 14:17:04 -0000 1.6 --- Spring.NET-1.1.mpr 3 May 2008 01:01:28 -0000 1.7 *************** *** 465,469 **** Spring.NET authors All rights reserved ! {AF43C2AD-1377-495D-B904-D836BB2298EC} Spring.NET Spring.NET --- 465,469 ---- Spring.NET authors All rights reserved ! {14D0B623-6ABC-472E-B174-3B1A68A54EE7} Spring.NET Spring.NET |
From: Mark P. <mar...@us...> - 2008-05-02 20:41:02
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27773/doc/reference/src Modified Files: index.xml Log Message: update version number to 1.1.2 Index: index.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/index.xml,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** index.xml 9 Apr 2008 18:40:10 -0000 1.85 --- index.xml 2 May 2008 20:40:58 -0000 1.86 *************** *** 53,58 **** <title>The Spring.NET Framework</title> <subtitle>Reference Documentation</subtitle> ! <releaseinfo>Version 1.1.1</releaseinfo> ! <pubdate>Last Updated April 9, 2008</pubdate> <authorgroup> <author> --- 53,58 ---- <title>The Spring.NET Framework</title> <subtitle>Reference Documentation</subtitle> ! <releaseinfo>Version 1.1.2</releaseinfo> ! <pubdate>Last Updated May 5, 2008</pubdate> <authorgroup> <author> |
From: Mark P. <mar...@us...> - 2008-05-02 20:41:02
|
Update of /cvsroot/springnet/Spring.Net In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27773 Modified Files: Spring.build changelog.txt readme.txt Log Message: update version number to 1.1.2 Index: changelog.txt =================================================================== RCS file: /cvsroot/springnet/Spring.Net/changelog.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** changelog.txt 7 Apr 2008 12:00:01 -0000 1.37 --- changelog.txt 2 May 2008 20:40:58 -0000 1.38 *************** *** 3,6 **** --- 3,31 ---- http://www.springframework.net + Release 1.1.2, May 5, 2008 + + + + Bug + + [SPRNET-930] - Validation user controls not rendering errors. + [SPRNET-931] - PreviousPage property is not set correctly during Server.Transfer + + Improvement + + [SPRNET-558] - Enable Data Validation and Model Management for UserControl + [SPRNET-785] - SessionScope / OSIV should obtain 1 EntityInterceptor per Session instance + [SPRNET-926] - Add PessimisticLockingFailureException as base class for CannotAcquireLockException, CannotSerializeTransactionException, and DeadlockLoserDataAccessException. + [SPRNET-927] - NHibernate Exception mapping improvements. + [SPRNET-932] - Create signed DLLs in debug build configuration + [SPRNET-933] - Support MethodInjection for objects declared inside the WebApplicationContext + [SPRNET-935] - Release DLLs built with /DEBUG:pdbonly + + Task + + [SPRNET-925] - Update documentation for DI in ASP.NET regarding use of name attribute and object definition inheritance + + + Release 1.1.1, April 7, 2008 Index: readme.txt =================================================================== RCS file: /cvsroot/springnet/Spring.Net/readme.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** readme.txt 29 Apr 2008 04:06:01 -0000 1.36 --- readme.txt 2 May 2008 20:40:58 -0000 1.37 *************** *** 1,3 **** ! THE SPRING.NET FRAMEWORK, Release 1.1.1 (April 7, 2007) -------------------------------------------------------------------- http://www.springframework.net/ --- 1,3 ---- ! THE SPRING.NET FRAMEWORK, Release 1.1.2 (March 5, 2008) -------------------------------------------------------------------- http://www.springframework.net/ *************** *** 47,50 **** --- 47,52 ---- * "examples" contains sample applications. + debug build is done using /DEBUG:full and release build using /DEBUG:pdbonly flags. + The VS.NET solution for the framework and examples are provided. *************** *** 120,124 **** There are three solution file for different version of VS.NET ! * Spring.Net.1.0.2002.sln for use with VS.NET 2002 (Core/AOP only) * Spring.Net.1.1.2003.sln for use with VS.NET 2003 * Spring.Net.1.1.2005.sln for use with VS.NET 2005 --- 122,126 ---- There are three solution file for different version of VS.NET ! * Spring.Net.1.0.2002.sln for use with VS.NET 2002 * Spring.Net.1.1.2003.sln for use with VS.NET 2003 * Spring.Net.1.1.2005.sln for use with VS.NET 2005 Index: Spring.build =================================================================== RCS file: /cvsroot/springnet/Spring.Net/Spring.build,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** Spring.build 2 May 2008 20:34:40 -0000 1.198 --- Spring.build 2 May 2008 20:40:58 -0000 1.199 *************** *** 15,19 **** <include buildfile="${spring.basedir}/Spring.include"/> ! <property name="package.version" value="1.1.1" unless="${property::exists('project.version')}"/> <property name="using-clover" value="false"/> <!-- change this to sync the sdk doc version generated --> --- 15,19 ---- <include buildfile="${spring.basedir}/Spring.include"/> ! <property name="package.version" value="1.1.2" unless="${property::exists('project.version')}"/> <property name="using-clover" value="false"/> <!-- change this to sync the sdk doc version generated --> *************** *** 676,680 **** <!-- ignore Mono 2.0 for now --> ! <!-- call target="${nant.target.root.name}-mono-2.0" / --> </target> --- 676,680 ---- <!-- ignore Mono 2.0 for now --> ! <!-- call target="${nant.target.root.name}-mono-2.0" / --> </target> |
From: Mark P. <mar...@us...> - 2008-05-02 20:34:43
|
Update of /cvsroot/springnet/Spring.Net In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25345 Modified Files: Spring.build Spring.include Log Message: SPRNET-935 - Release DLLs built with /DEBUG:pdbonly Index: Spring.build =================================================================== RCS file: /cvsroot/springnet/Spring.Net/Spring.build,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** Spring.build 29 Apr 2008 04:06:01 -0000 1.197 --- Spring.build 2 May 2008 20:34:40 -0000 1.198 *************** *** 445,476 **** <target name="build-1.0"> <call target="set-build-namespaces-release"/> ! <echo message="-------------------"/> ! <echo message="Building .NET 1.0 "/> ! <echo message="-------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.0"/> </target> <target name="build-1.1"> <call target="set-build-namespaces-release"/> ! <echo message="-------------------"/> ! <echo message="Building .NET 1.1 "/> ! <echo message="-------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.1"/> </target> <target name="build-2.0"> <call target="set-build-namespaces-release"/> ! <echo message="-------------------"/> ! <echo message="Building .NET 2.0 "/> ! <echo message="-------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-2.0"/> </target> <target name="build-mono-2.0"> ! <call target="set-build-namespaces-release"/> <echo message="--------------------------"/> <echo message="Building MONO 2.0 DEBUG "/> --- 445,509 ---- <target name="build-1.0"> <call target="set-build-namespaces-release"/> ! <echo message="------------------------"/> ! <echo message="Building .NET 1.0 DEBUG "/> ! <echo message="----------------------- "/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.0"/> + <if test="${property::exists('project.build.package') and project.build.package}"> + <echo message="--------------------------"/> + <echo message="Building .NET 1.0 RELEASE "/> + <echo message="--------------------------"/> + <call target="set-release-build-configuration"/> + <call target="compile-build-1.0"/> + </if> + </target> <target name="build-1.1"> <call target="set-build-namespaces-release"/> ! <echo message="------------------------"/> ! <echo message="Building .NET 1.1 DEBUG "/> ! <echo message="------------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.1"/> + + <if test="${property::exists('project.build.package') and project.build.package}"> + <echo message="------------------------"/> + <echo message="Building .NET 1.1 DEBUG "/> + <echo message="------------------------"/> + <call target="set-release-build-configuration"/> + <call target="compile-build-1.1"/> + </if> </target> <target name="build-2.0"> <call target="set-build-namespaces-release"/> ! <echo message="------------------------"/> ! <echo message="Building .NET 2.0 DEBUG "/> ! <echo message="------------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-2.0"/> + + + <if test="${property::exists('project.build.package') and project.build.package}"> + <echo message="--------------------------"/> + <echo message="Building .NET 2.0 RELEASE "/> + <echo message="--------------------------"/> + <call target="set-release-build-configuration"/> + <call target="compile-build-2.0"/> + </if> </target> <target name="build-mono-2.0"> ! ! <if test="${property::exists('project.build.package') and project.build.package}"> ! <call target="set-release-build-configuration"/> ! <echo message="--------------------------"/> ! <echo message="Building MONO 2.0 RELEASE "/> ! <echo message="--------------------------"/> ! <call target="compile-build-mono-2.0"/> ! </if> ! <echo message="--------------------------"/> <echo message="Building MONO 2.0 DEBUG "/> *************** *** 478,481 **** --- 511,515 ---- <call target="set-debug-build-configuration"/> <call target="compile-build-mono-2.0"/> + </target> Index: Spring.include =================================================================== RCS file: /cvsroot/springnet/Spring.Net/Spring.include,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Spring.include 29 Apr 2008 04:06:01 -0000 1.11 --- Spring.include 2 May 2008 20:34:40 -0000 1.12 *************** *** 258,262 **** <property name="compiler.args" value=""/> <property name="net-2.0" value="false"/> ! <property name="build.debug" value="true"/> <property name="build.defines.csc" value="DEBUG,TRACE"/> <property name="build.defines.jsc" value="DEBUG,TRACE"/> --- 258,262 ---- <property name="compiler.args" value=""/> <property name="net-2.0" value="false"/> ! <property name="build.debug" value="Full"/> <property name="build.defines.csc" value="DEBUG,TRACE"/> <property name="build.defines.jsc" value="DEBUG,TRACE"/> *************** *** 271,275 **** <property name="compiler.args" value=""/> <property name="net-2.0" value="false"/> ! <property name="build.debug" value="false"/> <property name="build.defines.csc" value="TRACE,STRONG"/> <property name="build.defines.jsc" value="TRACE,STRONG"/> --- 271,275 ---- <property name="compiler.args" value=""/> <property name="net-2.0" value="false"/> ! <property name="build.debug" value="PdbOnly"/> <property name="build.defines.csc" value="TRACE,STRONG"/> <property name="build.defines.jsc" value="TRACE,STRONG"/> |
From: Mark P. <mar...@us...> - 2008-05-02 20:19:46
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19411/Data/NHibernate/Config Added Files: AopConfigurationTxPointcut.xml Log Message: add test config file for autoproxy issue with <tx:attribute-driven/> and advisors --- NEW FILE: AopConfigurationTxPointcut.xml --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2008-05-02 20:19:46
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv19411 Modified Files: Spring.Data.NHibernate.Tests.2005.csproj Spring.Data.NHibernate.Tests.dll.config Log Message: add test config file for autoproxy issue with <tx:attribute-driven/> and advisors Index: Spring.Data.NHibernate.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Spring.Data.NHibernate.Tests.2005.csproj,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Spring.Data.NHibernate.Tests.2005.csproj 29 Jan 2008 20:27:32 -0000 1.7 --- Spring.Data.NHibernate.Tests.2005.csproj 2 May 2008 20:19:42 -0000 1.8 *************** *** 105,108 **** --- 105,111 ---- </None> </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Data\NHibernate\Config\AopConfigurationTxPointcut.xml" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Index: Spring.Data.NHibernate.Tests.dll.config =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Spring.Data.NHibernate.Tests.dll.config,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Spring.Data.NHibernate.Tests.dll.config 8 Aug 2007 01:54:03 -0000 1.3 --- Spring.Data.NHibernate.Tests.dll.config 2 May 2008 20:19:42 -0000 1.4 *************** *** 24,27 **** --- 24,28 ---- <parser type="Spring.Data.Config.DatabaseNamespaceParser, Spring.Data"/> <parser type="Spring.Transaction.Config.TxNamespaceParser, Spring.Data" /> + <parser type="Spring.Aop.Config.AopNamespaceParser, Spring.Aop" /> </parsers> </spring> |
From: Mark P. <mar...@us...> - 2008-05-02 20:08:33
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Integration.Tests/Data In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15109 Modified Files: NestedTxScopeTests.cs Log Message: additional method replacer test for protected virtual methods remove c: reference to temp file for building on mono misc code cleanup Index: NestedTxScopeTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Integration.Tests/Data/NestedTxScopeTests.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** NestedTxScopeTests.cs 21 Mar 2008 14:10:23 -0000 1.2 --- NestedTxScopeTests.cs 2 May 2008 20:08:29 -0000 1.3 *************** *** 140,149 **** } ! //[Test] public void UnwantedPromotion() { ! TransactionOptions transactionoptions1 = new TransactionOptions(); ! transactionoptions1.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; ! using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, transactionoptions1)) { InnerMethod(); --- 140,149 ---- } ! [Test] public void UnwantedPromotion() { ! TransactionOptions transactionoptions = new TransactionOptions(); ! transactionoptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; ! using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required, transactionoptions)) { InnerMethod(); *************** *** 162,165 **** --- 162,167 ---- cn2005.Open(); cmd.ExecuteNonQuery(); + + #region logging Console.WriteLine("TransactionSynchronizationManager.CurrentTransactionIsolationLevel = " + TransactionSynchronizationManager.CurrentTransactionIsolationLevel); *************** *** 167,170 **** --- 169,173 ---- string name = TransactionSynchronizationManager.CurrentTransactionName; bool read = TransactionSynchronizationManager.CurrentTransactionReadOnly; + #endregion } } |
From: Mark P. <mar...@us...> - 2008-05-02 20:08:27
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Xml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15089/Xml Modified Files: XmlObjectFactoryTests.cs Log Message: additional method replacer test for protected virtual methods remove c: reference to temp file for building on mono misc code cleanup Index: XmlObjectFactoryTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Xml/XmlObjectFactoryTests.cs,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** XmlObjectFactoryTests.cs 4 Feb 2008 22:44:11 -0000 1.79 --- XmlObjectFactoryTests.cs 2 May 2008 20:08:23 -0000 1.80 *************** *** 1307,1311 **** public void ResourceAndInputStream() { ! string filename = @"C:\temp\spring-test.properties"; FileInfo file = new FileInfo(filename); bool tempDirWasCreated = false; --- 1307,1312 ---- public void ResourceAndInputStream() { ! //string filename = @"C:\temp\spring-test.properties"; ! string filename = @"/temp/spring-test.properties"; FileInfo file = new FileInfo(filename); bool tempDirWasCreated = false; |
From: Mark P. <mar...@us...> - 2008-05-02 20:08:27
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15089 Modified Files: MethodReplacerTests.cs Log Message: additional method replacer test for protected virtual methods remove c: reference to temp file for building on mono misc code cleanup Index: MethodReplacerTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/MethodReplacerTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MethodReplacerTests.cs 9 Apr 2006 07:24:50 -0000 1.3 --- MethodReplacerTests.cs 2 May 2008 20:08:23 -0000 1.4 *************** *** 64,67 **** --- 64,88 ---- } + [Test] + public void SunnyDayReplaceMethod_WithProtectedVirtual() + { + RootObjectDefinition replacerDef = new RootObjectDefinition(typeof(NewsFeedFactory)); + + RootObjectDefinition managerDef = new RootObjectDefinition(typeof(ProtectedReturnsNullNewsFeedManagerWithVirtualMethod)); + managerDef.MethodOverrides.Add(new ReplacedMethodOverride("CreateNewsFeed", "replacer")); + + DefaultListableObjectFactory factory = new DefaultListableObjectFactory(); + factory.RegisterObjectDefinition("manager", managerDef); + factory.RegisterObjectDefinition("replacer", replacerDef); + ProtectedReturnsNullNewsFeedManagerWithVirtualMethod manager = (ProtectedReturnsNullNewsFeedManagerWithVirtualMethod)factory["manager"]; + NewsFeed feed1 = manager.GrabNewsFeed(); + Assert.IsNotNull(feed1, "The protected CreateNewsFeed() method is not being replaced."); + Assert.AreEqual(NewsFeedFactory.DefaultName, feed1.Name); + NewsFeed feed2 = manager.GrabNewsFeed(); + // NewsFeedFactory always yields a new NewsFeed (see class definition below)... + Assert.IsFalse(ReferenceEquals(feed1, feed2)); + + } + [Test] public void SunnyDayReplaceMethod_WithArgumentAcceptingReplacer() *************** *** 429,432 **** --- 450,454 ---- } + public interface INewsFeedManager { |
From: Mark P. <mar...@us...> - 2008-05-02 20:08:19
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Xml In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15076 Modified Files: resource.xml Log Message: additional method replacer test for protected virtual methods remove c: reference to temp file for building on mono misc code cleanup Index: resource.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Data/Spring/Objects/Factory/Xml/resource.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** resource.xml 6 Nov 2006 20:00:07 -0000 1.7 --- resource.xml 2 May 2008 20:08:15 -0000 1.8 *************** *** 4,19 **** <object id="resource1" type="Spring.Objects.ResourceTestObject, Spring.Core.Tests"> <property name="resource"> ! <value>file:///C:/temp/spring-test.properties</value> </property> <property name="inputStream"> ! <value>file:///C:/temp/spring-test.properties</value> </property> </object> <object id="resource2" type="Spring.Objects.ResourceTestObject, Spring.Core.Tests"> <constructor-arg index="0"> ! <value>file:///C:/temp/spring-test.properties</value> </constructor-arg> <constructor-arg index="1"> ! <value>file:///C:/temp/spring-test.properties</value> </constructor-arg> </object> --- 4,19 ---- <object id="resource1" type="Spring.Objects.ResourceTestObject, Spring.Core.Tests"> <property name="resource"> ! <value>file:///temp/spring-test.properties</value> </property> <property name="inputStream"> ! <value>file:///temp/spring-test.properties</value> </property> </object> <object id="resource2" type="Spring.Objects.ResourceTestObject, Spring.Core.Tests"> <constructor-arg index="0"> ! <value>file:///temp/spring-test.properties</value> </constructor-arg> <constructor-arg index="1"> ! <value>file:///temp/spring-test.properties</value> </constructor-arg> </object> |
From: Mark P. <mar...@us...> - 2008-05-02 16:44:58
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Objects/Factory/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4977 Modified Files: WebInstantiationStrategy.cs Log Message: SPRNET-933 - Support MethodInjection for objects declared inside the WebApplicationContext Index: WebInstantiationStrategy.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Objects/Factory/Support/WebInstantiationStrategy.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WebInstantiationStrategy.cs 1 Aug 2007 23:10:46 -0000 1.3 --- WebInstantiationStrategy.cs 2 May 2008 16:44:50 -0000 1.4 *************** *** 42,46 **** /// <version>$Id$</version> [Serializable] ! public class WebInstantiationStrategy : SimpleInstantiationStrategy { /// <summary> --- 42,46 ---- /// <version>$Id$</version> [Serializable] ! public class WebInstantiationStrategy : MethodInjectingInstantiationStrategy { /// <summary> |
From: Mark P. <mar...@us...> - 2008-05-02 16:44:50
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4963 Modified Files: MethodInjectingInstantiationStrategy.cs Log Message: SPRNET-933 - Support MethodInjection for objects declared inside the WebApplicationContext Index: MethodInjectingInstantiationStrategy.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/MethodInjectingInstantiationStrategy.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MethodInjectingInstantiationStrategy.cs 8 Aug 2007 04:01:56 -0000 1.12 --- MethodInjectingInstantiationStrategy.cs 2 May 2008 16:44:44 -0000 1.13 *************** *** 52,56 **** /// <version>$Id$</version> [Serializable] ! public sealed class MethodInjectingInstantiationStrategy : SimpleInstantiationStrategy { /// <summary> --- 52,56 ---- /// <version>$Id$</version> [Serializable] ! public class MethodInjectingInstantiationStrategy : SimpleInstantiationStrategy { /// <summary> |
From: Mark P. <mar...@us...> - 2008-05-02 16:43:34
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv4550 Modified Files: objects.xml Log Message: fix docs on registratin of custom resources. Index: objects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/objects.xml,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** objects.xml 21 Apr 2008 19:34:32 -0000 1.123 --- objects.xml 2 May 2008 16:43:30 -0000 1.124 *************** *** 5000,5004 **** <resources> ! <resource protocol="db" type="MyCompany.MyApp.Resources.MyDbResource"/> </resources> --- 5000,5004 ---- <resources> ! <handler protocol="db" type="MyCompany.MyApp.Resources.MyDbResource"/> </resources> |
From: Marko L. <la...@us...> - 2008-05-01 12:50:39
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20/Data/NHibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30699 Modified Files: LocalSessionFactoryObject.cs Log Message: Added support for schema create, drop and update Index: LocalSessionFactoryObject.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20/Data/NHibernate/LocalSessionFactoryObject.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LocalSessionFactoryObject.cs 7 Apr 2008 20:12:53 -0000 1.1 --- LocalSessionFactoryObject.cs 1 May 2008 12:50:34 -0000 1.2 *************** *** 25,37 **** --- 25,42 ---- using System.Collections.Generic; using System.Data; + using System.Data.Common; + using Common.Logging; using NHibernate; using NHibernate.Cfg; using NHibernate.Connection; + using NHibernate.Dialect; using NHibernate.Engine; using NHibernate.Event; + using NHibernate.Tool.hbm2ddl; using Spring.Core.IO; using Spring.Data.Common; + using Spring.Data.Support; using Spring.Objects.Factory; *************** *** 86,89 **** --- 91,96 ---- private IDictionary eventListeners; + private bool schemaUpdate = false; + #endregion *************** *** 242,245 **** --- 249,265 ---- } + /// <summary> + /// Set whether to execute a schema update after SessionFactory initialization. + /// <p> + /// For details on how to make schema update scripts work, see the NHibernate + /// documentation, as this class leverages the same schema update script support + /// in <see cref="Configuration" /> as NHibernate's own SchemaUpdate tool. + /// </p> + /// </summary> + public bool SchemaUpdate + { + set { schemaUpdate = value; } + } + #endregion *************** *** 305,309 **** // Can be overridden by a custom value for the corresponding Hibernate property config.SetProperty(Environment.CurrentSessionContextClass, ! "Spring.Data.NHibernate.SpringSessionContext, Spring.Data.NHibernate12"); } --- 325,329 ---- // Can be overridden by a custom value for the corresponding Hibernate property config.SetProperty(Environment.CurrentSessionContextClass, ! "Spring.Data.NHibernate.SpringSessionContext, Spring.Data.NHibernate20"); } *************** *** 407,411 **** this.sessionFactory = NewSessionFactory(config); ! } --- 427,431 ---- this.sessionFactory = NewSessionFactory(config); ! AfterSessionFactoryCreation(); } *************** *** 457,460 **** --- 477,642 ---- /// <summary> + /// Executes schema update if requested. + /// </summary> + protected virtual void AfterSessionFactoryCreation() + { + if (this.schemaUpdate) + { + UpdateDatabaseSchema(); + } + } + + /// <summary> + /// Execute schema drop script, determined by the Configuration object + /// used for creating the SessionFactory. A replacement for NHibernate's + /// SchemaExport class, to be invoked on application setup. + /// </summary> + /// <remarks> + /// Fetch the LocalSessionFactoryBean itself rather than the exposed + /// SessionFactory to be able to invoke this method, e.g. via + /// <code>LocalSessionFactoryObject lsfb = (LocalSessionFactoryObject) ctx.GetObject("mySessionFactory");</code>. + /// <p> + /// Uses the SessionFactory that this bean generates for accessing a ADO.NET + /// connection to perform the script. + /// </p> + /// </remarks> + public void DropDatabaseSchema() + { + log.Info("Dropping database schema for NHibernate SessionFactory"); + HibernateTemplate hibernateTemplate = new HibernateTemplate(sessionFactory); + hibernateTemplate.Execute( + new HibernateDelegate(delegate(ISession session) + { + IDbConnection con = session.Connection; + Dialect dialect = Dialect.GetDialect(Configuration.Properties); + string[] sql = Configuration.GenerateDropSchemaScript(dialect); + ExecuteSchemaScript(con, sql); + return null; + })); + + } + + /// <summary> + /// Execute schema creation script, determined by the Configuration object + /// used for creating the SessionFactory. A replacement for NHibernate's + /// SchemaExport class, to be invoked on application setup. + /// </summary> + /// <remarks> + /// Fetch the LocalSessionFactoryObject itself rather than the exposed + /// SessionFactory to be able to invoke this method, e.g. via + /// <code>LocalSessionFactoryObject lsfo = (LocalSessionFactoryObject) ctx.GetObject("mySessionFactory");</code>. + /// <p> + /// Uses the SessionFactory that this bean generates for accessing a ADO.NET + /// connection to perform the script. + /// </p> + /// </remarks> + public void CreateDatabaseSchema() + { + log.Info("Creating database schema for Hibernate SessionFactory"); + HibernateTemplate hibernateTemplate = new HibernateTemplate(sessionFactory); + hibernateTemplate.Execute( + new HibernateDelegate(delegate (ISession session) + { + IDbConnection con = session.Connection; + Dialect dialect = Dialect.GetDialect(Configuration.Properties); + string[] sql = Configuration.GenerateSchemaCreationScript(dialect); + ExecuteSchemaScript(con, sql); + return null; + + })); + } + + /// <summary> + /// Execute schema update script, determined by the Configuration object + /// used for creating the SessionFactory. A replacement for NHibernate's + /// SchemaUpdate class, for automatically executing schema update scripts + /// on application startup. Can also be invoked manually. + /// </summary> + /// <remarks> + /// Fetch the LocalSessionFactoryObject itself rather than the exposed + /// SessionFactory to be able to invoke this method, e.g. via + /// <code>LocalSessionFactoryObject lsfo = (LocalSessionFactoryObject) ctx.GetObject("mySessionFactory");</code>. + /// <p> + /// Uses the SessionFactory that this bean generates for accessing a ADO.NET + /// connection to perform the script. + /// </p> + /// </remarks> + public virtual void UpdateDatabaseSchema() + { + log.Info("Updating database schema for Hibernate SessionFactory"); + HibernateTemplate hibernateTemplate = new HibernateTemplate(sessionFactory); + hibernateTemplate.TemplateFlushMode = TemplateFlushMode.Never; + hibernateTemplate.Execute( + new HibernateDelegate(delegate(ISession session) + { + IDbConnection con = session.Connection; + Dialect dialect = Dialect.GetDialect(Configuration.Properties); + DatabaseMetadata metadata = new DatabaseMetadata((DbConnection) con, dialect); + string[] sql = Configuration.GenerateSchemaUpdateScript(dialect, metadata); + ExecuteSchemaScript(con, sql); + return null; + })); + } + + + /// <summary> + /// Execute the given schema script on the given ADO.NET Connection. + /// </summary> + /// <remarks> + /// Note that the default implementation will log unsuccessful statements + /// and continue to execute. Override the <code>ExecuteSchemaStatement</code> + /// method to treat failures differently. + /// </remarks> + /// <param name="con">The connection to use.</param> + /// <param name="sql">The SQL statement to execute.</param> + protected virtual void ExecuteSchemaScript(IDbConnection con, string[] sql) + { + if (sql != null && sql.Length > 0) + { + IDbCommand cmd = con.CreateCommand(); + try + { + for (int i = 0; i < sql.Length; i++) + { + ExecuteSchemaStatement(cmd, sql[i]); + } + } + finally + { + AdoUtils.DisposeCommand(cmd); + } + } + } + + /// <summary> + /// Execute the given schema SQL on the given ADO.NET command. + /// </summary> + /// <remarks> + /// Note that the default implementation will log unsuccessful statements + /// and continue to execute. Override this method to treat failures differently. + /// </remarks> + /// <param name="cmd"></param> + /// <param name="sql"></param> + protected virtual void ExecuteSchemaStatement(IDbCommand cmd, string sql) + { + if (log.IsDebugEnabled) + { + log.Debug("Executing schema statement: " + sql); + } + try + { + cmd.CommandText = sql; + cmd.ExecuteNonQuery(); + } + catch (ADOException ex) + { + if (log.IsWarnEnabled) + { + log.Warn("Unsuccessful schema statement: " + sql, ex); + } + } + } + + /// <summary> /// Subclasses can override this method to perform custom initialization /// of the SessionFactory instance, creating it via the given Configuration |
From: Mark P. <mar...@us...> - 2008-04-29 04:06:06
|
Update of /cvsroot/springnet/Spring.Net In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20324 Modified Files: Spring.build Spring.include readme.txt Log Message: SPRNET-932 - Create signed "debug" DLLs (with .PDBs) and remove 'release' directory in distribution. Index: Spring.build =================================================================== RCS file: /cvsroot/springnet/Spring.Net/Spring.build,v retrieving revision 1.196 retrieving revision 1.197 diff -C2 -d -r1.196 -r1.197 *** Spring.build 1 Apr 2008 19:51:01 -0000 1.196 --- Spring.build 29 Apr 2008 04:06:01 -0000 1.197 *************** *** 11,14 **** --- 11,15 ---- <property name="project.build.config" value="debug"/> <property name="project.build.package" value="false"/> + <property name="project.build.sign" value="true"/> <!-- Include spring helpers --> <include buildfile="${spring.basedir}/Spring.include"/> *************** *** 275,279 **** <target name="compile-build-mono-2.0" description="Builds for mono 2.0 if available"> <if test="${framework::exists('mono-2.0')}"> ! <call target="compile-mono-2.0"/> </if> <if test="${not framework::exists('mono-2.0')}"> --- 276,280 ---- <target name="compile-build-mono-2.0" description="Builds for mono 2.0 if available"> <if test="${framework::exists('mono-2.0')}"> ! <call target="compile-mono-2.0"/> </if> <if test="${not framework::exists('mono-2.0')}"> *************** *** 345,355 **** <target name="compile-net-1.0" description="Builds .NET Framework 1.0 version" depends="set-net-1.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> - <!-- initialize the temp.build.skip property to false --> - <call target="common.generate-assemblyinfo"/> <property name="temp.build.skip" value="false"/> <!-- configure build --> - <call target="copykeys"> - </call> <if test="${not temp.build.skip}"> <!-- disable namespaces not supported in net-1.0 --> --- 346,354 ---- <target name="compile-net-1.0" description="Builds .NET Framework 1.0 version" depends="set-net-1.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> + <call target="copykeys" if="${project.build.sign}"/> + <call target="common.generate-assemblyinfo"/> <property name="temp.build.skip" value="false"/> <!-- configure build --> <if test="${not temp.build.skip}"> <!-- disable namespaces not supported in net-1.0 --> *************** *** 362,369 **** <target name="compile-net-1.1" description="Builds .NET Framework 1.1 version" depends="set-net-1.1-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> <call target="common.generate-assemblyinfo"/> - <!-- initialize the temp.build.skip property to false --> <property name="temp.build.skip" value="false"/> - <call target="copykeys"/> <if test="${not temp.build.skip}"> <call target="compile-test" /> --- 361,367 ---- <target name="compile-net-1.1" description="Builds .NET Framework 1.1 version" depends="set-net-1.1-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> + <call target="copykeys" if="${project.build.sign}"/> <call target="common.generate-assemblyinfo"/> <property name="temp.build.skip" value="false"/> <if test="${not temp.build.skip}"> <call target="compile-test" /> *************** *** 373,380 **** <target name="compile-net-2.0" description="Builds .NET Framework 2.0 version" depends="set-net-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> <call target="common.generate-assemblyinfo"/> - <!-- initialize the temp.build.skip property to false --> <property name="temp.build.skip" value="false"/> - <call target="copykeys"/> <if test="${not temp.build.skip}"> <call target="compile-test" /> --- 371,377 ---- <target name="compile-net-2.0" description="Builds .NET Framework 2.0 version" depends="set-net-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> + <call target="copykeys" if="${project.build.sign}"/> <call target="common.generate-assemblyinfo"/> <property name="temp.build.skip" value="false"/> <if test="${not temp.build.skip}"> <call target="compile-test" /> *************** *** 384,390 **** <target name="compile-mono-2.0" description="Builds MONO Framework 2.0 version" depends="set-mono-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> ! <!-- initialize the temp.build.skip property to false --> <property name="temp.build.skip" value="false"/> - <call target="copykeys"/> <if test="${not temp.build.skip}"> <call target="compile-test" /> --- 381,387 ---- <target name="compile-mono-2.0" description="Builds MONO Framework 2.0 version" depends="set-mono-2.0-runtime-configuration, check-spring-basedir, clean-current-bin-dir, TestInit"> ! <call target="copykeys" if="${project.build.sign}"/> ! <call target="common.generate-assemblyinfo"/> <property name="temp.build.skip" value="false"/> <if test="${not temp.build.skip}"> <call target="compile-test" /> *************** *** 393,397 **** <target name="copykeys"> ! <if test="${current.build.config.release}"> <if test="${not file::exists(spring.basedir + '/Spring.Net.snk')}"> <if test="${property::exists('project.build.package') and project.build.package}"> --- 390,394 ---- <target name="copykeys"> ! <if test="${not file::exists(spring.basedir + '/Spring.Net.snk')}"> <if test="${property::exists('project.build.package') and project.build.package}"> *************** *** 414,418 **** <property name="compiler.args" value="/keyfile:..\..\..\Spring.Net.snk"/> </if> ! </if> </target> --- 411,415 ---- <property name="compiler.args" value="/keyfile:..\..\..\Spring.Net.snk"/> </if> ! </target> *************** *** 448,463 **** <target name="build-1.0"> <call target="set-build-namespaces-release"/> ! ! <if test="${property::exists('project.build.package') and project.build.package}"> ! <call target="set-release-build-configuration"/> ! <echo message="--------------------------"/> ! <echo message="Building .NET 1.0 RELEASE "/> ! <echo message="--------------------------"/> ! <call target="compile-build-1.0"/> ! </if> ! ! <echo message="--------------------------"/> ! <echo message="Building .NET 1.0 DEBUG "/> ! <echo message="--------------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.0"/> --- 445,451 ---- <target name="build-1.0"> <call target="set-build-namespaces-release"/> ! <echo message="-------------------"/> ! <echo message="Building .NET 1.0 "/> ! <echo message="-------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.0"/> *************** *** 467,508 **** <target name="build-1.1"> <call target="set-build-namespaces-release"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.1"/> - - <if test="${property::exists('project.build.package') and project.build.package}"> - <call target="set-release-build-configuration"/> - <call target="compile-build-1.1"/> - </if> </target> <target name="build-2.0"> <call target="set-build-namespaces-release"/> <call target="set-debug-build-configuration"/> <call target="compile-build-2.0"/> - - <if test="${property::exists('project.build.package') and project.build.package}"> - <call target="set-release-build-configuration"/> - <call target="compile-build-2.0"/> - </if> - </target> <target name="build-mono-2.0"> <call target="set-build-namespaces-release"/> ! ! <if test="${property::exists('project.build.package') and project.build.package}"> ! <call target="set-release-build-configuration"/> ! <echo message="--------------------------"/> ! <echo message="Building MONO 2.0 RELEASE "/> ! <echo message="--------------------------"/> ! <call target="compile-build-mono-2.0"/> ! </if> ! ! <echo message="--------------------------"/> ! <echo message="Building MONO 2.0 DEBUG "/> ! <echo message="--------------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-mono-2.0"/> - </target> --- 455,481 ---- <target name="build-1.1"> <call target="set-build-namespaces-release"/> + <echo message="-------------------"/> + <echo message="Building .NET 1.1 "/> + <echo message="-------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-1.1"/> </target> <target name="build-2.0"> <call target="set-build-namespaces-release"/> + <echo message="-------------------"/> + <echo message="Building .NET 2.0 "/> + <echo message="-------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-2.0"/> </target> <target name="build-mono-2.0"> <call target="set-build-namespaces-release"/> ! <echo message="--------------------------"/> ! <echo message="Building MONO 2.0 DEBUG "/> ! <echo message="--------------------------"/> <call target="set-debug-build-configuration"/> <call target="compile-build-mono-2.0"/> </target> *************** *** 613,620 **** <target name="package" depends="set-package-configuration" description="Build and Package distribution"> - <property name="project.build.package" value="true"/> - <call target="clean-current-package-dir"/> --- 586,591 ---- *************** *** 627,632 **** <call target="prepare-docs"/> <exec workingdir="./doc" program="cmd.exe" commandline="/c ant refdoc"/> ! <call target="set-release-build-configuration"/> <call target="package-release-files"/> </target> --- 598,604 ---- <call target="prepare-docs"/> <exec workingdir="./doc" program="cmd.exe" commandline="/c ant refdoc"/> ! <call target="package-release-files"/> + </target> *************** *** 893,897 **** <exclude name="**/examples/**"/> <exclude name="**/results/**"/> ! <exclude name="mono/**"/> </fileset> </copy> --- 865,869 ---- <exclude name="**/examples/**"/> <exclude name="**/results/**"/> ! <exclude name="mono/**"/> </fileset> </copy> Index: readme.txt =================================================================== RCS file: /cvsroot/springnet/Spring.Net/readme.txt,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** readme.txt 4 Apr 2008 15:24:17 -0000 1.35 --- readme.txt 29 Apr 2008 04:06:01 -0000 1.36 *************** *** 1,3 **** ! THE SPRING.NET FRAMEWORK, Release 1.1.1 (April 4, 2007) -------------------------------------------------------------------- http://www.springframework.net/ --- 1,3 ---- ! THE SPRING.NET FRAMEWORK, Release 1.1.1 (April 7, 2007) -------------------------------------------------------------------- http://www.springframework.net/ *************** *** 132,144 **** To build the source and run the unit tests type ! nant test NOTE! You need to comment out the <startup> section of NAnt.exe.config in order to property run unit tests under different version of the .NET framework. ! Release builds are strongly named using the Spring.Net.snk key file. The ANTLR assemblies are signed with this key as well until such time as the ANTR distribution provides their ! own strongly signed assemblies. If you want to run the release build you can generate a ! key file by executing the following commands sn -k Spring.Net.snk --- 132,144 ---- To build the source and run the unit tests type ! nant test -D:project.build.sign=false NOTE! You need to comment out the <startup> section of NAnt.exe.config in order to property run unit tests under different version of the .NET framework. ! Debug builds are strongly named using the Spring.Net.snk key file. The ANTLR assemblies are signed with this key as well until such time as the ANTR distribution provides their ! own strongly signed assemblies. If you want to run the build to creat strongly signed ! assebmlies you can generate a key file by executing the following commands sn -k Spring.Net.snk Index: Spring.include =================================================================== RCS file: /cvsroot/springnet/Spring.Net/Spring.include,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Spring.include 1 Apr 2008 19:51:02 -0000 1.10 --- Spring.include 29 Apr 2008 04:06:01 -0000 1.11 *************** *** 240,245 **** <attribute type="AssemblyVersionAttribute" value="${assembly.version}" /> ! <attribute type="AssemblyDelaySignAttribute" value="false" if="${current.build.config == 'release'}" /> ! <attribute type="AssemblyKeyFileAttribute" value="${assembly.keyfile}" if="${current.build.config == 'release' and (nant.settings.currentframework == 'net-1.0' or nant.settings.currentframework == 'net-1.1')}" /> --- 240,245 ---- <attribute type="AssemblyVersionAttribute" value="${assembly.version}" /> ! <attribute type="AssemblyDelaySignAttribute" value="false"/> ! <attribute type="AssemblyKeyFileAttribute" value="${assembly.keyfile}" if="${(nant.settings.currentframework == 'net-1.0' or nant.settings.currentframework == 'net-1.1')}" /> |
From: Mark P. <mar...@us...> - 2008-04-29 01:46:03
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv328 Modified Files: web.xml Log Message: SPRNET-925 - Update documentation for DI in ASP.NET regarding use of name attribute and object definition inheritance Index: web.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/web.xml,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** web.xml 3 Apr 2008 06:03:10 -0000 1.38 --- web.xml 29 Apr 2008 01:45:56 -0000 1.39 *************** *** 44,47 **** --- 44,57 ---- upcoming ASP.NET MVC support.</para> + <para></para> + + <para>Spring.Web also adds support for applying the dependency injection + principle to one's ASP.NET <classname>Pages</classname> and + <classname>Controls</classname> as well as http modules and custom + provider modules. This means that application developers can easily inject + service dependencies into web controllers by leveraging the power of the + Spring.NET IoC container. See <link linkend="web-di">Dependency Injection + for ASP.NET Pages</link> for more information.</para> + <para>As we said earlier, event handlers in code-behind classes really should not have to deal with ASP.NET UI controls directly. Such event *************** *** 86,97 **** more information.</para> - <para>Spring.Web also adds support for applying the dependency injection - principle to one's ASP.NET <classname>Pages</classname> and - <classname>Controls</classname> as well as http modules and custom - provider modules. This means that application developers can easily inject - service dependencies into web controllers by leveraging the power of the - Spring.NET IoC container. See <link linkend="web-di">Dependency Injection - for ASP.NET Pages</link> for more information.</para> - <para>In addition to the aforementioned features that can be considered to be the <emphasis>'core'</emphasis> features of the Spring.Web framework, --- 96,99 ---- *************** *** 415,419 **** <programlisting><objects xmlns="http://www.springframework.net"> ! <object id="basePage" abstract="true"> <property name="MasterPageFile" value="~/Web/StandardTemplate.master"/> </object> --- 417,421 ---- <programlisting><objects xmlns="http://www.springframework.net"> ! <object name="basePage" abstract="true"> <property name="MasterPageFile" value="~/Web/StandardTemplate.master"/> </object> *************** *** 481,491 **** simply use the name of the <literal>.aspx</literal> file as the object identifier (minus any leading path information, and minus the file ! extension too).</para> ! <para>Of course, nothing prevents an application developer from specifying ! an <literal>id</literal> or <literal>name</literal> value explicitly; one ! use case when the explicit naming might be useful is when one wants to ! expose the same page multiple times using a slightly different ! configuration (Add / Edit pages for example).</para> <sect2 id="web-di-controls"> --- 483,496 ---- simply use the name of the <literal>.aspx</literal> file as the object identifier (minus any leading path information, and minus the file ! extension too). </para> ! <para>Nothing prevents an application developer from specifying an ! <literal>id</literal> or <literal>name</literal> value explicitly; one use ! case when the explicit naming might be useful is when one wants to expose ! the same page multiple times using a slightly different configuration (Add ! / Edit pages for example). If you would like to use abstract object ! definitions and have your page inherit from them, the use of the name ! attribute should be used instead of the id attribute on the abstract ! object definition.</para> <sect2 id="web-di-controls"> *************** *** 829,833 **** <objects xmlns="http://www.springframework.net"> ! <object id="basePage" abstract="true"> <property name="MasterPageFile" value="~/MasterLayout.ascx"/> </object> --- 834,838 ---- <objects xmlns="http://www.springframework.net"> ! <object name="basePage" abstract="true"> <property name="MasterPageFile" value="~/MasterLayout.ascx"/> </object> *************** *** 1860,1864 **** <programlisting><object id="localizer" type="Spring.Globalization.Localizers.ResourceSetLocalizer, Spring.Core"/> ! <object id="basePage" abstract="true"> <description> Pages that reference this definition as their parent --- 1865,1869 ---- <programlisting><object id="localizer" type="Spring.Globalization.Localizers.ResourceSetLocalizer, Spring.Core"/> ! <object name="basePage" abstract="true"> <description> Pages that reference this definition as their parent *************** *** 2002,2006 **** shown below.</para> ! <programlisting><object id="BasePage" abstract="true"> <property name="CultureResolver"> <object type="Spring.Globalization.Resolvers.CookieCultureResolver, Spring.Web"/> --- 2007,2011 ---- shown below.</para> ! <programlisting><object name="BasePage" abstract="true"> <property name="CultureResolver"> <object type="Spring.Globalization.Resolvers.CookieCultureResolver, Spring.Web"/> *************** *** 2396,2400 **** such configuration is shown below:</para> ! <programlisting><object id="basePage" abstract="true"> <description> Convenience base page definition for all the pages. --- 2401,2405 ---- such configuration is shown below:</para> ! <programlisting><object name="basePage" abstract="true"> <description> Convenience base page definition for all the pages. *************** *** 2424,2435 **** <para>The location in the web page where validation errors are to be ! rendered can be specifies by using the ValidationSummary and ! ValidationError controls. There are two controls since they have ! different defaults for how errors are rendered. ValidationSummary is ! used to display potentially multiple errors identified by the validation ! framework. ValidationError is used to display field-level validation ! errors. Please refer to the validation section <link ! linkend="validation-aspnet-usage">ASP.NET usage tips</link> for more ! information.</para> </sect2> --- 2429,2443 ---- <para>The location in the web page where validation errors are to be ! rendered can be specifies by using the ! <classname>ValidationSummary</classname> and ! <classname>ValidationError</classname> controls. There are two controls ! since they have different defaults for how errors are rendered. ! <classname>ValidationSummary</classname> is used to display potentially ! multiple errors identified by the validation framework. ! <classname>ValidationError</classname> is used to display field-level ! validation errors. Please refer to the section <link ! linkend="validation-aspnet-usage">ASP.NET usage tips</link> in the ! chapter on the <link linkend="validation">Validation Framework</link> ! more information.</para> </sect2> |
From: Mark P. <mar...@us...> - 2008-04-25 13:25:18
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv3063 Modified Files: SessionScopeSettingsTests.cs Log Message: SPRNET-785 - SessionScope / OSIV should obtain 1 EntityInterceptor per Session instance Index: SessionScopeSettingsTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeSettingsTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SessionScopeSettingsTests.cs 22 Aug 2007 20:17:43 -0000 1.1 --- SessionScopeSettingsTests.cs 25 Apr 2008 13:25:09 -0000 1.2 *************** *** 102,110 **** Assert.AreEqual(SessionScopeSettings.FLUSHMODE_DEFAULT, sss.DefaultFlushMode); ! try ! { ! IInterceptor interceptor = sss.EntityInterceptor; ! Assert.Fail("should fail, because derived classes must override ResolveEntityInterceptor()"); ! }catch(NotImplementedException) {} try --- 102,107 ---- Assert.AreEqual(SessionScopeSettings.FLUSHMODE_DEFAULT, sss.DefaultFlushMode); ! IInterceptor interceptor = sss.EntityInterceptor; ! Assert.IsNull(interceptor); try |
From: Mark P. <mar...@us...> - 2008-04-24 21:32:10
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv30261 Modified Files: SessionScopeTests.cs Log Message: SPRNET-785 - SessionScope / OSIV should obtain 1 EntityInterceptor per Session instance Index: SessionScopeTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.NHibernate.Tests/Data/NHibernate/Support/SessionScopeTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SessionScopeTests.cs 21 Mar 2008 01:17:12 -0000 1.3 --- SessionScopeTests.cs 24 Apr 2008 21:32:07 -0000 1.4 *************** *** 2,6 **** /* ! * Copyright © 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); --- 2,6 ---- /* ! * Copyright © 2002-2008 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 32,36 **** { /// <summary> ! /// /// </summary> /// <author>Erich Eichinger</author> --- 32,36 ---- { /// <summary> ! /// Tests for SessionScope /// </summary> /// <author>Erich Eichinger</author> *************** *** 74,77 **** --- 74,108 ---- [Test] + public void CanCreateAndCloseSimpleCtor() + { + using (repository.Ordered()) + { + ISession session = (ISession) repository.CreateMock(typeof (ISession)); + Expect.Call(expectedSessionFactory.OpenSession()).Return(session); + session.FlushMode = FlushMode.Never; + Expect.Call(session.Close()).Return(null); + } + repository.ReplayAll(); + using (SessionScope scope = new SessionScope(expectedSessionFactory, true)) + { + // no op - just create & dispose + Assert.AreSame(expectedSessionFactory, scope.SessionFactory); + //Assert.AreSame(null, scope.EntityInterceptor); + Assert.AreEqual(expectedSingleSession, scope.SingleSession); + Assert.AreEqual(expectedDefaultFlushMode, scope.DefaultFlushMode); + + // ensure SessionHolder object is registered with TSM + Assert.IsTrue(TransactionSynchronizationManager.HasResource(expectedSessionFactory)); + + SessionHolder sessionHolder = + (SessionHolder) TransactionSynchronizationManager.GetResource(expectedSessionFactory); + // by default session is lazy, so ask for it. + Assert.IsNotNull(sessionHolder.Session); + scope.Close(); + } + repository.VerifyAll(); + } + + [Test] [ExpectedException(typeof(InvalidOperationException))] public void OpeningTwiceThrowsInvalidOperationException() |
From: Mark P. <mar...@us...> - 2008-04-24 21:32:10
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29951 Modified Files: SessionScopeSettings.cs Log Message: SPRNET-785 - SessionScope / OSIV should obtain 1 EntityInterceptor per Session instance Index: SessionScopeSettings.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate/Data/NHibernate/Support/SessionScopeSettings.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SessionScopeSettings.cs 21 Mar 2008 01:17:12 -0000 1.2 --- SessionScopeSettings.cs 24 Apr 2008 21:32:02 -0000 1.3 *************** *** 195,199 **** protected virtual IInterceptor ResolveEntityInterceptor() { ! throw new NotImplementedException("you need to override this method to resolve an IInterceptor instance"); } --- 195,199 ---- protected virtual IInterceptor ResolveEntityInterceptor() { ! return null; } |
From: Erich E. <oak...@us...> - 2008-04-23 15:55:30
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24049 Modified Files: PageHandlerFactory.cs Log Message: fixed SPRNET-931 Index: PageHandlerFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Support/PageHandlerFactory.cs,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** PageHandlerFactory.cs 5 Apr 2008 14:52:44 -0000 1.39 --- PageHandlerFactory.cs 23 Apr 2008 15:42:46 -0000 1.40 *************** *** 171,175 **** #if NET_2_0 private static readonly FieldInfo fiHttpContext_CurrentHandler = ! typeof (HttpContext).GetField("_currentHandler", BindingFlags.NonPublic | BindingFlags.Instance); #endif --- 171,177 ---- #if NET_2_0 private static readonly FieldInfo fiHttpContext_CurrentHandler = ! typeof(HttpContext).GetField("_currentHandler", BindingFlags.NonPublic | BindingFlags.Instance); ! private static readonly MethodInfo miPage_SetPreviousPage = ! typeof(System.Web.UI.Page).GetMethod("SetPreviousPage", BindingFlags.NonPublic | BindingFlags.Instance); #endif *************** *** 272,275 **** --- 274,288 ---- fiHttpContext_CurrentHandler.SetValue(context, handler); } + + if (handler is System.Web.UI.Page) + { + System.Web.UI.Page page = (Page) handler; + + // During Server.Transfer/Execute() the PreviousPage property gets set + if (this.PreviousPage != null) + { + miPage_SetPreviousPage.Invoke(page, new object[] { this.PreviousPage }); + } + } #endif |
From: Marko L. <la...@us...> - 2008-04-23 11:41:49
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20/Data/NHibernate In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26900/Data/NHibernate Modified Files: HibernateOptimisticLockingFailureException.cs Log Message: Synchronizing with latest changes in NHibernate 1.2 integration Index: HibernateOptimisticLockingFailureException.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20/Data/NHibernate/HibernateOptimisticLockingFailureException.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HibernateOptimisticLockingFailureException.cs 7 Apr 2008 20:12:53 -0000 1.1 --- HibernateOptimisticLockingFailureException.cs 23 Apr 2008 11:41:41 -0000 1.2 *************** *** 64,67 **** --- 64,75 ---- /// <summary> + /// Initializes a new instance of the <see cref="HibernateOptimisticLockingFailureException"/> class. + /// </summary> + /// <param name="ex">The StaleStateException.</param> + public HibernateOptimisticLockingFailureException(StaleStateException ex) : base(ex.Message, ex) + { + } + + /// <summary> /// Creates a new instance of the /// <see cref="HibernateOptimisticLockingFailureException"/> class. |
From: Marko L. <la...@us...> - 2008-04-23 11:41:49
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20 In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26900 Modified Files: Spring.Data.NHibernate20.2005.csproj Spring.Data.NHibernate20.build Log Message: Synchronizing with latest changes in NHibernate 1.2 integration Index: Spring.Data.NHibernate20.build =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20/Spring.Data.NHibernate20.build,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.Data.NHibernate20.build 7 Apr 2008 20:12:53 -0000 1.1 --- Spring.Data.NHibernate20.build 23 Apr 2008 11:41:41 -0000 1.2 *************** *** 33,36 **** --- 33,38 ---- <exclude name="../Spring.Data.NHibernate/Data/**/HibernateObjectRetrievalFailureException.cs" /> <exclude name="../Spring.Data.NHibernate/Data/**/HibernateOptimisticLockingFailureException.cs" /> + <exclude name="../Spring.Data.NHibernate/Data/**/SessionFactoryUtils.cs" /> + <exclude name="../Spring.Data.NHibernate12/Data/**/HibernateOptimisticLockingFailureException.cs" /> <exclude name="../Spring.Data.NHibernate12/Data/**/LocalSessionFactoryObject.cs" /> <include name="../GenCommonAssemblyInfo.cs" /> Index: Spring.Data.NHibernate20.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data.NHibernate20/Spring.Data.NHibernate20.2005.csproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Spring.Data.NHibernate20.2005.csproj 7 Apr 2008 20:12:53 -0000 1.1 --- Spring.Data.NHibernate20.2005.csproj 23 Apr 2008 11:41:41 -0000 1.2 *************** *** 109,113 **** <Link>Data\NHibernate\IHibernateOperations.cs</Link> </Compile> ! <Compile Include="..\Spring.Data.NHibernate\Data\NHibernate\SessionFactoryUtils.cs"> <Link>Data\NHibernate\SessionFactoryUtils.cs</Link> </Compile> --- 109,113 ---- <Link>Data\NHibernate\IHibernateOperations.cs</Link> </Compile> ! <Compile Include="..\Spring.Data.NHibernate12\Data\NHibernate\SessionFactoryUtils.cs"> <Link>Data\NHibernate\SessionFactoryUtils.cs</Link> </Compile> |
From: Mark P. <mar...@us...> - 2008-04-22 15:09:21
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28254 Modified Files: MasterPage.cs Log Message: SPRNET-558 Index: MasterPage.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/UI/MasterPage.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MasterPage.cs 19 Mar 2008 12:07:15 -0000 1.14 --- MasterPage.cs 22 Apr 2008 15:08:59 -0000 1.15 *************** *** 86,89 **** --- 86,98 ---- childPage.Controls.AddAt(0, this); } + + + /// <summary> + /// Delegate validation errors to the owning page. + /// </summary> + public override IValidationErrors ValidationErrors + { + get { return Page.ValidationErrors; } + } } *************** *** 100,104 **** /// <author>Aleksandar Seovic</author> /// <version>$Id$</version> ! public class MasterPage : System.Web.UI.MasterPage, IApplicationContextAware, ISupportsWebDependencyInjection, IValidationContainer { #region Instance Fields --- 109,113 ---- /// <author>Aleksandar Seovic</author> /// <version>$Id$</version> ! public class MasterPage : System.Web.UI.MasterPage, IApplicationContextAware, ISupportsWebDependencyInjection { #region Instance Fields *************** *** 405,409 **** /// <c>True</c> if all of the specified validators are valid, <c>False</c> otherwise. /// </returns> ! public bool Validate(object validationContext, params IValidator[] validators) { IDictionary contextParams = CreateValidatorParameters(); --- 414,418 ---- /// <c>True</c> if all of the specified validators are valid, <c>False</c> otherwise. /// </returns> ! public virtual bool Validate(object validationContext, params IValidator[] validators) { IDictionary contextParams = CreateValidatorParameters(); |
From: Mark P. <mar...@us...> - 2008-04-21 19:34:42
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv29447 Modified Files: objects.xml Log Message: update method injection docs Index: objects.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/objects.xml,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** objects.xml 3 Apr 2008 02:17:46 -0000 1.122 --- objects.xml 21 Apr 2008 19:34:32 -0000 1.123 *************** *** 112,136 **** Spring Java framework.</para> </note> - </sect3> ! <para>Spring configuration consists of at least one object definition ! that the container must manage, but typically there will be more than ! one object definition. When using XML-based configuration metadata, ! these object are configured as <object/> elements inside a ! top-level <objects/> element.</para> ! <para>These object definitions correspond to the actual objects that ! make up your application. Typically you will have object definitions for ! your service layer objects, your data access objects (DAOs), ! presentation objects such as ASP.NET page instances, infrastructure ! objects such as NHibernate SessionFactories, and so forth. Typically one ! does not configure fine-grained domain objects in the container, because ! it is usually the responsibility of DAOs and business logic to ! create/load domain objects.</para> ! <para>Find below an example of the basic structure of XML-based ! configuration metadata.</para> ! <programlisting><objects xmlns="http://www.springframework.net"> <object id="..." type="..."> --- 112,135 ---- Spring Java framework.</para> </note> ! <para>Spring configuration consists of at least one object definition ! that the container must manage, but typically there will be more than ! one object definition. When using XML-based configuration metadata, ! these object are configured as <object/> elements inside a ! top-level <objects/> element.</para> ! <para>These object definitions correspond to the actual objects that ! make up your application. Typically you will have object definitions ! for your service layer objects, your data access objects (DAOs), ! presentation objects such as ASP.NET page instances, infrastructure ! objects such as NHibernate SessionFactories, and so forth. Typically ! one does not configure fine-grained domain objects in the container, ! because it is usually the responsibility of DAOs and business logic to ! create/load domain objects.</para> ! <para>Find below an example of the basic structure of XML-based ! configuration metadata.</para> ! <programlisting><objects xmlns="http://www.springframework.net"> <object id="..." type="..."> *************** *** 145,155 **** </objects></programlisting> ! <sect3 id="objects-create-container"> ! <title>Instantiating a container</title> ! <para>Instantiating a Spring IoC container is straightforward.</para> ! <programlisting>IApplicationContext context = new XmlApplicationContext( "file://services.xml", "assembly://MyAssembly/MyDataAccess/data-access.xml"); --- 144,156 ---- </objects></programlisting> + </sect3> + </sect2> ! <sect2 id="objects-factory-instantiation"> ! <title>Instantiating a container</title> ! <para>Instantiating a Spring IoC container is straightforward.</para> ! <programlisting>IApplicationContext context = new XmlApplicationContext( "file://services.xml", "assembly://MyAssembly/MyDataAccess/data-access.xml"); *************** *** 158,175 **** IObjectFactory factory = context;</programlisting> ! <para>You can also create an container by using a custom configuration ! section in the standard .NET application (or web) configuration file. ! Once the container has been created you may never need to explicitly ! interact with it again in your code, for example when configuring ! ASP.NET pages.</para> ! </sect3> <para>You may be wondering what the assembly URL is all about. The above ! example uses Spring.NET's <classname> ! <ulink ! url="http://www.springframework.net/doc/api/html/Spring.Core.IO.IResource.html">IResource</ulink> ! </classname> abstraction. The <classname>IResource</classname> ! interface provides a simple and uniform interface to a wide array of IO ! resources that can represent themselves as <classname>System.IO.Stream</classname>. An example for a file based resource, not using the URL syntax but an implementation of the --- 159,174 ---- IObjectFactory factory = context;</programlisting> ! <para>You can also create an container by using a custom configuration ! section in the standard .NET application (or web) configuration file. ! Once the container has been created you may never need to explicitly ! interact with it again in your code, for example when configuring ! ASP.NET pages.</para> <para>You may be wondering what the assembly URL is all about. The above ! example uses Spring.NET's <classname> <ulink ! url="http://www.springframework.net/doc/api/html/Spring.Core.IO.IResource.html">IResource</ulink> ! </classname> abstraction. The <classname>IResource</classname> interface ! provides a simple and uniform interface to a wide array of IO resources ! that can represent themselves as <classname>System.IO.Stream</classname>. An example for a file based resource, not using the URL syntax but an implementation of the *************** *** 188,200 **** referring to a resource that has been embedded inside a .NET assembly, <literal>assembly://<AssemblyName>/<NameSpace>/<ResourceName> ! </literal> <note> To create an embedded resource using Visual Studio you ! must set the Build Action of the .xml configuration file to Embedded ! Resource in the file property editor. Also, you will need to explicitly ! rebuild the project containing the configuration file if it is the only ! change you make between successive builds. If using NAnt to build, add a ! <resources> section to the csc task. For example usage, look at ! the Spring.Core.Tests.build file included the distribution. </note> The ! <classname>IResource</classname> abstraction is explained further in ! <xref linkend="objects-iresource" />.</para> <para>The preferred way to create an --- 187,194 ---- referring to a resource that has been embedded inside a .NET assembly, <literal>assembly://<AssemblyName>/<NameSpace>/<ResourceName> ! </literal> <note> ! To create an embedded resource using Visual Studio you must set the Build Action of the .xml configuration file to Embedded Resource in the file property editor. Also, you will need to explicitly rebuild the project containing the configuration file if it is the only change you make between successive builds. If using NAnt to build, add a <resources> section to the csc task. For example usage, look at the Spring.Core.Tests.build file included the distribution. ! </note> The <classname>IResource</classname> abstraction is explained ! further in <xref linkend="objects-iresource" />.</para> <para>The preferred way to create an *************** *** 307,311 **** section <xref linkend="context-configuration" /></para> ! <sect3> <title>Composing XML-based configuration metadata</title> --- 301,305 ---- section <xref linkend="context-configuration" /></para> ! <sect3 id="objects-factoyr-xml-import"> <title>Composing XML-based configuration metadata</title> *************** *** 327,332 **** Let's look at a sample:</para> ! <para> ! <programlisting><objects xmlns="http://www.springframework.net"> <import resource="services.xml"/> --- 321,325 ---- Let's look at a sample:</para> ! <para><programlisting><objects xmlns="http://www.springframework.net"> <import resource="services.xml"/> *************** *** 337,342 **** <object id="object2" type="..."/> ! </objects></programlisting> ! </para> <para>In this example, external object definitions are being loaded --- 330,334 ---- <object id="object2" type="..."/> ! </objects></programlisting></para> <para>In this example, external object definitions are being loaded *************** *** 868,871 **** --- 860,888 ---- </sect3> </sect2> + + <sect2 id="objects-factory-client"> + <title>Using the container</title> + + <para>An <classname>IApplicationContext</classname> is essentially + nothing more than the interface for an advanced factory capable of + maintaining a registry of different objects and their dependencies. The + <classname>IApplicationContext</classname> enables you to read object + definitions and access them. You create one and read in some object + definition in the XML format as follows:</para> + + <programlisting>IApplicationContext context = new XmlApplicationContext("file://objects.xml"); + </programlisting> + + <para>Basically that is all there is to it. Using + <literal>GetObject(string)</literal> or the indexer + <literal>[string]</literal>, you can retrieve instances of your object; + the client-side view of the <classname>IApplicationContext</classname> + is simple. The <classname>IApplicationContext</classname> interface has + just a few other methods related to finding objects in the contianer, + but ideally your application code should never use them... indeed, your + application code should have no calls to the + <literal>GetObject(string)</literal> method at all, and thus no + dependency on Spring APIs at all.</para> + </sect2> </sect1> *************** *** 2393,2407 **** <para>One solution to this problem is to forego some inversion of ! control. Object A can be aware of the container by implementing the ! <classname>IObjectFactoryAware</classname> interface, and use ! programmatic means to ask the container via a ! <literal>GetObject("B")</literal> call for (a new) object B every time ! it needs it. This is generally not a desirable solution since the object ! code is then aware of and coupled to Spring.NET.</para> ! <para>Method Injection, an advanced feature of supporting ! <classname>IObjectFactoryAware</classname> implementations, allows this ! use case to be handled in a clean fashion, along with some other ! scenarios.</para> <sect3 id="objects-method-injection-lookup"> --- 2410,2457 ---- <para>One solution to this problem is to forego some inversion of ! control. Object A can be <link lang="" ! linkend="objects-factory-aware-objectfactoryaware">made aware of the ! container</link> by implementing the ! <classname>IObjectFactoryAware</classname> interface, and <link ! linkend="objects-factory-client">use programmatic means</link> to ask ! the container via a <literal>GetObject("B")</literal> call for (a ! typically new) object B every time it needs it. Find below an admittedly ! somewhat contrived example of this approach</para> ! <programlisting>using System.Collections; ! using Spring.Objects.Factory; ! ! namespace Fiona.Apple ! { ! public class CommandManager : IObjectFactoryAware ! { ! private IObjectFactory objectFactory; ! ! public object Process(IDictionary commandState) ! { ! // grab a new instance of the appropriate Command ! Command command = CreateCommand(); ! // set the state on the (hopefully brand new) Command instance ! command.State = commandState; ! return command.Execute(); ! } ! ! // the Command returned here could be an implementation that executes asynchronously, or whatever ! protected Command CreateCommand() ! { ! return (Command) objectFactory.GetObject("command"); // notice the Spring API dependency ! } ! ! public IObjectFactory ObjectFactory ! { ! set { objectFactory = value; } ! } ! } ! }</programlisting> ! ! <para>The above example is generally not a desirable solution since the ! business code is then aware of and coupled to the Spring Framework. ! Method Injection, a somewhat advanced feature of the Spring IoC ! container, allows this use case to be handled in a clean fashion.</para> <sect3 id="objects-method-injection-lookup"> *************** *** 2409,2451 **** <para>Lookup method injection refers to the ability of the container ! to override <literal>abstract</literal> or concrete methods on managed ! objects in the container, and to return the result of looking up ! another named object in the container. The lookup will typically be of ! a non-singleton object as per the scenario described above (although ! it can also be a singleton). Spring.NET implements this through a ! dynamically generated subclass overriding the method using the classes ! in the <literal>System.Reflection.Emit</literal> namespace.</para> ! <para>In the client class containing the method to be injected, the ! method definition must observe the following form:</para> ! <programlisting>protected abstract SingleShotHelper CreateSingleShotHelper();</programlisting> ! <para>If the method is not <literal>abstract</literal>, Spring.NET ! will simply override the existing implementation. In the ! <classname>XmlObjectFactory</classname> case, you instruct Spring.NET ! to inject / override this method to return a particular object from ! the container, by using the <literal>lookup-method</literal> element ! inside the object definition. For example:</para> <programlisting><!-- a stateful object deployed as a prototype (non-singleton) --> ! <object id="singleShotHelper" class="..." singleton="false"/> ! <!-- myobject uses singleShotHelper --> ! <object id="myObject" type="..."> ! <lookup-method name="CreateSingleShotHelper" object="singleShotHelper"/> ! <property> ! ... ! </property> </object></programlisting> ! <para>The object identified as <literal>myObject</literal> will call ! its own method <literal>CreateSingleShotHelper</literal> whenever it ! needs a new instance of the <literal>singleShotHelper</literal> ! object. It is important to note that the person deploying the objects ! must be careful to deploy the <literal>singleShotHelper</literal> ! object as a non-singleton (if that is actually what is needed). If it ! is deployed as a singleton (either explicitly, or relying on the ! default <literal>true</literal> setting for this flag), the same instance of <literal>singleShotHelper</literal> will be returned each time!</para> --- 2459,2528 ---- <para>Lookup method injection refers to the ability of the container ! to override <literal>abstract</literal> or concrete methods on ! <emphasis>container managed objects</emphasis>, to return the result ! of looking up another named object in the container. The lookup will ! typically be of a prototype object as in the scenario described above. ! The Spring framework implements this method injection by a dynamically ! generating a subclass overriding the method using the classes in the ! <literal>System.Reflection.Emit</literal> namespace. You can read more ! about the motivation for Method Injection in <ulink ! url="http://blog.springframework.com/rod/?p=1">this blog ! entry</ulink>.</para> ! <para>So if you look at the code from the previous code snipped (the ! <literal>CommandManager</literal> class), the Spring container is ! going to dynamically override the implementation of the ! <literal>CreateCommand()</literal> method. Your ! <classname>CommandManager</classname> class is not going to have any ! Spring dependencies, as can be seen in this reworked example ! below:</para> ! <programlisting>using System.Collections; ! namespace Fiona.Apple ! { ! public abstract class CommandManager ! { ! ! public object Process(IDictionary commandState) ! { ! Command command = CreateCommand(); ! command.State = commandState; ! return command.Execute(); ! } ! ! // okay... but where is the implementation of this method? ! protected abstract Command CreateCommand(); ! } ! }</programlisting> ! ! <para>In the client class containing the method to be injected (the ! CommandManager in this case) the method definition must observe the ! following form:</para> ! ! <programlisting><public|protected> [abstract] <return-type> TheMethodName(no-arguments);</programlisting> ! ! <para>If the method is <literal>abstract</literal>, the ! dynamically-generated subclass will implement the method. Otherwise, ! the dynamically-generated subclass will override the concrete method ! defined in the original class. Let's look at an example:</para> <programlisting><!-- a stateful object deployed as a prototype (non-singleton) --> ! <object id="command" class="Fiona.Apple.AsyncCommand, Fiona" singleton="false"> ! <!-- inject dependencies here as required --> ! </object> ! <!-- commandProcessor uses a statefulCommandHelpder --> ! <object id="commandManager" type="Fiona.Apple.CommandManager, Fiona"> ! <lookup-method name="CreateCommand" object="command"/> </object></programlisting> ! <para>The object identified as <literal>commandManager</literal> will ! call its own method <literal>CreateCommand</literal> whenever it needs ! a new instance of the <literal>command</literal> object. It is ! important to note that the person deploying the objects must be ! careful to deploy the <literal>command</literal> object as prototype ! (if that is actually what is needed). If it is deployed as a <link ! linkend="objects-factory-scopes-singleton">singleton</link> the same instance of <literal>singleShotHelper</literal> will be returned each time!</para> *************** *** 2501,2507 **** }</programlisting> ! <para>The attendant <classname>IObjectFactory</classname> definition ! to deploy the original class and specify the method override would ! look like:</para> <programlisting><object id="myValueCalculator" type="Examples.MyValueCalculator, ExampleAssembly"> --- 2578,2583 ---- }</programlisting> ! <para>The object definition to deploy the original class and specify ! the method override would look like this:</para> <programlisting><object id="myValueCalculator" type="Examples.MyValueCalculator, ExampleAssembly"> *************** *** 2990,2994 **** </table> ! <sect2> <title>The singleton scope</title> --- 3066,3070 ---- </table> ! <sect2 id="objects-factory-scopes-singleton"> <title>The singleton scope</title> *************** *** 3025,3029 **** </sect2> ! <sect2> <title>The prototype scope</title> --- 3101,3105 ---- </sect2> ! <sect2 id="objects-factory-scopes-prototype"> <title>The prototype scope</title> *************** *** 3066,3070 **** </sect2> ! <sect2> <title>Singleton objecgts with prototype-object dependencies</title> --- 3142,3146 ---- </sect2> ! <sect2 id="objects-factory-scopes-sing-prot-interaction"> <title>Singleton objecgts with prototype-object dependencies</title> *************** *** 4180,4184 **** organization / team) have defined an attribute called [Mandatory]. You can make a <classname>RequiredAttributeObjectPostProcessor</classname> ! instance <literal>[Mandatory]</literal>-aware like so: </para> <programlisting><object type="Spring.Objects.Factory.Attributes.RequiredAttributeObjectPostProcessor, Spring.Core"> --- 4256,4260 ---- organization / team) have defined an attribute called [Mandatory]. You can make a <classname>RequiredAttributeObjectPostProcessor</classname> ! instance <literal>[Mandatory]</literal>-aware like so:</para> <programlisting><object type="Spring.Objects.Factory.Attributes.RequiredAttributeObjectPostProcessor, Spring.Core"> *************** *** 4674,4679 **** object from an embedded resource file and use it to set another objects dependency. An example of this is provided <ulink ! url="http://jira.springframework.org/browse/SPRNET-133#action_19743">here</ulink>. ! </para> <para>Finally, there is sometimes a need to ask a container for an --- 4750,4754 ---- object from an embedded resource file and use it to set another objects dependency. An example of this is provided <ulink ! url="http://jira.springframework.org/browse/SPRNET-133#action_19743">here</ulink>.</para> <para>Finally, there is sometimes a need to ask a container for an |
From: Mark P. <mar...@us...> - 2008-04-09 18:40:19
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31519 Modified Files: index.xml transaction.xml Log Message: update programmatic tx docs. Index: index.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/index.xml,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** index.xml 4 Apr 2008 21:42:11 -0000 1.84 --- index.xml 9 Apr 2008 18:40:10 -0000 1.85 *************** *** 54,58 **** <subtitle>Reference Documentation</subtitle> <releaseinfo>Version 1.1.1</releaseinfo> ! <pubdate>Last Updated April 7, 2008</pubdate> <authorgroup> <author> --- 54,58 ---- <subtitle>Reference Documentation</subtitle> <releaseinfo>Version 1.1.1</releaseinfo> ! <pubdate>Last Updated April 9, 2008</pubdate> <authorgroup> <author> Index: transaction.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/transaction.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** transaction.xml 3 Apr 2008 02:36:53 -0000 1.28 --- transaction.xml 9 Apr 2008 18:40:10 -0000 1.29 *************** *** 1711,1715 **** </sect1> ! <sect1 id="ptm"> <title>Programmatic transaction management</title> --- 1711,1715 ---- </sect1> ! <sect1 id="transaction-programmatic"> <title>Programmatic transaction management</title> *************** *** 1734,1739 **** <classname>TransactionTemplate</classname>)</para> ! <sect2> ! <title>Using the TransactionTemplate</title> <para>The TransactionTemplate adopts the same approach as other Spring --- 1734,1739 ---- <classname>TransactionTemplate</classname>)</para> ! <sect2 id="tx-prog-template"> ! <title>Using the <classname>TransactionTemplate</classname></title> <para>The TransactionTemplate adopts the same approach as other Spring *************** *** 1741,1766 **** <classname>HibernateTemplate</classname>. It uses a callback approach, to free application code from having to do the boilerplate acquisition ! and release of resources. Granted that the using construct of ! System.Transaction alleviates much of this. One key difference with the ! approach taken with the TransactionTemplate is that a commit is assumed ! - throwing an exception triggers a rollback instead of using the ! TransactionScope API to commit or rollback.</para> ! ! <para>Like many of the other template classes in Spring, a ! TransactionTemplate instance is threadsafe.</para> <para>Application code that must execute in a transaction context looks ! like this. Note that the <interfacename>ITransactionCallback</interfacename> can be used to return a value:</para> ! <programlisting>TransactionTemplate tt = new TransactionTemplate(TransactionManager); ! string userId = "Stewie"; ! object result = tt.Execute(delegate { ! dao.UpdateOperation(userId); ! return dao.UpdateOperation2(); ! });</programlisting> <para>This code example is specific to .NET 2.0 since it uses anonymous --- 1741,1788 ---- <classname>HibernateTemplate</classname>. It uses a callback approach, to free application code from having to do the boilerplate acquisition ! and release of resources, and results in code that is intention driven, ! in that the code that is written focuses solely on what the developer ! wants to do. Granted that the using construct of System.Transaction ! alleviates much of this. One key difference with the approach taken with ! the TransactionTemplate is that a commit is assumed - throwing an ! exception triggers a rollback instead of using the TransactionScope API ! to commit or rollback. This also allows for the use of rollback rules, ! that is a commit can still occur for exceptions of certain types. <note> ! <para>As you will immediately see in the examples that follow, using ! the <literal>TransactionTemplate</literal> absolutely couples you to ! Spring's transaction infrastructure and APIs. Whether or not ! programmatic transaction management is suitable for your development ! needs is a decision that you will have to make yourself.</para> ! </note></para> <para>Application code that must execute in a transaction context looks ! like this. You, as an application developer, will write a ! ITransactionCallback implementation (typically expressed as an anonymous ! delegate) that will contain all of the code that you need to have ! execute in the context of a transaction. You will then pass an instance ! of your custom ITransactionCallback to the Execute(..) method exposed on ! the TransactionTemplate. Note that the <interfacename>ITransactionCallback</interfacename> can be used to return a value:</para> ! <programlisting>public class SimpleService : IService ! { ! private TransactionTemplate transactionTemplate; ! public SimpleService(IPlatformTransactionManager transactionManager) ! { ! AssertUtils.ArgumentNotNull(transactionManager, "transactionManager"); ! transactionTemplate = new TransactionTemplate(transactionManager); ! } ! public object SomeServiceMethod() ! { ! return tt.Execute(delegate { ! UpdateOperation(userId); ! return ResultOfUpdateOperation2(); ! }); ! } ! } ! </programlisting> <para>This code example is specific to .NET 2.0 since it uses anonymous *************** *** 1777,1783 **** <programlisting>tt.Execute(delegate(ITransactionStatus status) { ! adoTemplate.ExecuteNonQuery(CommandType.Text, "insert into dbo.Debits (DebitAmount) VALUES (@amount)", "amount", DbType.Decimal, 0,555); ! // decide you need to rollback... ! status.RollbackOnly = true; return null; });</programlisting> --- 1799,1808 ---- <programlisting>tt.Execute(delegate(ITransactionStatus status) { ! try { ! UpdateOperation1(); ! UpdateOperation2(); ! } catch (SomeBusinessException ex) { ! status.RollbackOnly = true; ! } return null; });</programlisting> *************** *** 1815,1821 **** to unit test such classes with a mock or stub <interfacename>IPlatformTransactionManager</interfacename>.</para> </sect2> ! <sect2> <title>Using the PlatformTransactionManager</title> --- 1840,1905 ---- to unit test such classes with a mock or stub <interfacename>IPlatformTransactionManager</interfacename>.</para> + + <sect3> + <title>Specifying transaction settings</title> + + <para>Transaction settings such as the propagation mode, the isolation + level, the timeout, and so forth can be set on the + <classname>TransactionTemplate</classname> either programmatically or + in configuration. <classname>TransactionTemplate</classname> instances + by default have the default transactional settings. Find below an + example of programmatically customizing the transactional settings for + a specific <classname>TransactionTemplate</classname>.</para> + + <programlisting>public class SimpleService : IService + { + private TransactionTemplate transactionTemplate; + + public SimpleService(IPlatformTransactionManager transactionManager) + { + AssertUtils.ArgumentNotNull(transactionManager, "transactionManager"); + transactionTemplate = new TransactionTemplate(transactionManager); + + // the transaction settings can be set here explicitly if so desired + + transactionTemplate.TransactionIsolationLevel = IsolationLevel.ReadUncommitted; + transactionTemplate.TransactionTimeout = 30; + + // and so forth... + } + + . . . + + } + + </programlisting> + + <para>Find below an example of defining a + <classname>TransactionTemplate</classname> with some custom + transactional settings, using Spring XML configuration. The + '<literal>sharedTransactionTemplate</literal>' can then be injected + into as many services as are required.</para> + + <programlisting><object id="sharedTransactionTemplate" + type="Spring.Transaction.Support.TransactionTemplate, Sprng.Data"> + <property name="TransactionIsolationLevel" value="IsolationLevel.ReadUncommitted"/> + <property name="TransactionTimeout" value="30"/> + </object></programlisting> + + <para>Finally, instances of the + <classname>TransactionTemplate</classname> class are threadsafe, in + that instances do not maintain any conversational state. + <classname>TransactionTemplate</classname> instances do however + maintain configuration state, so while a number of classes may choose + to share a single instance of a + <classname>TransactionTemplate</classname>, if a class needed to use a + <classname>TransactionTemplate</classname> with different settings + (for example, a different isolation level), then two distinct + <classname>TransactionTemplate</classname> instances would need to be + created and used.</para> + </sect3> </sect2> ! <sect2 id="transaction-programmatic-ptm"> <title>Using the PlatformTransactionManager</title> |