springnet-commits Mailing List for Spring Framework .NET (Page 37)
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...> - 2007-10-10 18:07:43
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6762 Modified Files: ITargetSource.cs Removed Files: ITargetTypeAware.cs Log Message: make exception handling of expressions in exception advice more robuts remove ITargetTypeAware - requires more changes to internal AOP infrastructure - not worth the effort for this convenience removed files that were moved to another namespace (AbstractExceptionHander/IExceptionHandler) --- ITargetTypeAware.cs DELETED --- Index: ITargetSource.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/ITargetSource.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ITargetSource.cs 8 Oct 2007 22:04:51 -0000 1.8 --- ITargetSource.cs 10 Oct 2007 18:07:38 -0000 1.9 *************** *** 48,53 **** /// <author>Aleksandar Seovic (.NET)</author> /// <version>$Id$</version> ! public interface ITargetSource : ITargetTypeAware { /// <summary> --- 48,57 ---- /// <author>Aleksandar Seovic (.NET)</author> /// <version>$Id$</version> ! public interface ITargetSource { + /// <summary> + /// The <see cref="System.Type"/> of the target object. + /// </summary> + Type TargetType { get; } /// <summary> |
From: Mark P. <mar...@us...> - 2007-10-10 18:07:42
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6762/Framework Modified Files: AopUtils.cs IAdvised.cs Log Message: make exception handling of expressions in exception advice more robuts remove ITargetTypeAware - requires more changes to internal AOP infrastructure - not worth the effort for this convenience removed files that were moved to another namespace (AbstractExceptionHander/IExceptionHandler) Index: IAdvised.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework/IAdvised.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** IAdvised.cs 8 Oct 2007 22:04:50 -0000 1.14 --- IAdvised.cs 10 Oct 2007 18:07:38 -0000 1.15 *************** *** 51,55 **** /// <seealso cref="Spring.Aop.Framework.AdvisedSupport"/> [ProxyIgnore] ! public interface IAdvised : ITargetTypeAware { /// <summary> --- 51,55 ---- /// <seealso cref="Spring.Aop.Framework.AdvisedSupport"/> [ProxyIgnore] ! public interface IAdvised { /// <summary> Index: AopUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework/AopUtils.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AopUtils.cs 8 Oct 2007 22:04:50 -0000 1.3 --- AopUtils.cs 10 Oct 2007 18:07:38 -0000 1.4 *************** *** 255,261 **** { AssertUtils.ArgumentNotNull(candidate,"candidate", "Candidate object must not be null"); ! if (candidate is ITargetTypeAware) { ! return ((ITargetTypeAware) candidate).TargetType; } if (IsDecoratorAopProxy(candidate)) --- 255,265 ---- { AssertUtils.ArgumentNotNull(candidate,"candidate", "Candidate object must not be null"); ! if (candidate is ITargetSource) { ! return ((ITargetSource) candidate).TargetType; ! } ! if (candidate is IAdvised) ! { ! return ((IAdvised) candidate).TargetSource.TargetType; } if (IsDecoratorAopProxy(candidate)) |
From: Mark P. <mar...@us...> - 2007-10-10 17:12:26
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Logging In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15695/Logging Modified Files: SimpleLoggingAdvice.cs Log Message: simple fixes to compile on .net 1.0 Index: SimpleLoggingAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Logging/SimpleLoggingAdvice.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleLoggingAdvice.cs 10 Oct 2007 07:42:10 -0000 1.2 --- SimpleLoggingAdvice.cs 10 Oct 2007 17:10:50 -0000 1.3 *************** *** 329,333 **** if (s.EndsWith(seperator)) { ! return s.Remove(s.Length - seperator.Length); } else --- 329,333 ---- if (s.EndsWith(seperator)) { ! return s.Substring(0,s.Length - seperator.Length); } else |
From: Mark P. <mar...@us...> - 2007-10-10 17:12:25
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15695 Modified Files: RetryAdvice.cs Log Message: simple fixes to compile on .net 1.0 Index: RetryAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/RetryAdvice.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RetryAdvice.cs 10 Oct 2007 07:38:17 -0000 1.2 --- RetryAdvice.cs 10 Oct 2007 17:10:51 -0000 1.3 *************** *** 191,195 **** object result = expression.GetValue(null, callContextDictionary); decimal d = decimal.Parse(result.ToString()); ! decimal rounded = decimal.Round(d*1000); int sleepInSeconds = decimal.ToInt32(rounded); Thread.Sleep(sleepInSeconds); --- 191,195 ---- object result = expression.GetValue(null, callContextDictionary); decimal d = decimal.Parse(result.ToString()); ! decimal rounded = decimal.Round(d*1000,0); int sleepInSeconds = decimal.ToInt32(rounded); Thread.Sleep(sleepInSeconds); |
From: Mark P. <mar...@us...> - 2007-10-10 16:57:44
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10298 Modified Files: ParameterUtils.cs Log Message: SPRNET-746 - StoredProcedure class doesn't return sproc return value in result dictionary Index: ParameterUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Support/ParameterUtils.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ParameterUtils.cs 25 Jul 2007 08:25:20 -0000 1.10 --- ParameterUtils.cs 10 Oct 2007 16:57:41 -0000 1.11 *************** *** 136,139 **** --- 136,143 ---- } } + if (dbDataParameter.Direction == ParameterDirection.ReturnValue) + { + returnedParameters.Add("RETURN", dbDataParameter.Value); + } count++; } |
From: Bruno B. <bb...@us...> - 2007-10-10 16:31:55
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32069 Modified Files: PropertyOverrideConfigurerTests.cs Log Message: Improved PropertyOverrideConfigurer to support 'expression' value override [SPRNET-745] Index: PropertyOverrideConfigurerTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyOverrideConfigurerTests.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PropertyOverrideConfigurerTests.cs 10 Oct 2007 16:07:20 -0000 1.8 --- PropertyOverrideConfigurerTests.cs 10 Oct 2007 16:31:50 -0000 1.9 *************** *** 116,119 **** --- 116,137 ---- } + [Test] + public void OverridePropertyExpression() + { + StaticApplicationContext ac = new StaticApplicationContext(); + + MutablePropertyValues pvs = new MutablePropertyValues(); + pvs.Add("Age", new ExpressionHolder("26+1")); + ac.RegisterSingleton("tb1", typeof(TestObject), pvs); + + pvs = new MutablePropertyValues(); + pvs.Add("Properties", "<spring-config><add key=\"tb1.Age\" value=\"26-1\"/></spring-config>"); + ac.RegisterSingleton("configurer", typeof(PropertyOverrideConfigurer), pvs); + + ac.Refresh(); + TestObject tb1 = (TestObject)ac.GetObject("tb1"); + Assert.AreEqual(25, tb1.Age); + } + [Test] public void MalformedOverrideKey() |
From: Bruno B. <bb...@us...> - 2007-10-10 16:31:45
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32031 Modified Files: PropertyOverrideConfigurer.cs Log Message: Improved PropertyOverrideConfigurer to support 'expression' value override [SPRNET-745] Index: PropertyOverrideConfigurer.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config/PropertyOverrideConfigurer.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PropertyOverrideConfigurer.cs 10 Oct 2007 16:07:02 -0000 1.10 --- PropertyOverrideConfigurer.cs 10 Oct 2007 16:31:39 -0000 1.11 *************** *** 168,171 **** --- 168,175 ---- definition.PropertyValues.Add(objectProperty, new RuntimeObjectReference(value)); } + else if (pv != null && pv.Value is ExpressionHolder) + { + definition.PropertyValues.Add(objectProperty, new ExpressionHolder(value)); + } else { |
From: Bruno B. <bb...@us...> - 2007-10-10 16:07:24
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22662 Modified Files: PropertyOverrideConfigurerTests.cs Log Message: Improved PropertyOverrideConfigurer to support 'ref' value override [SPRNET-745] Index: PropertyOverrideConfigurerTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Objects/Factory/Config/PropertyOverrideConfigurerTests.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PropertyOverrideConfigurerTests.cs 8 Aug 2007 17:49:04 -0000 1.7 --- PropertyOverrideConfigurerTests.cs 10 Oct 2007 16:07:20 -0000 1.8 *************** *** 52,77 **** } [Test] ! public void SunnyDay() { StaticApplicationContext ac = new StaticApplicationContext(); ! ac.RegisterSingleton("tb1", typeof (TestObject), new MutablePropertyValues()); ! ac.RegisterSingleton("tb2", typeof (TestObject), new MutablePropertyValues()); ! MutablePropertyValues pvs = new MutablePropertyValues(); ! pvs.Add("Properties", "<spring-config><add key=\"tb1.Age\" value=\"99\"/><add key=\"tb2.Name\" value=\"test\"/></spring-config>"); ! ac.RegisterSingleton("configurer1", typeof (PropertyOverrideConfigurer), pvs); ! pvs = new MutablePropertyValues(); ! pvs.Add("Properties", "<spring-config><add key=\"tb2.Age\" value=\"99\"/><add key=\"tb2.Name\" value=\"test\"/></spring-config>"); ! pvs.Add("order", "0"); ! ac.RegisterSingleton("configurer2", typeof (PropertyOverrideConfigurer), pvs); ac.Refresh(); TestObject tb1 = (TestObject) ac.GetObject("tb1"); - TestObject tb2 = (TestObject) ac.GetObject("tb2"); Assert.AreEqual(99, tb1.Age); ! Assert.AreEqual(99, tb2.Age); ! Assert.AreEqual(null, tb1.Name); ! Assert.AreEqual("test", tb2.Name); } [Test] public void MalformedOverrideKey() --- 52,119 ---- } + [Test] + public void AddPropertyValue() + { + StaticApplicationContext ac = new StaticApplicationContext(); + ac.RegisterSingleton("tb1", typeof(TestObject), new MutablePropertyValues()); + ac.RegisterSingleton("tb2", typeof(TestObject), new MutablePropertyValues()); + MutablePropertyValues pvs = new MutablePropertyValues(); + pvs.Add("Properties", "<spring-config><add key=\"tb1.Age\" value=\"99\"/><add key=\"tb2.Name\" value=\"test\"/></spring-config>"); + ac.RegisterSingleton("configurer1", typeof(PropertyOverrideConfigurer), pvs); + pvs = new MutablePropertyValues(); + pvs.Add("Properties", "<spring-config><add key=\"tb2.Age\" value=\"99\"/><add key=\"tb2.Name\" value=\"test\"/></spring-config>"); + pvs.Add("order", "0"); + ac.RegisterSingleton("configurer2", typeof(PropertyOverrideConfigurer), pvs); + ac.Refresh(); + TestObject tb1 = (TestObject)ac.GetObject("tb1"); + TestObject tb2 = (TestObject)ac.GetObject("tb2"); + Assert.AreEqual(99, tb1.Age); + Assert.AreEqual(99, tb2.Age); + Assert.AreEqual(null, tb1.Name); + Assert.AreEqual("test", tb2.Name); + } + [Test] ! public void OverridePropertyValue() { StaticApplicationContext ac = new StaticApplicationContext(); ! ! MutablePropertyValues pvs = new MutablePropertyValues(); ! pvs.Add("Age", 27); ! pvs.Add("Name", "Bruno"); ! ac.RegisterSingleton("tb1", typeof(TestObject), pvs); ! ! pvs = new MutablePropertyValues(); ! pvs.Add("Properties", "<spring-config><add key=\"tb1.Age\" value=\"99\"/><add key=\"tb1.Name\" value=\"test\"/></spring-config>"); ! ac.RegisterSingleton("configurer", typeof (PropertyOverrideConfigurer), pvs); ! ac.Refresh(); TestObject tb1 = (TestObject) ac.GetObject("tb1"); Assert.AreEqual(99, tb1.Age); ! Assert.AreEqual("test", tb1.Name); } + [Test] + public void OverridePropertyReference() + { + StaticApplicationContext ac = new StaticApplicationContext(); + + MutablePropertyValues pvs = new MutablePropertyValues(); + pvs.Add("Spouse", new RuntimeObjectReference("spouse1")); + ac.RegisterSingleton("tb1", typeof(TestObject), pvs); + + ac.RegisterSingleton("spouse1", typeof(TestObject), new MutablePropertyValues()); + ac.RegisterSingleton("spouse2", typeof(TestObject), new MutablePropertyValues()); + + pvs = new MutablePropertyValues(); + pvs.Add("Properties", "<spring-config><add key=\"tb1.Spouse\" value=\"spouse2\"/></spring-config>"); + ac.RegisterSingleton("configurer", typeof(PropertyOverrideConfigurer), pvs); + + ac.Refresh(); + TestObject tb1 = (TestObject)ac.GetObject("tb1"); + TestObject spouse2 = (TestObject)ac.GetObject("spouse2"); + Assert.AreEqual(spouse2, tb1.Spouse); + } + [Test] public void MalformedOverrideKey() |
From: Bruno B. <bb...@us...> - 2007-10-10 16:07:07
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv22284 Modified Files: PropertyOverrideConfigurer.cs Log Message: Improved PropertyOverrideConfigurer to support 'ref' value override [SPRNET-745] Index: PropertyOverrideConfigurer.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Config/PropertyOverrideConfigurer.cs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PropertyOverrideConfigurer.cs 16 Mar 2007 04:01:39 -0000 1.9 --- PropertyOverrideConfigurer.cs 10 Oct 2007 16:07:02 -0000 1.10 *************** *** 163,167 **** if(definition != null) { ! definition.PropertyValues.Add(objectProperty, value); } else --- 163,175 ---- if(definition != null) { ! PropertyValue pv = definition.PropertyValues.GetPropertyValue(objectProperty); ! if (pv != null && pv.Value is RuntimeObjectReference) ! { ! definition.PropertyValues.Add(objectProperty, new RuntimeObjectReference(value)); ! } ! else ! { ! definition.PropertyValues.Add(objectProperty, value); ! } } else |
From: Mark P. <mar...@us...> - 2007-10-10 07:42:13
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Logging In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8461 Modified Files: SimpleLoggingAdvice.cs Log Message: fix spelling error... Index: SimpleLoggingAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Logging/SimpleLoggingAdvice.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleLoggingAdvice.cs 8 Oct 2007 22:05:16 -0000 1.1 --- SimpleLoggingAdvice.cs 10 Oct 2007 07:42:10 -0000 1.2 *************** *** 55,61 **** /// <summary> ! /// The seperator string to use for delmiting log message fields. /// </summary> ! private string seperator = ", "; /// <summary> --- 55,61 ---- /// <summary> ! /// The separator string to use for delmiting log message fields. /// </summary> ! private string separator = ", "; /// <summary> *************** *** 123,130 **** /// </summary> /// <value>The seperator.</value> ! public string Seperator { ! get { return seperator; } ! set { seperator = value; } } --- 123,130 ---- /// </summary> /// <value>The seperator.</value> ! public string Separator { ! get { return separator; } ! set { separator = value; } } *************** *** 229,236 **** if (logMethodArguments) { ! sb.Append(GetMethodArgumentAsString(invocation)).Append(Seperator); } ! return RemoveLastSeparator(sb, Seperator); } --- 229,236 ---- if (logMethodArguments) { ! sb.Append(GetMethodArgumentAsString(invocation)).Append(Separator); } ! return RemoveLastSeparator(sb, Separator); } *************** *** 275,279 **** if (LogExecutionTime) { ! sb.Append(executionTimeSpan.TotalMilliseconds).Append(" ms").Append(Seperator); } sb.Append("return=").Append(returnValue); --- 275,279 ---- if (LogExecutionTime) { ! sb.Append(executionTimeSpan.TotalMilliseconds).Append(" ms").Append(Separator); } sb.Append("return=").Append(returnValue); *************** *** 294,300 **** if (LogUniqueIdentifier) { ! sb.Append(Seperator).Append(idString); } ! sb.Append(Seperator); } --- 294,300 ---- if (LogUniqueIdentifier) { ! sb.Append(Separator).Append(idString); } ! sb.Append(Separator); } |
From: Mark P. <mar...@us...> - 2007-10-10 07:38:28
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6840 Modified Files: RetryAdviceTests.cs Log Message: Add retry advice Index: RetryAdviceTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/RetryAdviceTests.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RetryAdviceTests.cs 8 Oct 2007 22:05:27 -0000 1.1 --- RetryAdviceTests.cs 10 Oct 2007 07:38:25 -0000 1.2 *************** *** 30,34 **** { /// <summary> ! /// This calss contains tests for /// </summary> /// <author>Mark Pollack</author> --- 30,34 ---- { /// <summary> ! /// This class contains tests for RetryAdvice /// </summary> /// <author>Mark Pollack</author> *************** *** 43,55 **** [Test] ! public void Test() { ! ITestRemoteService rs = new TestRemoteService(); ! ProxyFactory factory = new ProxyFactory(rs); ! } ! } --- 43,106 ---- [Test] ! public void TestSunnyDay() { ! InvokeOncePassOnceFail(false, false); ! InvokeOncePassOnceFail(false, true); ! InvokeOncePassOnceFail(true, false); ! InvokeOncePassOnceFail(true, true); } ! private static void InvokeOncePassOnceFail(bool useExceptionName, bool isDelay) ! { ! ITestRemoteService rs = GetRemoteService(2, useExceptionName, isDelay); ! ! rs.DoTransfer(); ! ! rs = GetRemoteService(3, useExceptionName, isDelay); ! try ! { ! rs.DoTransfer(); ! Assert.Fail("Should have failed."); ! } catch (ArithmeticException) ! { ! ! } ! } ! ! private static ITestRemoteService GetRemoteService(int numFailures, bool usingExceptionName, bool isDelay) ! { ! TestRemoteService remoteService = new TestRemoteService(); ! remoteService.NumFailures = numFailures; ! ProxyFactory factory = new ProxyFactory(remoteService); ! RetryAdvice retryAdvice = new RetryAdvice(); ! if (usingExceptionName) ! { ! if (isDelay) ! { ! retryAdvice.RetryExpression = "on exception name ArithmeticException retry 3x delay 1s"; ! } ! else ! { ! retryAdvice.RetryExpression = "on exception name ArithmeticException retry 3x rate (1*#n + 0.5)"; ! } ! } ! else ! { ! if (isDelay) ! { ! retryAdvice.RetryExpression = "on exception (#e is T(System.ArithmeticException)) retry 3x delay 1s"; ! } ! else ! { ! retryAdvice.RetryExpression = "on exception (#e is T(System.ArithmeticException)) retry 3x rate (1*#n + 0.5)"; ! } ! } ! retryAdvice.AfterPropertiesSet(); ! factory.AddAdvice(retryAdvice); ! ITestRemoteService rs = factory.GetProxy() as ITestRemoteService; ! Assert.IsNotNull(rs); ! return rs; ! } } *************** *** 62,66 **** { private int numFailures; ! private static int count = 0; private bool throwException = false; --- 113,117 ---- { private int numFailures; ! private int count = 0; private bool throwException = false; *************** *** 93,97 **** if (ThrowException) { ! throw new ArgumentException("sample exception"); } } --- 144,148 ---- if (ThrowException) { ! throw new ArithmeticException("can't do the math"); } } |
From: Mark P. <mar...@us...> - 2007-10-10 07:38:21
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6806/Aspects Modified Files: RetryAdvice.cs Added Files: RetryExceptionHandler.cs Log Message: Add retry advice Index: RetryAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/RetryAdvice.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RetryAdvice.cs 8 Oct 2007 22:05:16 -0000 1.1 --- RetryAdvice.cs 10 Oct 2007 07:38:17 -0000 1.2 *************** *** 22,33 **** using System.Collections; using System.Text.RegularExpressions; using AopAlliance.Intercept; using Common.Logging; ! using Spring.Objects.Factory; namespace Spring.Aspects { /// <summary> ! /// AOP Advice to retry a method invocation on an exception /// </summary> /// <remarks> --- 22,37 ---- using System.Collections; using System.Text.RegularExpressions; + using System.Threading; using AopAlliance.Intercept; using Common.Logging; ! using Spring.Core.TypeConversion; ! using Spring.Expressions; namespace Spring.Aspects { /// <summary> ! /// AOP Advice to retry a method invocation on an exception. The retry semantics are defined by a DSL of the ! /// form <code>on exception name [ExceptionName1,ExceptionName2,...] retry [number of times] [delay|rate] [delay time|rate expression]</code>. ! /// For example, <code>on exception name ArithmeticException retry 3x delay 1s</code> /// </summary> /// <remarks> *************** *** 36,40 **** /// <author>Mark Pollack</author> /// <version>$Id$</version> ! public class RetryAdvice : IMethodInterceptor, IInitializingObject { #region Fields --- 40,44 ---- /// <author>Mark Pollack</author> /// <version>$Id$</version> ! public class RetryAdvice : AbstractExceptionHandlerAdvice { #region Fields *************** *** 42,51 **** private static readonly ILog log = LogManager.GetLogger(typeof (RetryAdvice)); ! private IExceptionHandler exceptionHandler; ! private string retryExpression; ! private int maxRetries; #endregion --- 46,64 ---- private static readonly ILog log = LogManager.GetLogger(typeof (RetryAdvice)); ! private TimeSpanConverter timeSpanConverter = new TimeSpanConverter(); ! private RetryExceptionHandler retryExceptionHandler; ! private string retryExpression; ! ! private string onExceptionNameRegex = @"^(on\s+exception\s+name)\s+(.*?)\s+(retry)\s*(.*?)$"; ! ! private string onExceptionRegex = @"^(on\s+exception\s+)(\(.*?\))\s+(retry)\s*(.*?)$"; ! ! //retry 3x delay 10s ! private string delayRegex = @"^(\d+)x\s+(delay)\s+(\d+\w+)?$"; + //retry 3x rate 10n+5 + private string rateRegex = @"^(\d+)x\s+(rate)\s+(\(.*?\))?$"; #endregion *************** *** 53,74 **** /// <summary> ! /// Gets or sets the max retries. /// </summary> ! /// <value>The max retries.</value> ! public int MaxRetries { ! get { return maxRetries; } ! set { maxRetries = value; } } /// <summary> ! /// Gets or sets the retry expression. /// </summary> ! /// <value>The retry expression.</value> ! public string RetryExpression { ! get { return retryExpression; } ! set { retryExpression = value; } } --- 66,96 ---- /// <summary> ! /// Gets or sets the retry expression. /// </summary> ! /// <value>The retry expression.</value> ! public string RetryExpression { ! get { return retryExpression; } ! set { retryExpression = value; } } + /// <summary> + /// Gets or sets the Regex string used to parse advice expressions starting with 'on exception name' and exception handling actions. + /// </summary> + /// <value>The regex string to parse advice expressions starting with 'on exception name' and exception handling actions.</value> + public override string OnExceptionNameRegex + { + get { return onExceptionNameRegex; } + set { onExceptionNameRegex = value; } + } /// <summary> ! /// Gets or sets the Regex string used to parse advice expressions starting with 'on exception (constraint)' and exception handling actions. /// </summary> ! /// <value>The regex string to parse advice expressions starting with 'on exception (constraint)' and exception handling actions.</value> ! public override string OnExceptionRegex { ! get { return onExceptionRegex; } ! set { onExceptionRegex = value; } } *************** *** 98,102 **** /// throws an exception. /// </exception> ! public object Invoke(IMethodInvocation invocation) { IDictionary callContextDictionary = new Hashtable(); --- 120,124 ---- /// throws an exception. /// </exception> ! public override object Invoke(IMethodInvocation invocation) { IDictionary callContextDictionary = new Hashtable(); *************** *** 134,142 **** catch (Exception ex) { ! callContextDictionary.Add("e", ex); ! if (exceptionHandler.CanHandleException(ex, callContextDictionary)) { numAttempts++; ! if (numAttempts == MaxRetries) { throw; --- 156,164 ---- catch (Exception ex) { ! callContextDictionary["e"] = ex; ! if (retryExceptionHandler.CanHandleException(ex, callContextDictionary)) { numAttempts++; ! if (numAttempts == retryExceptionHandler.MaximumRetryCount) { throw; *************** *** 144,158 **** else { ! //Sleep() } } } ! } while (numAttempts <= MaxRetries); ! log.Info("Invoked successfully after " + numAttempts + " attempt(s)"); return returnVal; } #endregion --- 166,211 ---- else { ! callContextDictionary["n"] = numAttempts; ! Sleep(retryExceptionHandler, callContextDictionary); } } } ! } while (numAttempts <= retryExceptionHandler.MaximumRetryCount); ! log.Debug("Invoked successfully after " + numAttempts + " attempt(s)"); return returnVal; } + private void Sleep(RetryExceptionHandler handler, IDictionary callContextDictionary) + { + if (handler.IsDelayBased) + { + Thread.Sleep(handler.DelayTimeSpan); + } + else + { + try + { + IExpression expression = Expression.Parse(handler.DelayRateExpression); + object result = expression.GetValue(null, callContextDictionary); + decimal d = decimal.Parse(result.ToString()); + decimal rounded = decimal.Round(d*1000); + int sleepInSeconds = decimal.ToInt32(rounded); + Thread.Sleep(sleepInSeconds); + } + catch (InvalidCastException e) + { + log.Warn("Was not able to cast expression to decimal [" + handler.DelayRateExpression + "]. Sleeping for 1 second", e); + Thread.Sleep(1000); + } + catch (Exception e) + { + log.Warn("Was not able to evaluate rate expression [" + handler.DelayRateExpression + "]. Sleeping for 1 second", e); + Thread.Sleep(1000); + } + } + } + #endregion *************** *** 185,200 **** /// required property) or if initialization fails. /// </exception> ! public void AfterPropertiesSet() { ! if (exceptionHandler == null) { throw new ArgumentException("Must specify retry expression."); } ! IExceptionHandler handler = Parse(retryExpression); if (handler == null) { ! throw new ArgumentException("Was not able to parse exception handler string [" + retryExpression + "]"); } ! exceptionHandler = handler; } --- 238,253 ---- /// required property) or if initialization fails. /// </exception> ! public override void AfterPropertiesSet() { ! if (retryExpression == null) { throw new ArgumentException("Must specify retry expression."); } ! RetryExceptionHandler handler = Parse(retryExpression); if (handler == null) { ! throw new ArgumentException("Was not able to parse retry expression string [" + retryExpression + "]"); } ! retryExceptionHandler = handler; } *************** *** 204,215 **** /// Parses the specified handler string. /// </summary> ! /// <param name="handlerString">The handler string.</param> /// <returns></returns> ! protected virtual IExceptionHandler Parse(string handlerString) { ! return null; } } } \ No newline at end of file --- 257,326 ---- /// Parses the specified handler string. /// </summary> ! /// <param name="retryExpressionString">The handler string.</param> /// <returns></returns> ! protected virtual RetryExceptionHandler Parse(string retryExpressionString) { ! ParsedAdviceExpression parsedAdviceExpression = ParseAdviceExpression(retryExpressionString); ! ! if (!parsedAdviceExpression.Success) ! { ! log.Warn("Could not parse retry expression " + retryExpressionString); ! return null; ! } ! ! RetryExceptionHandler handler = new RetryExceptionHandler(parsedAdviceExpression.ExceptionNames); ! handler.ConstraintExpressionText = parsedAdviceExpression.ConstraintExpression; ! handler.ActionExpressionText = parsedAdviceExpression.AdviceExpression; ! ! Match match = GetMatchForActionExpression(parsedAdviceExpression.ActionExpressionText, delayRegex); ! ! if (match.Success) ! { ! handler.MaximumRetryCount = int.Parse(match.Groups[1].Value.Trim()); ! handler.IsDelayBased = true; ! ! try ! { ! string ts = match.Groups[3].Value.Trim(); ! handler.DelayTimeSpan = (TimeSpan) timeSpanConverter.ConvertFrom(null, null, ts); ! } catch (Exception) ! { ! log.Warn("Could not parse timespan " + match.Groups[3].Value.Trim()); ! return null; ! } ! return handler; ! } ! else ! { ! match = GetMatchForActionExpression(parsedAdviceExpression.ActionExpressionText, rateRegex); ! if (match.Success) ! { ! handler.MaximumRetryCount = int.Parse(match.Groups[1].Value.Trim()); ! handler.IsDelayBased = false; ! handler.DelayRateExpression = match.Groups[3].Value.Trim(); ! return handler; ! } ! else ! { ! return null; ! } ! } } + + /// <summary> + /// Gets the match for action expression. + /// </summary> + /// <param name="actionExpressionString">The action expression string.</param> + /// <param name="regexString">The regex string.</param> + /// <returns>The Match object resulting from the regular expression match.</returns> + protected virtual Match GetMatchForActionExpression(string actionExpressionString, string regexString) + { + RegexOptions options = ((RegexOptions.IgnorePatternWhitespace | RegexOptions.Multiline) | RegexOptions.IgnoreCase); + Regex reg = new Regex(regexString, options); + return reg.Match(actionExpressionString); + } + } } \ No newline at end of file --- NEW FILE: RetryExceptionHandler.cs --- #region License /* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #endregion using System; using System.Collections; namespace Spring.Aspects { /// <summary> /// Sleeps for the appropriate amount of time for an exception. /// </summary> /// <remarks> /// /// </remarks> /// <author>Mark Pollack</author> /// <version>$Id: RetryExceptionHandler.cs,v 1.1 2007/10/10 07:38:17 markpollack Exp $</version> public class RetryExceptionHandler : AbstractExceptionHandler { #region Fields private int maximumRetryCount; private bool isDelayBased; private TimeSpan delayTimeSpan; private string delayRateExpression; #endregion #region Constructor /// <summary> /// Initializes a new instance of the <see cref="RetryExceptionHandler"/> class. /// </summary> public RetryExceptionHandler() { } /// <summary> /// Initializes a new instance of the <see cref="RetryExceptionHandler"/> class. /// </summary> /// <param name="exceptionNames">The exception names.</param> public RetryExceptionHandler(string[] exceptionNames) : base(exceptionNames) { } #endregion #region Properties /// <summary> /// Gets the maximum retry count. /// </summary> /// <value>The maximum retry count.</value> public int MaximumRetryCount { get { return maximumRetryCount; } set { maximumRetryCount = value; } } /// <summary> /// Gets a value indicating whether this instance is delay based. /// </summary> /// <value> /// <c>true</c> if this instance is delay based; otherwise, <c>false</c>. /// </value> public bool IsDelayBased { get { return isDelayBased; } set { isDelayBased = value; } } /// <summary> /// Gets or sets the delay time span to sleep after an exception is thrown and a rety is /// attempted. /// </summary> /// <value>The delay time span.</value> public TimeSpan DelayTimeSpan { get { return delayTimeSpan; } set { delayTimeSpan = value; } } /// <summary> /// Gets or sets the delay rate expression. /// </summary> /// <value>The delay rate expression.</value> public string DelayRateExpression { get { return delayRateExpression; } set { delayRateExpression = value; } } #endregion #region Methods /// <summary> /// Handles the exception. /// </summary> /// <param name="callContextDictionary"></param> /// <returns> /// The return value from handling the exception, if not rethrown or a new exception is thrown. /// </returns> public override object HandleException(IDictionary callContextDictionary) { return null; } #endregion } } |
From: Mark P. <mar...@us...> - 2007-10-10 07:38:21
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6806 Modified Files: Spring.Aop.2005.csproj Log Message: Add retry advice Index: Spring.Aop.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Spring.Aop.2005.csproj,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** Spring.Aop.2005.csproj 8 Oct 2007 22:04:51 -0000 1.36 --- Spring.Aop.2005.csproj 10 Oct 2007 07:38:18 -0000 1.37 *************** *** 400,403 **** --- 400,404 ---- <Compile Include="Aspects\AbstractExceptionHandler.cs" /> <Compile Include="Aspects\IExceptionHandler.cs" /> + <Compile Include="Aspects\RetryExceptionHandler.cs" /> <Compile Include="AssemblyInfo.cs"> <SubType>Code</SubType> |
From: Mark P. <mar...@us...> - 2007-10-10 07:38:20
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6806/Aspects/Exceptions Modified Files: ExceptionHandlerAdvice.cs Log Message: Add retry advice Index: ExceptionHandlerAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/ExceptionHandlerAdvice.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExceptionHandlerAdvice.cs 8 Oct 2007 22:05:16 -0000 1.6 --- ExceptionHandlerAdvice.cs 10 Oct 2007 07:38:17 -0000 1.7 *************** *** 22,31 **** using System.Collections; using System.Reflection; - using System.Text.RegularExpressions; - using System.Threading; using AopAlliance.Intercept; using Common.Logging; - using Spring.Objects.Factory; - using Spring.Util; namespace Spring.Aspects.Exceptions --- 22,27 ---- |
From: Mark P. <mar...@us...> - 2007-10-10 03:03:53
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26805 Modified Files: index.xml remoting.xml services.xml web.xml webservices.xml Log Message: update documentation Index: webservices.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/webservices.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** webservices.xml 5 Sep 2007 18:30:17 -0000 1.10 --- webservices.xml 10 Oct 2007 03:03:28 -0000 1.11 *************** *** 3,9 **** <title>Web Services</title> ! <para>While the out-of-the-box support for web services in .NET is ! excellent, there are a few areas that the Spring.NET thought could use some ! improvement.</para> <sect1 id="server-side"> --- 3,27 ---- <title>Web Services</title> ! <sect1> ! <title>Introduction</title> ! ! <para>While the out-of-the-box support for web services in .NET is ! excellent, there are a few areas that the Spring.NET thought could use ! some improvement. Spring adds the ability to perform dependency injection ! on standard asmx web services. Spring's .NET Web Services support also ! allows you to export a 'plain .NET object' as a .NET web service By "plain ! .NET object" we mean classes that do not contain infrastructure specific ! attributes, such as WebMethod. On the server side, Spring's .NET web ! service exporters will automatically create a proxy that adds web service ! attributes. On the client side you can use Spring IoC container to ! configure a client side proxy that you generated with standard command ! line tools. Additionally, Spring provides the functionality to create the ! web service proxy dynamically at runtime (much like running the command ! line tools but at runtime and without some of the tools quirks) and use ! dependency injection to configure the resulting proxy class. On both the ! server and client side, you can apply AOP advice to add behavior such as ! logging, exception handling, etc. that is not easily encapsulated within ! an inheritance hierarchy across the application.</para> ! </sect1> <sect1 id="server-side"> *************** *** 26,30 **** should be exposed as a remote object, web service, or even an enterprise (COM+) component, should only be a matter of configuration, and not ! implementation.<!-- TODO link to services --></para> <sect2> --- 44,48 ---- should be exposed as a remote object, web service, or even an enterprise (COM+) component, should only be a matter of configuration, and not ! implementation.</para> <sect2> *************** *** 85,90 **** exactly the same as a standard handler factory if said handler factory cannot find the object definition for the specified service name. In ! that case the handler factory will simply look for an .asmx file. ! </para> <para>If you are using IIS7 the following configuration is needed</para> --- 103,107 ---- exactly the same as a standard handler factory if said handler factory cannot find the object definition for the specified service name. In ! that case the handler factory will simply look for an .asmx file.</para> <para>If you are using IIS7 the following configuration is needed</para> *************** *** 442,452 **** in order to work.</para> ! <para>The <classname>WebServiceProxyFactory</classname> also implements the interface, ! <classname>Spring.Objects.Factory.IConfigurableFactoryObject</classname>, ! allowing to specify configuration for the product that the ! <classname>WebServiceProxyFactory</classname> creates. ! This is done by specifying the ProductTemplate property. This is ! particularly useful for securing the web service. An example is shown ! below.</para> <programlisting><object id="PublicarAltasWebService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services"> --- 459,469 ---- in order to work.</para> ! <para>The <classname>WebServiceProxyFactory</classname> also implements ! the interface, ! <classname>Spring.Objects.Factory.IConfigurableFactoryObject</classname>, ! allowing to specify configuration for the product that the ! <classname>WebServiceProxyFactory</classname> creates. This is done by ! specifying the ProductTemplate property. This is particularly useful for ! securing the web service. An example is shown below.</para> <programlisting><object id="PublicarAltasWebService" type="Spring.Web.Services.WebServiceProxyFactory, Spring.Services"> Index: services.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/services.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** services.xml 28 Jun 2007 14:42:34 -0000 1.6 --- services.xml 10 Oct 2007 03:03:28 -0000 1.7 *************** *** 1,67 **** <chapter id="services"> ! <title>.NET Enterprise Services</title> ! <sect1 id="services-introduction"> ! <title>Introduction</title> ! <para>The main goal of Spring.Services is to provide location transparency for business ! services. We believe that users should be able to implement services the simplest way ! possible, using service interfaces and implementations in the form of plain .Net ! classes. We also think that decision on how a particular service is exposed to clients ! should be a configuration concern and not an implementation concern. </para> ! <para>Spring.Services provides infrastructure that allows you to expose ! <emphasis>any</emphasis> normal object as a ! <link linkend="webservices">web service</link>, System.EnterpriseServices ! serviced component or ! remoting object using service exporter definitions in the configuration file. </para> ! <para> We believe that this approach will also provide the easiest migration path to Indigo. ! As long as your services are coded against interfaces and implemented as regular ! classes, we should be able to implement Indigo exporter for them once the Indigo ships. </para> ! <para>In the meantime, you get the benefit of being able to expose business services any way ! you find appropriate using existing exporters and Spring configuration. </para> ! </sect1> ! <sect1 id="services-servicedcomponents"> ! <title>Serviced Components</title> ! <para>Services components in .NET are able to use COM+ services such as declarative and ! distributed transactions, role based security, object pooling messaging. To access these ! services your class needs to derive from the class ! <classname>System.EnterpriseServices.ServicedComponent</classname>, adorn your class ! and assemblies with relevant attributes, and configure your application by registering ! your serviced components with the COM+ catalog. The overall landscape of accessing and ! using COM+ services within .NET goes by the name .NET Enterprise Services. </para> ! <para>Many of these services can be provided without the need to derive from a ! ServicedComponent though the use of Spring's Aspect-Oriented Programming functionality. ! Nevertheless, you may be interested in exporting your class as a serviced component and ! having client access that component in a location transparent manner. By using Spring's ! <literal>ServicedComponentExporter</literal>, ! <literal>EnterpriseServicesExporter</literal>and ! <literal>ServicedComponentFactory</literal> you can easily create and consume serviced ! components without having your class inherit from <literal>ServicedComponent</literal> ! and automate the manual deployment process that involves strongly signing your assembly ! and using the <literal>regsvcs</literal> utility.</para> ! <para> Note that the following sections do not delve into the details of programming .NET ! Enterprise Services. An excellent reference for such information is Christian Nagel's ! "Enterprise Services with the .NET Framework" </para> ! </sect1> ! <sect1 id="services-serverside"> ! <title>Server Side</title> ! <para>One of the main challenges for the exported to host a serviced component is the need ! for them to be contained within a physical assembly on the file system in order to be ! registered with the COM+ Services. To make things more complicated, this assembly has to ! be strongly named before it can be successfully registered. </para> ! <para>Spring provides two classes that allow all of this to happen. <itemizedlist> ! <listitem><classname>Spring.Enterprise.ServicedComponentExporter</classname> is ! responsible for exporting single component and making sure that it derives from ! ServicedComponent class. It also allows you to specify class-level and ! method-level attributes for the component in order to define things such as ! transactional behavior, queuing, etc. </listitem> ! <listitem> ! <classname>Spring.Enterprise.EnterpriseServicesExporter</classname> corresponds ! to a COM+ application, and it allows you to specify list of components that ! should be included in the application, as well as the application name and other ! assembly-level attributes </listitem> ! </itemizedlist> ! </para> ! <para> Let's say that we have a simple service interface and implementation class, such as ! these: </para> ! <programlisting><![CDATA[namespace MyApp.Services { public interface IUserManager --- 1,82 ---- + <?xml version="1.0" encoding="UTF-8"?> <chapter id="services"> ! <title>.NET Enterprise Services</title> ! ! <sect1 id="services-introduction"> ! <title>Introduction</title> ! ! <para>Spring's .NET Enterprise Services support allows you to export a ! 'plain .NET object' as a .NET Remoted object. By "plain .NET object" we ! mean classes that do not inherit from a specific infrastructure base class ! such as ServicedComponent..</para> ! ! <para>You can leverage the IoC container to configure the exporter and ! service endpoints. You may also opt to not use the IoC container to ! configure the objects and use Spring's .NET Enterprise Services classes ! programmatically, as you would with any third party library.</para> ! </sect1> ! ! <sect1 id="services-servicedcomponents"> ! <title>Serviced Components</title> ! ! <para>Services components in .NET are able to use COM+ services such as ! declarative and distributed transactions, role based security, object ! pooling messaging. To access these services your class needs to derive ! from the class ! <classname>System.EnterpriseServices.ServicedComponent</classname>, adorn ! your class and assemblies with relevant attributes, and configure your ! application by registering your serviced components with the COM+ catalog. ! The overall landscape of accessing and using COM+ services within .NET ! goes by the name .NET Enterprise Services.</para> ! ! <para>Many of these services can be provided without the need to derive ! from a ServicedComponent though the use of Spring's Aspect-Oriented ! Programming functionality. Nevertheless, you may be interested in ! exporting your class as a serviced component and having client access that ! component in a location transparent manner. By using Spring's ! <literal>ServicedComponentExporter</literal>, ! <literal>EnterpriseServicesExporter</literal>and ! <literal>ServicedComponentFactory</literal> you can easily create and ! consume serviced components without having your class inherit from ! <literal>ServicedComponent</literal> and automate the manual deployment ! process that involves strongly signing your assembly and using the ! <literal>regsvcs</literal> utility.</para> ! ! <para>Note that the following sections do not delve into the details of ! programming .NET Enterprise Services. An excellent reference for such ! information is Christian Nagel's "Enterprise Services with the .NET ! Framework"</para> ! </sect1> ! ! <sect1 id="services-serverside"> ! <title>Server Side</title> ! ! <para>One of the main challenges for the exported to host a serviced ! component is the need for them to be contained within a physical assembly ! on the file system in order to be registered with the COM+ Services. To ! make things more complicated, this assembly has to be strongly named ! before it can be successfully registered.</para> ! ! <para>Spring provides two classes that allow all of this to happen. ! <itemizedlist> ! <listitem> ! <classname>Spring.Enterprise.ServicedComponentExporter</classname> ! ! is responsible for exporting single component and making sure that it derives from ServicedComponent class. It also allows you to specify class-level and method-level attributes for the component in order to define things such as transactional behavior, queuing, etc. ! </listitem> ! ! <listitem> ! ! ! <classname>Spring.Enterprise.EnterpriseServicesExporter</classname> ! ! corresponds to a COM+ application, and it allows you to specify list of components that should be included in the application, as well as the application name and other assembly-level attributes ! </listitem> ! </itemizedlist></para> ! ! <para>Let's say that we have a simple service interface and implementation ! class, such as these:</para> ! ! <programlisting>namespace MyApp.Services { public interface IUserManager *************** *** 93,171 **** } } ! }]]> </programlisting> ! <para> And the corresponding object definition for it in the application context config ! file: </para> ! <programlisting><![CDATA[<object id="userManager" type="MyApp.Services.SimpleUserManager"> ! <property name="UserDao" ref="userDao"/> ! </object>]]></programlisting> ! <para> Let's say that we want to expose user manager as an serviced component so we can ! leverage its support for transactions. First we need to export our service using the ! exporter <literal>ServicedComponentExporter</literal> as shown below</para> ! <programlisting><![CDATA[<object id="MyApp.EnterpriseServices.UserManager" type="Spring.Enterprise.ServicedComponentExporter, Spring.Services"> ! <property name="TargetName" value="userManager"/> ! <property name="TypeAttributes"> ! <list> ! <object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices"/> ! </list> ! </property> ! <property name="MemberAttributes"> ! <dictionary> ! <entry key="*"> ! <list> ! <object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices"/> ! </list> ! </entry> ! </dictionary> ! </property> ! </object>]]></programlisting> ! <para>The exporter defined above will create a composition proxy for our SimpleUserManager ! class that extends <literal>ServicedComponent</literal> and delegates method calls to ! SimpleUserManager instance. It will also adorn the proxy class with a ! <literal>TransactionAtribute</literal> and all methods with an ! <literal>AutoCompleteAttribute</literal>. </para> ! <para>The next thing we need to do is configure an exporter for the COM+ application that ! will host our new component: </para> ! <programlisting><![CDATA[<object id="MyComponentExporter" type="Spring.Enterprise.EnterpriseServicesExporter, Spring.Services"> ! <property name="ApplicationName" value="My COM+ Application"/> ! <property name="Description" value="My enterprise services application."/> ! <property name="AccessControl"> ! <object type="System.EnterpriseServices.ApplicationAccessControlAttribute, System.EnterpriseServices"> ! <property name="AccessChecksLevel" value="ApplicationComponent"/> ! </object> ! </property> ! <property name="Roles"> ! <list> ! <value>Admin : Administrator role</value> ! <value>User : User role</value> ! <value>Manager : Administrator role</value> ! </list> ! </property> ! <property name="Components"> ! <list> ! <ref object="MyApp.EnterpriseServices.UserManager"/> ! </list> ! </property> ! <property name="Assembly" value="MyComPlusApp"/> ! </object>]]></programlisting> ! <para>This exporter will put all proxy classes for the specified list of components into the ! specified assembly, sign the assembly, and register it with the specified COM+ ! application name. If application does not exist it will create it and configure it using ! values specified for Description, AccessControl and Roles properties. </para> ! </sect1> ! <sect1 id="services-clientside"> ! <title>Client Side</title> ! <para>Because serviced component classes are dynamically generated and registered, you ! cannot instantiate them in your code using new operator. Instead, you need to use ! <classname>Spring.Enterprise.ServicedComponentFactory</classname> definition, which ! also allows you to specify configuration template for the component as well as the name ! of the remote server component is running on, if necessary. An example is shown below</para> ! <programlisting><![CDATA[<object id="enterpriseUserManager" type="Spring.Enterprise.ServicedComponentFactory, Spring.Services"> ! <property name="Name" value="MyApp.EnterpriseServices.UserManager"/> ! <property name="Template" value="userManager"/> ! </object>]]></programlisting> ! <para>You can then inject this instance of the IUserManager into a client class and use it ! just like you would use original SimpleUserManager implementation. As you can see, by ! coding your services as plain .Net objects, against well defined service interfaces, you ! can achieve true location transparency for your services through configuration. </para> ! </sect1> ! </chapter> --- 108,203 ---- } } ! } </programlisting> ! ! <para>And the corresponding object definition for it in the application ! context config file:</para> ! ! <programlisting><object id="userManager" type="MyApp.Services.SimpleUserManager"> ! <property name="UserDao" ref="userDao"/> ! </object></programlisting> ! ! <para>Let's say that we want to expose user manager as an serviced ! component so we can leverage its support for transactions. First we need ! to export our service using the exporter ! <literal>ServicedComponentExporter</literal> as shown below</para> ! ! <programlisting><object id="MyApp.EnterpriseServices.UserManager" type="Spring.Enterprise.ServicedComponentExporter, Spring.Services"> ! <property name="TargetName" value="userManager"/> ! <property name="TypeAttributes"> ! <list> ! <object type="System.EnterpriseServices.TransactionAttribute, System.EnterpriseServices"/> ! </list> ! </property> ! <property name="MemberAttributes"> ! <dictionary> ! <entry key="*"> ! <list> ! <object type="System.EnterpriseServices.AutoCompleteAttribute, System.EnterpriseServices"/> ! </list> ! </entry> ! </dictionary> ! </property> ! </object></programlisting> ! ! <para>The exporter defined above will create a composition proxy for our ! SimpleUserManager class that extends <literal>ServicedComponent</literal> ! and delegates method calls to SimpleUserManager instance. It will also ! adorn the proxy class with a <literal>TransactionAtribute</literal> and ! all methods with an <literal>AutoCompleteAttribute</literal>.</para> ! ! <para>The next thing we need to do is configure an exporter for the COM+ ! application that will host our new component:</para> ! ! <programlisting><object id="MyComponentExporter" type="Spring.Enterprise.EnterpriseServicesExporter, Spring.Services"> ! <property name="ApplicationName" value="My COM+ Application"/> ! <property name="Description" value="My enterprise services application."/> ! <property name="AccessControl"> ! <object type="System.EnterpriseServices.ApplicationAccessControlAttribute, System.EnterpriseServices"> ! <property name="AccessChecksLevel" value="ApplicationComponent"/> ! </object> ! </property> ! <property name="Roles"> ! <list> ! <value>Admin : Administrator role</value> ! <value>User : User role</value> ! <value>Manager : Administrator role</value> ! </list> ! </property> ! <property name="Components"> ! <list> ! <ref object="MyApp.EnterpriseServices.UserManager"/> ! </list> ! </property> ! <property name="Assembly" value="MyComPlusApp"/> ! </object></programlisting> ! ! <para>This exporter will put all proxy classes for the specified list of ! components into the specified assembly, sign the assembly, and register it ! with the specified COM+ application name. If application does not exist it ! will create it and configure it using values specified for Description, ! AccessControl and Roles properties.</para> ! </sect1> ! ! <sect1 id="services-clientside"> ! <title>Client Side</title> ! ! <para>Because serviced component classes are dynamically generated and ! registered, you cannot instantiate them in your code using new operator. ! Instead, you need to use ! <classname>Spring.Enterprise.ServicedComponentFactory</classname> ! definition, which also allows you to specify configuration template for ! the component as well as the name of the remote server component is ! running on, if necessary. An example is shown below</para> ! ! <programlisting><object id="enterpriseUserManager" type="Spring.Enterprise.ServicedComponentFactory, Spring.Services"> ! <property name="Name" value="MyApp.EnterpriseServices.UserManager"/> ! <property name="Template" value="userManager"/> ! </object></programlisting> ! ! <para>You can then inject this instance of the IUserManager into a client ! class and use it just like you would use original SimpleUserManager ! implementation. As you can see, by coding your services as plain .Net ! objects, against well defined service interfaces, you can achieve true ! location transparency for your services through configuration.</para> ! </sect1> ! </chapter> \ No newline at end of file Index: web.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/web.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** web.xml 21 Aug 2007 19:38:56 -0000 1.24 --- web.xml 10 Oct 2007 03:03:28 -0000 1.25 *************** *** 20,25 **** view elements.</para> ! <para>Having said that, there are many good things about ASP.NET. ! Server-side forms and controls make developers significantly more productive and allow us to significantly simplify page markup. They also make cross-browser issues easier to deal with, as each control can make --- 20,25 ---- view elements.</para> ! <para>Having said that, there <emphasis>are</emphasis> good things about ! ASP.NET. Server-side forms and controls make developers significantly more productive and allow us to significantly simplify page markup. They also make cross-browser issues easier to deal with, as each control can make *************** *** 32,39 **** development.</para> ! <para>For all these reasons, we decided that instead of developing a new, "pure and true MVC" web framework as part of Spring.NET, we should take a more pragmatic approach and extend ASP.NET in such a way that most, if not ! all of its shortcomings are eliminated.</para> <para>As we said earlier, event handlers in code-behind classes really --- 32,46 ---- development.</para> ! <para>For these reasons, we decided that instead of developing a new, "pure and true MVC" web framework as part of Spring.NET, we should take a more pragmatic approach and extend ASP.NET in such a way that most, if not ! all of its shortcomings are eliminated. It should be noted that with the ! introduction of a 'true MVC framework' being added to .NET, with extension ! points for IoC containers such as Spring, Spring will continue to play a ! role within a MVC based model once that functionality is available from ! Microsoft. It is worth noting that Spring Java has a very popular MVC ! framework and much of that experience and added value can be ! transliterated to help developers be more productive when using .NET ! upcoming MVC support. </para> <para>As we said earlier, event handlers in code-behind classes really Index: remoting.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/remoting.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** remoting.xml 24 Sep 2007 11:50:17 -0000 1.20 --- remoting.xml 10 Oct 2007 03:03:28 -0000 1.21 *************** *** 6,44 **** <title>Introduction</title> ! <para>The main goal of Spring.Services is to provide location transparency ! for business services. We believe that users should be able to implement ! services the simplest way possible, using service interfaces and ! implementations in the form of plain .NET classes. We also think that ! decision on how a particular service is exposed to clients should be a ! configuration concern and not an implementation concern.</para> ! <para>In preview status is support for exposing a plain .NET object as a ! <link linkend="webservices">web service</link>, ! System.EnterpriseServices <link ! linkend="services-servicedcomponents">serviced component,</link> and ! remoted objects. By "plain .NET object" we mean classes that do not ! inherit from a specific infrastructure base class (such as ! MarshalByRefObject) or infrastructure attributes (such as WebMethod). The ! current implementation relies on your plain .NET object to implement a ! business interface. Spring's .NET Remoting exporters will automatically ! create a proxy that implements MarshalByRefObject. On the server side you ! can register SAO types as either SingleCall or Singleton and also ! configure on a per-object basis lifetime and leasing parameters. ! Additionally for SAO objects you can export an object that has had AOP ! advice applied to it. On the client side you can obtain CAO references to ! server proxy objects in a manner that promotes interface based design best ! practices when developing .NET remoting applications. An remoting specific ! xml-schema is also provided to simplify the remoting configuration, ! although you can still use the standard reflection-like property based ! configuration schema.</para> ! <para>If you want to use these features please get the code from CVS ! <ulink ! url="http://opensource.atlassian.com/confluence/spring/display/NET/Project+Structure">(instructions) ! </ulink> or from the nightly release vailable from the following <ulink ! url="http://www.springframework.net/downloads/nightly/">download ! page</ulink>. A sample application, often referred to in this ! documentation, is under the directory ! "examples\Spring\Spring.Calculator"/></para> </section> --- 6,34 ---- <title>Introduction</title> ! <para>Spring's .NET Remoting support allows you to export a 'plain .NET ! object' as a .NET Remoted object. By "plain .NET object" we mean classes ! that do not inherit from a specific infrastructure base class such as ! MarshalByRefObject. On the server side, Spring's .NET Remoting exporters ! will automatically create a proxy that implements MarshalByRefObject. You ! register SAO types as either SingleCall or Singleton and also configure on ! a per-object basis lifetime and leasing parameters. On the client side you ! can obtain CAO references to server proxy objects in a manner that ! promotes interface based design best practices when developing .NET ! remoting applications. The current implementation requires that your plain ! .NET objects implements a business service interface. Additionally you can ! add AOP advice to both SAO and CAO objects.</para> ! <para>You can leverage the IoC container to configure the exporter and ! service endpoints. A remoting specific xml-schema is provided to simplify ! the remoting configuration but you can still use the standard ! reflection-like property based configuration schema. You may also opt to ! not use the IoC container to configure the objects and use Spring's .NET ! Remoting classes programmatically, as you would with any third party ! library.</para> ! <para>A sample application, often referred to in this documentation, is in ! the distribution under the directory "examples\Spring\Spring.Calculator" ! and may also be found via the start menu and selecting the 'Calculator' ! item.</para> </section> *************** *** 219,229 **** <title>IIS Application Configuration</title> ! <para>If you are deploying a .NET remoting application inside IIS there is a ! <ulink url="http://forum.springframework.net/showthread.php?t=469">sample project </ulink> ! that demonstrates the necessary configuration using Spring.Web.</para> ! <para>Spring.Web ensures the application context is initialized, but if you don't use ! Spring.Web the idea is to start the initialization of the Spring IoC container inside ! the application start method defined in Global.asax, as shown below</para> <programlisting> void Application_Start(object sender, EventArgs e) --- 209,222 ---- <title>IIS Application Configuration</title> ! <para>If you are deploying a .NET remoting application inside IIS there ! is a <ulink ! url="http://forum.springframework.net/showthread.php?t=469">sample ! project </ulink> that demonstrates the necessary configuration using ! Spring.Web.</para> ! <para>Spring.Web ensures the application context is initialized, but if ! you don't use Spring.Web the idea is to start the initialization of the ! Spring IoC container inside the application start method defined in ! Global.asax, as shown below</para> <programlisting> void Application_Start(object sender, EventArgs e) *************** *** 421,425 **** <para>On the client side a CAO reference is obtained by using the ! <classname>CaoFactoryObject</classname> as shown below </para> <programlisting><object id="calculatorService" type="Spring.Remoting.CaoFactoryObject, Spring.Services"> --- 414,418 ---- <para>On the client side a CAO reference is obtained by using the ! <classname>CaoFactoryObject</classname> as shown below</para> <programlisting><object id="calculatorService" type="Spring.Remoting.CaoFactoryObject, Spring.Services"> *************** *** 434,438 **** <interfacename>IAdvancedCalculator</interfacename> interface. (As always, that doesn't mean the client should treat the object as if it was an ! in-process object). </para> <para>Alternatively, you can use the remtoing schema to shorten this --- 427,431 ---- <interfacename>IAdvancedCalculator</interfacename> interface. (As always, that doesn't mean the client should treat the object as if it was an ! in-process object).</para> <para>Alternatively, you can use the remtoing schema to shorten this Index: index.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/index.xml,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** index.xml 21 Aug 2007 03:08:52 -0000 1.73 --- index.xml 10 Oct 2007 03:03:28 -0000 1.74 *************** *** 15,18 **** --- 15,19 ---- <!ENTITY overview SYSTEM "overview.xml"> + <!ENTITY psa-intro SYSTEM "psa-intro.xml"> <!ENTITY remoting SYSTEM "remoting.xml"> <!ENTITY web SYSTEM "web.xml"> *************** *** 22,27 **** <!ENTITY threading SYSTEM "threading.xml"> <!ENTITY pool SYSTEM "pool.xml"> - <!ENTITY windows-service - SYSTEM "windows-service.xml"> <!ENTITY preface SYSTEM "preface.xml"> --- 23,26 ---- *************** *** 58,62 **** <releaseinfo>Version 1.1 RC1</releaseinfo> --> ! <pubdate>Last Updated August 20, 2007</pubdate> <authorgroup> <author> --- 57,61 ---- <releaseinfo>Version 1.1 RC1</releaseinfo> --> ! <pubdate>Last Updated October 9, 2007</pubdate> <authorgroup> <author> *************** *** 259,268 **** <para> This part of the reference documentation covers ! the Spring Framework's integration with .NET technologies ! such as .NET Remoting, Enterprise Services, ! Web Services, and Windows Services. </para> <itemizedlist> <listitem> <xref linkend="remoting" /> </listitem> --- 258,271 ---- <para> This part of the reference documentation covers ! the Spring Framework's integration with .NET distributed ! technologies such as .NET Remoting, Enterprise Services, ! Web Services. Integration with WCF Services is forthcoming. ! Please refer to the introduction chapter for more details. </para> <itemizedlist> <listitem> + <xref linkend="psa-intro" /> + </listitem> + <listitem> <xref linkend="remoting" /> </listitem> *************** *** 273,285 **** <xref linkend="webservices" /> </listitem> - <listitem> - <xref linkend="windows-service" /> - </listitem> </itemizedlist> </partintro> &remoting; &services; &webservices; - &windows-service; </part> <part id="index-vsnet"> --- 276,285 ---- <xref linkend="webservices" /> </listitem> </itemizedlist> </partintro> + &psa-intro; &remoting; &services; &webservices; </part> <part id="index-vsnet"> |
From: Mark P. <mar...@us...> - 2007-10-10 03:03:31
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src/images In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26805/images Added Files: spring-triangle.png Log Message: update documentation --- NEW FILE: spring-triangle.png --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2007-10-09 22:25:35
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests/Remoting In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15562 Modified Files: SaoFactoryObjectTests.cs Log Message: clean up docs. add some config to explore autoproxy with remoting exporter - not active atm. Index: SaoFactoryObjectTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests/Remoting/SaoFactoryObjectTests.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SaoFactoryObjectTests.cs 7 Sep 2007 01:59:53 -0000 1.11 --- SaoFactoryObjectTests.cs 9 Oct 2007 22:25:31 -0000 1.12 *************** *** 107,112 **** Assert.IsNotNull(obj, "Object is null even though a object has been exported."); - Assert.IsTrue((obj is ISimpleCounter), "Object should implement 'ISimpleCounter' interface."); Assert.IsTrue(AopUtils.IsAopProxy(obj)); MethodCounter aopCounter = ctx.GetObject("countingBeforeAdvice") as MethodCounter; --- 107,113 ---- Assert.IsNotNull(obj, "Object is null even though a object has been exported."); Assert.IsTrue(AopUtils.IsAopProxy(obj)); + Assert.IsTrue((obj is ISimpleCounter), "Object should implement 'ISimpleCounter' interface."); + MethodCounter aopCounter = ctx.GetObject("countingBeforeAdvice") as MethodCounter; |
From: Mark P. <mar...@us...> - 2007-10-09 22:25:28
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests/Data/Spring/Remoting In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15551 Modified Files: saoSingleton-aop.xml Log Message: clean up docs. add some config to explore autoproxy with remoting exporter - not active atm. Index: saoSingleton-aop.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Services.Tests/Data/Spring/Remoting/saoSingleton-aop.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** saoSingleton-aop.xml 7 Sep 2007 02:00:07 -0000 1.1 --- saoSingleton-aop.xml 9 Oct 2007 22:25:25 -0000 1.2 *************** *** 26,29 **** --- 26,30 ---- serviceInterface="Spring.Remoting.ISimpleCounter, Spring.Services.Tests" serviceUrl="tcp://localhost:8005/RemotedSaoSingletonCounter"/> + *************** *** 37,40 **** --- 38,42 ---- --> + <object id="remoteCounter" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop"> <property name="target" ref="remoteSaoSingletonCounter"/> *************** *** 49,53 **** </list> </property> ! </object> <!-- NOTE - CAN NOT USE AUTO PROXY CREATOR FOR SAO SINCE CAN'T QUERY USING REFLECTION FOR --- 51,56 ---- </list> </property> ! </object> ! <!-- NOTE - CAN NOT USE AUTO PROXY CREATOR FOR SAO SINCE CAN'T QUERY USING REFLECTION FOR |
From: Mark P. <mar...@us...> - 2007-10-09 22:25:24
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15540 Modified Files: AbstractTransactionAspectTests.cs Log Message: clean up docs. add some config to explore autoproxy with remoting exporter - not active atm. Index: AbstractTransactionAspectTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Transaction/Interceptor/AbstractTransactionAspectTests.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractTransactionAspectTests.cs 17 Sep 2007 19:16:14 -0000 1.3 --- AbstractTransactionAspectTests.cs 9 Oct 2007 22:25:20 -0000 1.4 *************** *** 147,153 **** ITransactionAttribute txatt = new ConfigurableTransactionAttribute(shouldRollback); ! //TODO: Note can't use method info on ITestObject.... may need to introduce own method info comparison ! //that doesn't take into account owning type. ! MethodInfo mi = typeof (TestObject).GetMethod("Exceptional"); MethodMapTransactionAttributeSource tas = new MethodMapTransactionAttributeSource(); --- 147,152 ---- ITransactionAttribute txatt = new ConfigurableTransactionAttribute(shouldRollback); ! ! MethodInfo mi = typeof (ITestObject).GetMethod("Exceptional"); MethodMapTransactionAttributeSource tas = new MethodMapTransactionAttributeSource(); |
From: Mark P. <mar...@us...> - 2007-10-09 22:25:18
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15525 Modified Files: AdoPlatformTransactionManager.cs Log Message: clean up docs. add some config to explore autoproxy with remoting exporter - not active atm. Index: AdoPlatformTransactionManager.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core/AdoPlatformTransactionManager.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AdoPlatformTransactionManager.cs 30 Aug 2007 19:59:49 -0000 1.3 --- AdoPlatformTransactionManager.cs 9 Oct 2007 22:25:15 -0000 1.4 *************** *** 372,396 **** /// after it has injected all of an object's dependencies. /// </summary> ! /// <remarks> ! /// <p> ! /// This method allows the object instance to perform the kind of ! /// initialization only possible when all of it's dependencies have ! /// been injected (set), and to throw an appropriate exception in the ! /// event of misconfiguration. ! /// </p> ! /// <p> ! /// Please do consult the class level documentation for the ! /// <see cref="Spring.Objects.Factory.IObjectFactory"/> interface for a ! /// description of exactly <i>when</i> this method is invoked. In ! /// particular, it is worth noting that the ! /// <see cref="Spring.Objects.Factory.IObjectFactoryAware"/> ! /// and <see cref="Spring.Context.IApplicationContextAware"/> ! /// callbacks will have been invoked <i>prior</i> to this method being ! /// called. ! /// </p> ! /// </remarks> ! /// <exception cref="System.Exception"> ! /// In the event of misconfiguration (such as the failure to set a ! /// required property) or if initialization fails. /// </exception> public void AfterPropertiesSet() --- 372,377 ---- /// after it has injected all of an object's dependencies. /// </summary> ! /// <exception cref="System.ArgumentException"> ! /// If DbProvider is null. /// </exception> public void AfterPropertiesSet() |
From: Mark P. <mar...@us...> - 2007-10-09 21:37:11
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv28998 Added Files: ITargetTypeAware.cs Log Message: add missing file... --- NEW FILE: ITargetTypeAware.cs --- #region License /* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #endregion using System; namespace Spring.Aop { /// <summary> /// Minimal interface for exposing the target type behind a proxy. /// </summary> /// <author>Mark Pollack (.NET)</author> /// <author>Juergen Hoeller</author> /// <version>$Id: ITargetTypeAware.cs,v 1.1 2007/10/09 21:37:06 markpollack Exp $</version> public interface ITargetTypeAware { /// <summary> /// Gets the target type behind the implementing object. /// Ttypically a proxy configuration or an actual proxy. /// </summary> /// <value>The type of the target or null if not known.</value> Type TargetType { get; } } } |
From: Mark P. <mar...@us...> - 2007-10-08 22:05:37
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9704 Modified Files: Spring.Data.Tests.2005.csproj Log Message: Update to Common.Logging 1.2 Add Logging advice Refactoring of ExceptionHandlingAdvice start of retry advice misc improvements to spring.aop Index: Spring.Data.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Tests/Spring.Data.Tests.2005.csproj,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** Spring.Data.Tests.2005.csproj 14 Sep 2007 15:45:51 -0000 1.28 --- Spring.Data.Tests.2005.csproj 8 Oct 2007 22:05:34 -0000 1.29 *************** *** 173,176 **** --- 173,179 ---- <Compile Include="Transaction\Interceptor\TransactionInterceptorTests.cs" /> </ItemGroup> + <ItemGroup> + <Folder Include="Data\Core\" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <PropertyGroup> |
From: Mark P. <mar...@us...> - 2007-10-08 22:05:30
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9668/Aspects Added Files: RetryAdviceTests.cs Log Message: Update to Common.Logging 1.2 Add Logging advice Refactoring of ExceptionHandlingAdvice start of retry advice misc improvements to spring.aop --- NEW FILE: RetryAdviceTests.cs --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2007-10-08 22:05:30
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Aspects/Logging In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9668/Aspects/Logging Added Files: SimpleLoggingAdviceTests.cs TestableSimpleLoggingAdvice.cs Log Message: Update to Common.Logging 1.2 Add Logging advice Refactoring of ExceptionHandlingAdvice start of retry advice misc improvements to spring.aop --- NEW FILE: TestableSimpleLoggingAdvice.cs --- #region License /* * Copyright 2002-2007 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #endregion using AopAlliance.Intercept; using Common.Logging; namespace Spring.Aspects.Logging { /// <summary> /// This is simple wrapper to expose the protected methood InvokeUnderLog in the class /// SimpleLoggingAdvice for testing purposes. /// </summary> /// <author>Mark Pollack</author> /// <version>$Id: TestableSimpleLoggingAdvice.cs,v 1.1 2007/10/08 22:05:27 markpollack Exp $</version> public class TestableSimpleLoggingAdvice : SimpleLoggingAdvice { /// <summary> /// Initializes a new instance of the <see cref="TestableSimpleLoggingAdvice"/> class. /// </summary> /// <param name="useDynamicLogger">if set to <c>true</c> [use dynamic logger].</param> public TestableSimpleLoggingAdvice(bool useDynamicLogger) : base(useDynamicLogger) { } /// <summary> /// Initializes a new instance of the <see cref="TestableSimpleLoggingAdvice"/> class. /// </summary> public TestableSimpleLoggingAdvice() { } /// <summary> /// Calls the protected InvokeUnderLog method /// </summary> /// <param name="invocation">The invocation.</param> /// <param name="log">The log.</param> /// <returns>The result of the call to IMethodInvocation.Proceed()</returns> public object CallInvokeUnderLog(IMethodInvocation invocation, ILog log) { return InvokeUnderLog(invocation, log); } } } --- NEW FILE: SimpleLoggingAdviceTests.cs --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2007-10-08 22:05:29
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9668 Modified Files: Spring.Aop.Tests.2005.csproj Log Message: Update to Common.Logging 1.2 Add Logging advice Refactoring of ExceptionHandlingAdvice start of retry advice misc improvements to spring.aop Index: Spring.Aop.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Aop.Tests/Spring.Aop.Tests.2005.csproj,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Spring.Aop.Tests.2005.csproj 14 Sep 2007 15:45:50 -0000 1.31 --- Spring.Aop.Tests.2005.csproj 8 Oct 2007 22:05:26 -0000 1.32 *************** *** 85,88 **** --- 85,92 ---- <HintPath>..\..\..\lib\Net\2.0\nunit.framework.dll</HintPath> </Reference> + <Reference Include="Rhino.Mocks, Version=2.9.6.40380, Culture=neutral, PublicKeyToken=0b3305902db7183f, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\lib\Net\2.0\Rhino.Mocks.dll</HintPath> + </Reference> <Reference Include="System"> <Name>System</Name> *************** *** 247,250 **** --- 251,257 ---- <Compile Include="Aspects\Cache\InvalidateCacheAdviceTests.cs" /> <Compile Include="Aspects\Exception\ExceptionHandlerAspectIntegrationTests.cs" /> + <Compile Include="Aspects\Logging\SimpleLoggingAdviceTests.cs" /> + <Compile Include="Aspects\Logging\TestableSimpleLoggingAdvice.cs" /> + <Compile Include="Aspects\RetryAdviceTests.cs" /> <Compile Include="AssemblyInfo.cs"> <SubType>Code</SubType> |