springnet-commits Mailing List for Spring Framework .NET (Page 36)
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-11 05:57:36
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26105 Modified Files: WebServiceExporter.cs Log Message: SPRNET-606 - Fix in .NET 2.0 for problems with attributes in proxy generation. Index: WebServiceExporter.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Web/Web/Services/WebServiceExporter.cs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** WebServiceExporter.cs 21 Sep 2007 14:27:04 -0000 1.24 --- WebServiceExporter.cs 11 Oct 2007 05:57:33 -0000 1.25 *************** *** 404,407 **** --- 404,415 ---- for (int i = 0; i < attrs.Count; i++) { + ExtendedAttributeBuilder attrBuilder = + attrs[i] as ExtendedAttributeBuilder; + if ((attrBuilder != null) && + attrBuilder.AttributeType == typeof(WebServiceAttribute)) + { + attrs[i] = webServiceAttribute; + return attrs; + } if (attrs[i] is WebServiceAttribute) { *************** *** 424,430 **** bool containsWebMethodAttribute = false; ! foreach (Attribute attr in attrs) { ! if (attr is WebMethodAttribute) { containsWebMethodAttribute = true; --- 432,446 ---- bool containsWebMethodAttribute = false; ! for (int i = 0; i < attrs.Count; i++) { ! ExtendedAttributeBuilder attrBuilder = ! attrs[i] as ExtendedAttributeBuilder; ! if ((attrBuilder != null) && ! attrBuilder.AttributeType == typeof(WebMethodAttribute)) ! { ! containsWebMethodAttribute = true; ! break; ! } ! if (attrs[i] is WebMethodAttribute) { containsWebMethodAttribute = true; |
From: Mark P. <mar...@us...> - 2007-10-11 05:57:29
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26076/Util Modified Files: ReflectionUtils.cs Added Files: AttributeUtils.cs ExtendedAttributeBuilder.cs SafeAttributeUtils.cs Log Message: SPRNET-606 - Fix in .NET 2.0 for problems with attributes in proxy generation. Index: ReflectionUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Util/ReflectionUtils.cs,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** ReflectionUtils.cs 5 Oct 2007 17:06:01 -0000 1.51 --- ReflectionUtils.cs 11 Oct 2007 05:57:25 -0000 1.52 *************** *** 203,207 **** } ! /// <summary> /// From a given list of constructors, selects the constructor having an exact match on the given <paramref name="argValues"/>' types. /// </summary> --- 203,288 ---- } ! /// <summary> ! /// From a given list of methods, selects the method having an exact match on the given <paramref name="argValues"/>' types. ! /// </summary> ! /// <param name="methodTypeName">the type of method (used for exception reporting only)</param> ! /// <param name="methods">the list of methods to choose from</param> ! /// <param name="argValues">the arguments to the method</param> ! /// <returns>the method matching exactly the passed <paramref name="argValues"/>' types</returns> ! /// <exception cref="AmbiguousMatchException"> ! /// If more than 1 matching methods are found in the <paramref name="methods"/> list. ! /// </exception> ! private static MethodBase GetMethodBaseByArgumentValues(string methodTypeName, MethodBase[] methods, ! object[] argValues) ! { ! MethodBase match = null; ! int matchCount = 0; ! ! foreach (MethodBase m in methods) ! { ! ParameterInfo[] parameters = m.GetParameters(); ! bool isMatch = true; ! bool isExactMatch = true; ! object[] paramValues = argValues; ! ! try ! { ! if (parameters.Length > 0) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! if (lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0) ! { ! paramValues = ! PackageParamArray(argValues, parameters.Length, ! lastParameter.ParameterType.GetElementType()); ! } ! } ! ! for (int i = 0; i < parameters.Length; i++) ! { ! Type paramType = parameters[i].ParameterType; ! object paramValue = paramValues[i]; ! if ((paramValue == null && paramType.IsValueType) ! || (paramValue != null && !paramType.IsAssignableFrom(paramValue.GetType()))) ! { ! isMatch = false; ! break; ! } ! if (paramValue == null || paramType != paramValue.GetType()) ! { ! isExactMatch = false; ! } ! } ! } ! catch (InvalidCastException) ! { ! isMatch = false; ! } ! ! if (isMatch) ! { ! if (isExactMatch) ! { ! return m; ! } ! ! matchCount++; ! if (matchCount == 1) ! { ! match = m; ! } ! else ! { ! throw new AmbiguousMatchException( ! string.Format("Ambiguous match for {0} '{1}' for the specified number and types of arguments.", methodTypeName, ! m.Name)); ! } ! } ! } ! ! return match; ! } ! ! /// <summary> /// From a given list of constructors, selects the constructor having an exact match on the given <paramref name="argValues"/>' types. /// </summary> *************** *** 218,303 **** ! /// <summary> ! /// From a given list of methods, selects the method having an exact match on the given <paramref name="argValues"/>' types. ! /// </summary> ! /// <param name="methodTypeName">the type of method (used for exception reporting only)</param> ! /// <param name="methods">the list of methods to choose from</param> ! /// <param name="argValues">the arguments to the method</param> ! /// <returns>the method matching exactly the passed <paramref name="argValues"/>' types</returns> ! /// <exception cref="AmbiguousMatchException"> ! /// If more than 1 matching methods are found in the <paramref name="methods"/> list. ! /// </exception> ! private static MethodBase GetMethodBaseByArgumentValues(string methodTypeName, MethodBase[] methods, ! object[] argValues) ! { ! MethodBase match = null; ! int matchCount = 0; ! ! foreach (MethodBase m in methods) ! { ! ParameterInfo[] parameters = m.GetParameters(); ! bool isMatch = true; ! bool isExactMatch = true; ! object[] paramValues = argValues; ! ! try ! { ! if (parameters.Length > 0) ! { ! ParameterInfo lastParameter = parameters[parameters.Length - 1]; ! if (lastParameter.GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0) ! { ! paramValues = ! PackageParamArray(argValues, parameters.Length, ! lastParameter.ParameterType.GetElementType()); ! } ! } ! ! for (int i = 0; i < parameters.Length; i++) ! { ! Type paramType = parameters[i].ParameterType; ! object paramValue = paramValues[i]; ! if ((paramValue == null && paramType.IsValueType) ! || (paramValue != null && !paramType.IsAssignableFrom(paramValue.GetType()))) ! { ! isMatch = false; ! break; ! } ! if (paramValue == null || paramType != paramValue.GetType()) ! { ! isExactMatch = false; ! } ! } ! } ! catch (InvalidCastException) ! { ! isMatch = false; ! } ! ! if (isMatch) ! { ! if (isExactMatch) ! { ! return m; ! } ! ! matchCount++; ! if (matchCount == 1) ! { ! match = m; ! } ! else ! { ! throw new AmbiguousMatchException( ! string.Format("Ambiguous match for {0} '{1}' for the specified number and types of arguments.", methodTypeName, ! m.Name)); ! } ! } ! } ! ! return match; ! } ! ! /// <summary> /// Packages arguments into argument list containing parameter array as a last argument. /// </summary> --- 299,303 ---- ! /// <summary> /// Packages arguments into argument list containing parameter array as a last argument. /// </summary> --- NEW FILE: AttributeUtils.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: SafeAttributeUtils.cs --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ExtendedAttributeBuilder.cs --- (This appears to be a binary file; contents omitted.) |
From: Mark P. <mar...@us...> - 2007-10-11 05:57:28
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26076 Modified Files: Spring.Core.2005.csproj Log Message: SPRNET-606 - Fix in .NET 2.0 for problems with attributes in proxy generation. Index: Spring.Core.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Spring.Core.2005.csproj,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** Spring.Core.2005.csproj 14 Sep 2007 15:45:50 -0000 1.110 --- Spring.Core.2005.csproj 11 Oct 2007 05:57:25 -0000 1.111 *************** *** 953,959 **** --- 953,962 ---- <Compile Include="Util\CompareUtils.cs" /> <Compile Include="Util\ConfigurationUtils.cs" /> + <Compile Include="Util\ExtendedAttributeBuilder.cs" /> <Compile Include="Util\FatalReflectionException.cs" /> <Compile Include="Util\ObjectUtils.cs" /> <Compile Include="Util\ReflectionException.cs" /> + <Compile Include="Util\AttributeUtils.cs" /> + <Compile Include="Util\SafeAttributeUtils.cs" /> <Compile Include="Util\SystemUtils.cs" /> <Compile Include="Util\DynamicCodeManager.cs" /> |
From: Mark P. <mar...@us...> - 2007-10-11 05:57:28
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Proxy In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26076/Proxy Modified Files: AbstractProxyTypeBuilder.cs Log Message: SPRNET-606 - Fix in .NET 2.0 for problems with attributes in proxy generation. Index: AbstractProxyTypeBuilder.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Proxy/AbstractProxyTypeBuilder.cs,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** AbstractProxyTypeBuilder.cs 31 Jul 2007 18:16:25 -0000 1.28 --- AbstractProxyTypeBuilder.cs 11 Oct 2007 05:57:25 -0000 1.29 *************** *** 68,71 **** --- 68,72 ---- private IList _typeAttributes = new ArrayList(); private IDictionary _memberAttributes = new Hashtable(); + private readonly IList _typeAttributesToExclude = new ArrayList(); #endregion *************** *** 280,283 **** --- 281,293 ---- if (this.ProxyTargetAttributes) { + #if !NET_1_0 && !NET_1_1 + // First, try to apply the CustomAttributeData approach + if (SafeAttributeUtils.ApplyMethodReturnTypeAttributes(methodBuilder, targetMethod)) + { + // if succeeded with CustomAttributeData solution, return. + return; + } + #endif + // If didn't succeed with the CustomAttributeData, apply the old approach foreach (Attribute attr in targetMethod.ReturnTypeCustomAttributes.GetCustomAttributes(true)) { *************** *** 302,305 **** --- 312,326 ---- foreach (ParameterInfo paramInfo in targetMethod.GetParameters()) { + #if !NET_1_0 && !NET_1_1 + // First, try to apply the CustomAttributeData approach + if (SafeAttributeUtils.ApplyMethodParameterAttributes(methodBuilder, targetMethod, + paramInfo)) + { + // if succeeded with CustomAttributeData solution, continue with the + // next parameter. + continue; + } + #endif + // If didn't succeed with the CustomAttributeData, apply the old approach foreach (Attribute attr in paramInfo.GetCustomAttributes(true)) { *************** *** 330,335 **** if (this.ProxyTargetAttributes) { ! // add attributes that apply to the target type attributes.AddRange(type.GetCustomAttributes(false)); } --- 351,373 ---- if (this.ProxyTargetAttributes) { ! #if !NET_1_0 && !NET_1_1 ! // Try the CustomAttributeData approach first ! CustomAttributeBuilder[] attrBuilders = ! SafeAttributeUtils.GetMemberAttributes(type, TypeAttributesToExclude); ! ! if (attrBuilders != null) ! { ! attributes.AddRange(attrBuilders); ! } ! else // If CustomAttributeData approach failed use the old solution ! { ! ! // add attributes that apply to the target type ! attributes.AddRange(type.GetCustomAttributes(false)); ! } ! #else attributes.AddRange(type.GetCustomAttributes(false)); + #endif + } *************** *** 358,363 **** if (this.ProxyTargetAttributes) { ! // add attributes that apply to the target method attributes.AddRange(method.GetCustomAttributes(false)); } --- 396,416 ---- if (this.ProxyTargetAttributes) { ! #if !NET_1_0 && !NET_1_1 ! // Try the CustomAttributeData approach first ! CustomAttributeBuilder[] attrBuilders = ! SafeAttributeUtils.GetMemberAttributes(method); ! ! if (attrBuilders != null) ! { ! attributes.AddRange(attrBuilders); ! } ! else // If CustomAttributeData approach failed use the old solution ! { ! // add attributes that apply to the target method ! attributes.AddRange(method.GetCustomAttributes(false)); ! } ! #else attributes.AddRange(method.GetCustomAttributes(false)); + #endif } *************** *** 752,755 **** --- 805,825 ---- #endregion + + #region Protected Properties + + /// <summary> + /// Gets the type attributes to exclude. + /// </summary> + /// <value>The type attributes to exclude.</value> + protected virtual IList TypeAttributesToExclude + { + get + { + return _typeAttributesToExclude; + } + } + + #endregion + } } \ No newline at end of file |
From: Mark P. <mar...@us...> - 2007-10-11 05:57:18
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework/DynamicProxy In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv26065 Modified Files: AbstractAopProxyTypeBuilder.cs Log Message: SPRNET-606 - Fix in .NET 2.0 for problems with attributes in proxy generation. Index: AbstractAopProxyTypeBuilder.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aop/Framework/DynamicProxy/AbstractAopProxyTypeBuilder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractAopProxyTypeBuilder.cs 2 Aug 2007 16:28:29 -0000 1.3 --- AbstractAopProxyTypeBuilder.cs 11 Oct 2007 05:57:15 -0000 1.4 *************** *** 23,32 **** using System; using System.Collections; - using System.Reflection; using System.Reflection.Emit; - using Spring.Util; using Spring.Proxy; #endregion --- 23,31 ---- using System; using System.Collections; using System.Reflection.Emit; using Spring.Proxy; + #endregion *************** *** 42,45 **** --- 41,68 ---- AbstractProxyTypeBuilder, IAopProxyTypeGenerator { + #region Fields + + private readonly IList _typeAttributesToExclude; + + #endregion + + #region Constructors + + /// <summary> + /// Initializes a new instance of the <see cref="AbstractAopProxyTypeBuilder"/> class. + /// </summary> + protected AbstractAopProxyTypeBuilder() + : base() + { + _typeAttributesToExclude = new ArrayList( + new Type[] {typeof (SerializableAttribute)}); + foreach (Type attributeType in base.TypeAttributesToExclude) + { + _typeAttributesToExclude.Add(attributeType); + } + } + + #endregion + #region IProxyTypeGenerator Members *************** *** 101,104 **** --- 124,141 ---- return attrs; } + + + #endregion + + #region Protected Properties + + /// <summary> + /// Gets the type of attributes to exclude form the proxy + /// </summary> + /// <value>The type of attributes to exclude from the proxy</value> + protected override IList TypeAttributesToExclude + { + get { return _typeAttributesToExclude; } + } #endregion |
From: Mark P. <mar...@us...> - 2007-10-11 04:41:06
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Generic In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27700/Generic Modified Files: AdoTemplate.cs Log Message: SPRNET-749 - AdoTempate's QueryCallback did not property extract return or output values from stored procedure. SPRNET-746 - StoredProcedure class doesn't return sproc return value in result dictionary (changed return value key to be "RETURN_VALUE") Index: AdoTemplate.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Generic/AdoTemplate.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** AdoTemplate.cs 6 Aug 2007 20:13:39 -0000 1.14 --- AdoTemplate.cs 11 Oct 2007 04:41:00 -0000 1.15 *************** *** 1051,1056 **** returnValue = resultSetExtractorDelegate(reader); } - - ParameterUtils.CopyParameters(parameters, command); return returnValue; } --- 1051,1054 ---- *************** *** 1058,1061 **** --- 1056,1060 ---- { AdoUtils.CloseReader(reader); + ParameterUtils.CopyParameters(parameters, command); } } |
From: Mark P. <mar...@us...> - 2007-10-11 04:41:06
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27700/Core Modified Files: AdoTemplate.cs Log Message: SPRNET-749 - AdoTempate's QueryCallback did not property extract return or output values from stored procedure. SPRNET-746 - StoredProcedure class doesn't return sproc return value in result dictionary (changed return value key to be "RETURN_VALUE") Index: AdoTemplate.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Core/AdoTemplate.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AdoTemplate.cs 9 Aug 2007 01:54:22 -0000 1.3 --- AdoTemplate.cs 11 Oct 2007 04:40:59 -0000 1.4 *************** *** 3103,3108 **** { returnValue = resultSetExtractorDelegate(reader); ! } ! ParameterUtils.CopyParameters(parameters, command); return returnValue; } --- 3103,3107 ---- { returnValue = resultSetExtractorDelegate(reader); ! } return returnValue; } *************** *** 3110,3113 **** --- 3109,3113 ---- { AdoUtils.CloseReader(reader); + ParameterUtils.CopyParameters(parameters, command); } } |
From: Mark P. <mar...@us...> - 2007-10-11 04:41:06
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27700/Support Modified Files: ParameterUtils.cs Log Message: SPRNET-749 - AdoTempate's QueryCallback did not property extract return or output values from stored procedure. SPRNET-746 - StoredProcedure class doesn't return sproc return value in result dictionary (changed return value key to be "RETURN_VALUE") Index: ParameterUtils.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Support/ParameterUtils.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ParameterUtils.cs 10 Oct 2007 16:57:41 -0000 1.11 --- ParameterUtils.cs 11 Oct 2007 04:41:00 -0000 1.12 *************** *** 68,73 **** #region Methods ! ! public static void CopyParameters(IDbCommand command, IDbParameters springParamCollection) { --- 68,78 ---- #region Methods ! ! ! /// <summary> ! /// Copies the parameters from IDbParameters to the parameter collection in IDbCommand ! /// </summary> ! /// <param name="command">The command.</param> ! /// <param name="springParamCollection">The spring param collection.</param> public static void CopyParameters(IDbCommand command, IDbParameters springParamCollection) { *************** *** 94,99 **** return returnParameters; } ! ! public static void CopyParameters(IDbParameters springParamCollection, IDbCommand command) --- 99,109 ---- return returnParameters; } ! ! ! /// <summary> ! /// Copies the parameters in IDbCommand to IDbParameters ! /// </summary> ! /// <param name="springParamCollection">The spring param collection.</param> ! /// <param name="command">The command.</param> public static void CopyParameters(IDbParameters springParamCollection, IDbCommand command) *************** *** 138,142 **** if (dbDataParameter.Direction == ParameterDirection.ReturnValue) { ! returnedParameters.Add("RETURN", dbDataParameter.Value); } count++; --- 148,152 ---- if (dbDataParameter.Direction == ParameterDirection.ReturnValue) { ! returnedParameters.Add("RETURN_VALUE", dbDataParameter.Value); } count++; |
From: Mark P. <mar...@us...> - 2007-10-11 01:29:53
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17498 Modified Files: AbstractCache.cs Log Message: docs for retry and logging aspects. mis code cleanup. Index: AbstractCache.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Caching/AbstractCache.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractCache.cs 27 Aug 2007 09:38:11 -0000 1.6 --- AbstractCache.cs 11 Oct 2007 01:29:49 -0000 1.7 *************** *** 33,39 **** --- 33,45 ---- public abstract class AbstractCache : ICache { + #region Fields + private bool _enforceTimeToLive = false; private TimeSpan _timeToLive = TimeSpan.Zero; + #endregion + + #region Properties + /// <summary> /// Gets/Set the Default time-to-live (TTL) for items inserted into this cache. *************** *** 57,60 **** --- 63,72 ---- } + #endregion + + #region ICache Implementation + + #region + /// <summary> /// Gets the number of items in the cache. *************** *** 76,79 **** --- 88,93 ---- public abstract ICollection Keys { get; } + + /// <summary> /// Retrieves an item from the cache. *************** *** 161,164 **** --- 175,184 ---- } + #endregion + + #endregion + + #region Methods + /// <summary> /// Actually does the cache implementation specific insert operation into the cache. *************** *** 177,180 **** --- 197,202 ---- /// </param> protected abstract void DoInsert(object key, object value, TimeSpan timeToLive); + + #endregion } } \ No newline at end of file |
From: Mark P. <mar...@us...> - 2007-10-11 01:29:50
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17472/Aspects/Exceptions Modified Files: ExceptionHandlerAdvice.cs Log Message: docs for retry and logging aspects. mis code cleanup. Index: ExceptionHandlerAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/ExceptionHandlerAdvice.cs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ExceptionHandlerAdvice.cs 10 Oct 2007 18:07:46 -0000 1.8 --- ExceptionHandlerAdvice.cs 11 Oct 2007 01:29:42 -0000 1.9 *************** *** 306,310 **** LogExceptionHandler handler = new LogExceptionHandler(parsedAdviceExpression.ExceptionNames); handler.ConstraintExpressionText = parsedAdviceExpression.ConstraintExpression; ! handler.ActionExpressionText = "#log.Debug(" + parsedAdviceExpression.ActionExpressionText + ")"; return handler; } --- 306,310 ---- LogExceptionHandler handler = new LogExceptionHandler(parsedAdviceExpression.ExceptionNames); handler.ConstraintExpressionText = parsedAdviceExpression.ConstraintExpression; ! handler.ActionExpressionText = "#log.Trace(" + parsedAdviceExpression.ActionExpressionText + ")"; return handler; } |
From: Mark P. <mar...@us...> - 2007-10-11 01:29:50
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Logging In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17472/Aspects/Logging Modified Files: SimpleLoggingAdvice.cs Log Message: docs for retry and logging aspects. mis code cleanup. Index: SimpleLoggingAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Logging/SimpleLoggingAdvice.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleLoggingAdvice.cs 10 Oct 2007 17:10:50 -0000 1.3 --- SimpleLoggingAdvice.cs 11 Oct 2007 01:29:42 -0000 1.4 *************** *** 28,32 **** { /// <summary> ! /// This is /// </summary> /// <remarks> --- 28,32 ---- { /// <summary> ! /// Configurable advice for logging. /// </summary> /// <remarks> *************** *** 89,92 **** --- 89,94 ---- #endregion + #region Properties + /// <summary> /// Gets or sets a value indicating whether to log a unique identifier with the log message. *************** *** 139,143 **** } ! #region Protected Methods --- 141,145 ---- } ! #endregion #region Protected Methods |
From: Mark P. <mar...@us...> - 2007-10-11 01:29:50
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17472 Modified Files: Spring.Aop.2005.csproj Log Message: docs for retry and logging aspects. mis code cleanup. Index: Spring.Aop.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Spring.Aop.2005.csproj,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Spring.Aop.2005.csproj 10 Oct 2007 07:38:18 -0000 1.37 --- Spring.Aop.2005.csproj 11 Oct 2007 01:29:42 -0000 1.38 *************** *** 267,271 **** <SubType>Code</SubType> </Compile> - <Compile Include="Aop\ITargetTypeAware.cs" /> <Compile Include="Aop\IThrowsAdvice.cs"> <SubType>Code</SubType> --- 267,270 ---- |
From: Mark P. <mar...@us...> - 2007-10-11 01:29:40
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv17458 Modified Files: aop-aspect-library.xml Log Message: docs for retry and logging aspects. mis code cleanup. Index: aop-aspect-library.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/aop-aspect-library.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** aop-aspect-library.xml 9 Aug 2007 18:51:40 -0000 1.5 --- aop-aspect-library.xml 11 Oct 2007 01:29:35 -0000 1.6 *************** *** 9,16 **** popular of which is transactional advice, located in the Spring.Data module. However, the aspects that are documented in this section are those ! contained within the Spring.Aop module itself. At the moment this consists ! of Caching and Exception Handling advice. Other traditional advice types, ! logging, performance counters, validation, security, retry, and thread ! management, will be included in the future.</para> </sect1> --- 9,16 ---- popular of which is transactional advice, located in the Spring.Data module. However, the aspects that are documented in this section are those ! contained within the Spring.Aop module itself. The aspects in within ! Spring.Aop.dll are are Caching, Exception Handling, Logging, and Retry. ! Other traditional advice types such as validation, security, and thread ! management, will be included in a future release.</para> </sect1> *************** *** 25,30 **** calls to retrieve that information from a lower, and more slow, layer such as a database or a web service. Caching also can help in terms of ! application scalability, which is generally the more important concern. ! </para> <para>The caching support in Spring.NET consists of base cache interfaces --- 25,30 ---- calls to retrieve that information from a lower, and more slow, layer such as a database or a web service. Caching also can help in terms of ! application scalability, which is generally the more important ! concern.</para> <para>The caching support in Spring.NET consists of base cache interfaces *************** *** 41,46 **** <classname>Spring.Caching.NonExpiringCache</classname> that stores cache entries in memory and never expires these entries. Custom implementation ! based on 3rd party implementations, such as Oracle Coherence, can be used ! by implementing the <literal>ICache</literal> interface.</para> <para>The cache aspect is --- 41,47 ---- <classname>Spring.Caching.NonExpiringCache</classname> that stores cache entries in memory and never expires these entries. Custom implementation ! based on 3rd party implementations, such as Oracle Coherence, or ! memcached, can be used by implementing the <literal>ICache</literal> ! interface.</para> <para>The cache aspect is *************** *** 52,58 **** like the transactional aspect. Future versions will allow for external configuration of the behavior so you can apply caching to a code base ! without needing to use attributes in the code. </para> ! <para>The following attributes are available </para> <itemizedlist> --- 53,59 ---- like the transactional aspect. Future versions will allow for external configuration of the behavior so you can apply caching to a code base ! without needing to use attributes in the code.</para> ! <para>The following attributes are available</para> <itemizedlist> *************** *** 74,83 **** <listitem> <para><literal>InvalidateCache</literal> - used to indicate one or ! more cache items should be invalidated. </para> </listitem> </itemizedlist> ! <para>Each CacheResult, CacheResultItems, and CacheParameter attributes ! define the following properties.</para> <itemizedlist> --- 75,86 ---- <listitem> <para><literal>InvalidateCache</literal> - used to indicate one or ! more cache items should be invalidated.</para> </listitem> </itemizedlist> ! <para>Each <classname>CacheResult</classname>, ! <classname>CacheResultItems</classname>, and ! <classname>CacheParameter</classname> attributes define the following ! properties.</para> <itemizedlist> *************** *** 103,107 **** --- 106,121 ---- should remain in the cache (in seconds).</para> </listitem> + </itemizedlist> + + <para>The <classname>InvalidateCache</classname> attribute has properties + for the CacheName, the Key as well as the Condition, with the same + meanings as listed previously.</para> + + <para>Each <classname>ICache</classname> implementation will have + properties that are specific to a caching technology. In the case of + <classname>AspNetCache</classname>, the two important properties to + configure are:</para> + <itemizedlist> <listitem> <para><literal>SlidingExperation</literal> - If this property value is *************** *** 115,118 **** --- 129,137 ---- cache when the cache is being purged.</para> </listitem> + + <listitem> + <para><literal>TimeToLive</literal> - The amount of time an object + should remain in the cache (in seconds).</para> + </listitem> </itemizedlist> *************** *** 141,148 **** </itemizedlist> - <para>The invalidateCache attribute has properties for the CacheName, the - Key as well as the Condition, with the same meanings as listed - previously.</para> - <para>An important element of the applying these attributes is the use of the expression language that allows for calling context information to --- 160,163 ---- *************** *** 151,155 **** interface with the method GetAirport(long id).</para> ! <programlisting> [CacheResult("AspNetCache", "'Airport.Id=' + #id", TimeToLive = 60, SlidingExpiration = true, Priority = CachePriority.Low)] public Airport GetAirport(long id) { --- 166,170 ---- interface with the method GetAirport(long id).</para> ! <programlisting> [CacheResult("AspNetCache", "'Airport.Id=' + #id", TimeToLive = 60)] public Airport GetAirport(long id) { *************** *** 158,173 **** </programlisting> ! <para>The key used to cache the airport is a string expression that ! incorporates the argument passed into the method, the id. The method ! parameter names are exposed as variables to the key expression. If you do ! not specify a key, then all the parameter values will be used to cache the ! returned value. The expression may also call out to other objects in the ! spring container allowing for a more complex key algorithm to be ! encapsulated.</para> <para>The configuration to enable the caching aspect is shown below</para> <programlisting> <object id="CacheAspect" type="Spring.Aspects.Cache.CacheAspect, Spring.Aop"/> ! <object id="AspNetCache" type="Spring.Caching.AspNetCache, Spring.Web"/> --- 173,195 ---- </programlisting> ! <para>The first parameter is the cache name. The second string parameter ! is the cache key and is a string expression that incorporates the argument ! passed into the method, the id. The method parameter names are exposed as ! variables to the key expression. If you do not specify a key, then all the ! parameter values will be used to cache the returned value. The expression ! may also call out to other objects in the spring container allowing for a ! more complex key algorithm to be encapsulated. The end result is that the ! Airport object is cached by id for 60 seconds in a cache named ! AspNetCache. The TimetoLive property could also havfe been specified on ! the configuration of the AspNetCache object.</para> <para>The configuration to enable the caching aspect is shown below</para> <programlisting> <object id="CacheAspect" type="Spring.Aspects.Cache.CacheAspect, Spring.Aop"/> ! <object id="AspNetCache" type="Spring.Caching.AspNetCache, Spring.Web"> ! <property name="SlidingExpiration" value="true"/> ! <property name="Priority" value="CachePriority.Low"/> ! <property name="TimeToLive" value="120"/> ! </object> *************** *** 187,193 **** <para>in this example an ObjectNameAutoProxyCreator was used to apply this ! the cache aspect to objects that have Dao in their name, </para> ! <para> </para> </sect1> --- 209,215 ---- <para>in this example an ObjectNameAutoProxyCreator was used to apply this ! the cache aspect to objects that have Dao in their name,</para> ! <para></para> </sect1> *************** *** 233,237 **** <property name="exceptionHandlers"> <list> ! <value><emphasis role="bold">on ArithmeticException wrap System.InvalidOperationException</emphasis></value> </list> </property> --- 255,259 ---- <property name="exceptionHandlers"> <list> ! <value><emphasis role="bold">on exception name ArithmeticException wrap System.InvalidOperationException</emphasis></value> </list> </property> *************** *** 243,256 **** the message used in the newly thrown exception as shown below</para> ! <programlisting>on ArithmeticException wrap System.InvalidOperationException 'My Message'</programlisting> <para>Similarly, if you would rather replace the exception, that is do not nest one inside the other, you can use the following syntax</para> ! <programlisting>on ArithmeticException replace System.InvalidOperationException or ! on ArithmeticException replace System.InvalidOperationException 'My Message'</programlisting> <para>Both wrap and replace are special cases of the more general --- 265,278 ---- the message used in the newly thrown exception as shown below</para> ! <programlisting>on exception name ArithmeticException wrap System.InvalidOperationException 'My Message'</programlisting> <para>Similarly, if you would rather replace the exception, that is do not nest one inside the other, you can use the following syntax</para> ! <programlisting>on exception name ArithmeticException replace System.InvalidOperationException or ! on exception name ArithmeticException replace System.InvalidOperationException 'My Message'</programlisting> <para>Both wrap and replace are special cases of the more general *************** *** 258,262 **** below</para> ! <para><programlisting>on ArithmeticException translate new System.InvalidOperationException('My Message, Method Name ' + #method.Name, #e)</programlisting>What we see here after the translate keyword is text that will be passed into Spring's expression language (SpEL) for evaluation. Refer to the chapter --- 280,284 ---- below</para> ! <para><programlisting>on exception name ArithmeticException translate new System.InvalidOperationException('My Message, Method Name ' + #method.Name, #e)</programlisting>What we see here after the translate keyword is text that will be passed into Spring's expression language (SpEL) for evaluation. Refer to the chapter *************** *** 295,299 **** specific return value, for example</para> ! <programlisting>on ArithmeticException swallow --- 317,321 ---- specific return value, for example</para> ! <programlisting>on exception name ArithmeticException swallow *************** *** 301,316 **** ! on ArithmeticException return 12</programlisting> <para>You may also simply log the exception</para> ! <programlisting>on ArithmeticException log 'My Message, Method Name ' + #method.Name</programlisting> ! <para>Logging is performed using Commons.Logging that provides an ! abstraction over the underlying logging implementation. Logging is ! currently at the debug level with a logger name of "LogExceptionHandler" ! The ability to specify these values will be a future enhancement and ! likely via a syntax resembling a constructor for the action, i.e. ! log(Debug,"LoggerName").</para> <para>Multiple exception handling statements can be specified within the --- 323,341 ---- ! on exception name ArithmeticException return 12</programlisting> <para>You may also simply log the exception</para> ! <programlisting>on exception name ArithmeticException,ArgumentException log 'My Message, Method Name ' + #method.Name</programlisting> ! <para>Here we see that a comma delimited list of exception names can be ! specified.</para> ! ! <para>The logging is performed using the Commons.Logging library that ! provides an abstraction over the underlying logging implementation. ! Logging is currently at the debug level with a logger name of ! "LogExceptionHandler" The ability to specify these values will be a future ! enhancement and likely via a syntax resembling a constructor for the ! action, i.e. log(Debug,"LoggerName").</para> <para>Multiple exception handling statements can be specified within the *************** *** 329,342 **** which is then thrown.</para> <para>While the examples given above are toy examples, they could just as ! easily be changed to convert your application specific exceptions.</para> <sect2> ! <title>Reference</title> <para>The general syntax of the language is</para> ! <para>on [ExceptionName1,ExceptionName2,...] [action] [SpEL ! expression]</para> <para>The exception names are requires as well as the action. The valid --- 354,392 ---- which is then thrown.</para> + <para>The exception handling DSL also supports the the ability to provide + a SpEL boolean expression to determine if the advice will apply instead of + just filtering by the expression name. For example, the following is the + equivalent to the first example based on exception names but compares the + specific type of the exception thrown</para> + + <programlisting><emphasis role="bold">on exception (#e is T(System.ArithmeticException))</emphasis> wrap System.InvalidOperationException</programlisting> + + <para>The syntax use is 'on exception (SpEL boolean expression)' and + inside the expression you have access to the variables of the calling + context listed before, i.e. method, args, target, and e. This can be + useful to implement a small amount of conditional logic, such as checking + for a specific error number in an exception, i.e. <literal>(#e is + T(System.Data.SqlException) && #e.Errors[0].Number in + {156,170,207,208})</literal>, to catch and translate bad grammer codes in + a SqlException.</para> + <para>While the examples given above are toy examples, they could just as ! easily be changed to convert your application specific exceptions. If you ! find yourself pushing the limits of using SpEL expressions, you will ! likely be better off creating your own custom aspect class instead of a ! scripting approach.</para> <sect2> ! <title>Language Reference</title> <para>The general syntax of the language is</para> ! <para><literal>on exception name [ExceptionName1,ExceptionName2,...] ! [action] [SpEL expression]</literal></para> ! ! <para>or</para> ! ! <para><literal>on exception (SpEL boolean expression) [action] [SpEL ! expression]</literal></para> <para>The exception names are requires as well as the action. The valid *************** *** 384,387 **** --- 434,604 ---- <sect1> + <title>Logging</title> + + <para>The logging advice lets you log the information on method entry, + exit and thrown exception (if any). The implementation is based on the + logging library, <link linkend="???">Common.Logging</link>, that provides + portability across different logging libraries. There are a number of + configuration options available, listed below</para> + + <itemizedlist> + <listitem> + <para>LogUniqueIdentifier</para> + </listitem> + + <listitem> + <para>LogExecutionTime</para> + </listitem> + + <listitem> + <para>LogMethodArguments</para> + </listitem> + + <listitem> + <para>Separator</para> + </listitem> + + <listitem> + <para>LogLevel</para> + </listitem> + </itemizedlist> + + <para>You declare the logging advice in IoC container with the following + XML fragment. Alternatively, you can use the class + <classname>SimpleLoggingAdvice</classname> progammatically. </para> + + <programlisting><object name="exceptionHandlingAdvice" type="Spring.Aspects.Logging.SimpleLoggingAdvice, Spring.Aop"> + <property name="logUniqueIdentifier" value="true"/> + <property name="logExecutionTime" value="true"/> + <property name="logMethodArguments" value="true"/> + <property name="Separator" value=";"/> + <property name="LogLevel" value="LogLevel.Debug"/> + </object></programlisting> + + <para>The default values for LogUniqueIdentifier, LogExecutionTime, and + LogMethodArguments are false. The default separator value is ", " and the + default log level is Common.Logging's LogLevel.Trace. </para> + + <para>You can subclass SimpleLoggingAdvice and override the methods + </para> + + <itemizedlist> + <listitem> + <para><literal>string GetEntryMessage(IMethodInvocation invocation, + string idString)</literal></para> + </listitem> + + <listitem> + <para><literal>string GetExceptionMessage(IMethodInvocation + invocation, Exception e, TimeSpan executionTimeSpan, string + idString)</literal></para> + </listitem> + + <listitem> + <para><literal>string GetExitMessage(IMethodInvocation invocation, + object returnValue, TimeSpan executionTimeSpan, string + idString)</literal></para> + </listitem> + </itemizedlist> + + <para>The default implementation to calculate a unique identifer is to use + a Guid. You can alter this behavior by overriding the method + <literal>string CreateUniqueIdentifier()</literal>.</para> + </sect1> + + <sect1> + <title>Retry</title> + + <para>When making a distributed call it is oftena common requirement to be + able to retry the method invocation if there was an exception. Typically + the exception will be due to a communication issue that is intermitent and + a retrying over a period of time will likely result in a successful + invocation. When applying retry advice it is important to know if making + two calls to the remote service will cause side effects. Genreally + speaking, the method being invoked should be <ulink + url="http://en.wikipedia.org/wiki/Idempotent#Computer_Science">idempotent</ulink>, + that is, it is safe to call multiple times.</para> + + <para>The retry advice is specified using a little language, i.e a DSL. A + simple example is shown below</para> + + <programlisting>on exception name ArithmeticException retry 3x delay 1s</programlisting> + + <para>The meaning is: when an exception that has 'ArithmeticException' in + its classname is thrown, retry the invocaiton up to 3 times and delay for + 1 second in between each retry event. </para> + + <para>You can also provide a SpEL (Spring Expression Language) expression + that calculates the time interval to sleep between each retry event. The + syntax for this is shown below</para> + + <programlisting>on exception name ArithmeticException retry 3x rate (1*#n + 0.5)</programlisting> + + <para>As with the exception handling advice, you may also specify a + boolean SpEL that must evaluate to true in order for the advice to apply. + For example</para> + + <programlisting>on exception (#e is T(System.ArithmeticException)) retry 3x delay 1s + + + on exception (#e is T(System.ArithmeticException)) retry 3x rate (1*#n + 0.5)</programlisting> + + <para>The time specified after the delay keyword is converted to a + TimeSpan object using Spring's TimeSpanConverter. This supports setting + the time as an integer + time unit. Time units are (d, h, m, s, ms) + representing (days, hours, minutes, seconds, and milliseconds). For + example; 1d = 1day, 5h = 5 hours etc. You can not specify a string such as + '1d 5h'. The value that is calculated from the expression after the rate + keyword is interpreted as a number of seconds. The power of using SpEL for + the rate expression is that you can easily specify some exponential retry + rate (a bigger delay for each retry attempt) or call out to a custom + function developed for this purpose. </para> + + <para>When using a SpEL expression for the filter condition or for the + rate expression, the following variable are available</para> + + <para><itemizedlist> + <listitem> + <para>method - the MethodInfo object corresponding to the method + that threw the exception</para> + </listitem> + + <listitem> + <para>args - the argument array to the method that threw the + exception, signature is object[]</para> + </listitem> + + <listitem> + <para>target - the AOP target object instance.</para> + </listitem> + + <listitem> + <para>e - the thrown exception</para> + </listitem> + </itemizedlist>You declare the advice in IoC container with the + following XML fragment. Alternatively, you can use the + <classname>RetryAdvice</classname> class progammatically. </para> + + <programlisting><object name="exceptionHandlingAdvice" type="Spring.Aspects.RetryAdvice, Spring.Aop"> + <property name="retryExpression" value="<emphasis role="bold">on exception name ArithmeticException retry 3x delay 1s</emphasis>"/> + </object></programlisting> + + <sect2> + <title>Language Reference</title> + + <para>The general syntax of the languae is</para> + + <para><literal>on exception name [ExceptionName1,ExceptionName2,...] + retry [number of times]x [delay|rate] [delay time|SpEL rate + expression]</literal></para> + + <para>or</para> + + <para><literal>on exception (SpEL boolean expression) retry [number of + times]x [delay|rate] [delay time|SpELrate expression]</literal></para> + </sect2> + </sect1> + + <sect1> <title>Transactions</title> |
From: Mark P. <mar...@us...> - 2007-10-10 21:03:06
|
Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Messaging.Nms/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11292 Modified Files: SimpleMessageListenerContainer.cs Log Message: SPRNET-724 - Spring.Messaging.NMS does not build in .NET 1.1 Index: SimpleMessageListenerContainer.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Messaging.Nms/src/Spring/Spring.Messaging.Nms/Messaging/Nms/Listener/SimpleMessageListenerContainer.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SimpleMessageListenerContainer.cs 2 Mar 2007 23:25:18 -0000 1.1 --- SimpleMessageListenerContainer.cs 10 Oct 2007 21:03:03 -0000 1.2 *************** *** 58,63 **** //TODO TaskExectuor abstraction would go here... ! SimpleMessageListener listener = new SimpleMessageListener(this, session); ! consumer.Listener += listener.OnMessage; return consumer; } --- 58,63 ---- //TODO TaskExectuor abstraction would go here... ! SimpleMessageListener listener = new SimpleMessageListener(this, session); ! consumer.Listener += new NMS.MessageListener(listener.OnMessage); return consumer; } |
From: Mark P. <mar...@us...> - 2007-10-10 20:59:34
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Integration.Tests/Data In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10001/Data Removed Files: MultiDelegatingDbProvider.cs Log Message: SPRNET-693 Add MultiDelegatingDbProvider to main distribution to support easy access to multiple databases selected at runtime. SPRNET-544 - Docs for Common.Logging point to netcommon sourceforge site instead of being repeated within spring documentation update MySql 1.0 provider version clean up using statements --- MultiDelegatingDbProvider.cs DELETED --- |
From: Mark P. <mar...@us...> - 2007-10-10 20:59:33
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Integration.Tests In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10001 Modified Files: Spring.Data.Integration.Tests.2005.csproj Log Message: SPRNET-693 Add MultiDelegatingDbProvider to main distribution to support easy access to multiple databases selected at runtime. SPRNET-544 - Docs for Common.Logging point to netcommon sourceforge site instead of being repeated within spring documentation update MySql 1.0 provider version clean up using statements Index: Spring.Data.Integration.Tests.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Data.Integration.Tests/Spring.Data.Integration.Tests.2005.csproj,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Spring.Data.Integration.Tests.2005.csproj 14 Sep 2007 15:45:51 -0000 1.23 --- Spring.Data.Integration.Tests.2005.csproj 10 Oct 2007 20:59:29 -0000 1.24 *************** *** 132,136 **** <Compile Include="Data\Generic\TestObjectRowMapper.cs" /> <Compile Include="Data\ITestCoordinator.cs" /> - <Compile Include="Data\MultiDelegatingDbProvider.cs" /> <Compile Include="Data\Objects\Generic\Vacation.cs" /> <Compile Include="Data\SimpleAccountManager.cs" /> --- 132,135 ---- |
From: Mark P. <mar...@us...> - 2007-10-10 20:59:27
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9979 Modified Files: Spring.Data.2005.csproj Log Message: SPRNET-693 Add MultiDelegatingDbProvider to main distribution to support easy access to multiple databases selected at runtime. SPRNET-544 - Docs for Common.Logging point to netcommon sourceforge site instead of being repeated within spring documentation update MySql 1.0 provider version clean up using statements Index: Spring.Data.2005.csproj =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Spring.Data.2005.csproj,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** Spring.Data.2005.csproj 14 Sep 2007 15:45:50 -0000 1.54 --- Spring.Data.2005.csproj 10 Oct 2007 20:59:23 -0000 1.55 *************** *** 137,140 **** --- 137,141 ---- <Compile Include="Data\CannotGetAdoConnectionException.cs" /> <Compile Include="Data\CommandSetterDelegate.cs" /> + <Compile Include="Data\Common\MultiDelegatingDbProvider.cs" /> <Compile Include="Data\Config\DatabaseNamespaceParser.cs" /> <Compile Include="Data\Core\AdoAccessor.cs" /> |
From: Mark P. <mar...@us...> - 2007-10-10 20:59:26
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9979/Data/Common Modified Files: DbProvider.cs dbproviders.xml Added Files: MultiDelegatingDbProvider.cs Log Message: SPRNET-693 Add MultiDelegatingDbProvider to main distribution to support easy access to multiple databases selected at runtime. SPRNET-544 - Docs for Common.Logging point to netcommon sourceforge site instead of being repeated within spring documentation update MySql 1.0 provider version clean up using statements --- NEW FILE: MultiDelegatingDbProvider.cs --- (This appears to be a binary file; contents omitted.) Index: DbProvider.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/DbProvider.cs,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DbProvider.cs 31 Jul 2007 03:48:15 -0000 1.10 --- DbProvider.cs 10 Oct 2007 20:59:22 -0000 1.11 *************** *** 21,27 **** using System; using System.Data; - using Spring.Core; using Spring.Expressions; - using Spring.Objects; using Spring.Util; --- 21,25 ---- *************** *** 33,36 **** --- 31,38 ---- private IDbMetadata dbMetadata; + /// <summary> + /// Initializes a new instance of the <see cref="DbProvider"/> class. + /// </summary> + /// <param name="dbMetadata">The db metadata.</param> public DbProvider(IDbMetadata dbMetadata) { Index: dbproviders.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Data/Data/Common/dbproviders.xml,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dbproviders.xml 21 Aug 2007 19:25:49 -0000 1.20 --- dbproviders.xml 10 Oct 2007 20:59:22 -0000 1.21 *************** *** 323,339 **** <constructor-arg name="dbMetaData"> <object type="Spring.Data.Common.DbMetadata"> ! <constructor-arg name="productName" value="MySQL, MySQL provider 1.0.7.30072" /> ! <constructor-arg name="assemblyName" value="MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="connectionType" value="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="commandType" value="MySql.Data.MySqlClient.MySqlCommand, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="parameterType" value="MySql.Data.MySqlClient.MySqlParameter, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="dataAdapterType" value="MySql.Data.MySqlClient.MySqlDataAdapter, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="commandBuilderType" value="MySql.Data.MySqlClient.MySqlCommandBuilder, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <constructor-arg name="commandBuilderDeriveParametersMethod" value="DeriveParameters"/> ! <constructor-arg name="parameterDbType" value="MySql.Data.MySqlClient.MySqlDbType, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <constructor-arg name="parameterDbTypeProperty" value="MySqlDbType"/> <constructor-arg name="parameterIsNullableProperty" value="IsNullable"/> <constructor-arg name="parameterNamePrefix" value="?"/> ! <constructor-arg name="exceptionType" value="MySql.Data.MySqlClient.MySqlException, MySql.Data, Version=1.0.7.30072, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <constructor-arg name="useParameterNamePrefixInParameterCollection" value="true"/> <constructor-arg name="bindByName" value="true"/> --- 323,339 ---- <constructor-arg name="dbMetaData"> <object type="Spring.Data.Common.DbMetadata"> ! <constructor-arg name="productName" value="MySQL, MySQL provider 1.0.10.1" /> ! <constructor-arg name="assemblyName" value="MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="connectionType" value="MySql.Data.MySqlClient.MySqlConnection, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="commandType" value="MySql.Data.MySqlClient.MySqlCommand, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="parameterType" value="MySql.Data.MySqlClient.MySqlParameter, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="dataAdapterType" value="MySql.Data.MySqlClient.MySqlDataAdapter, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> ! <constructor-arg name="commandBuilderType" value="MySql.Data.MySqlClient.MySqlCommandBuilder, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <constructor-arg name="commandBuilderDeriveParametersMethod" value="DeriveParameters"/> ! <constructor-arg name="parameterDbType" value="MySql.Data.MySqlClient.MySqlDbType, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <constructor-arg name="parameterDbTypeProperty" value="MySqlDbType"/> <constructor-arg name="parameterIsNullableProperty" value="IsNullable"/> <constructor-arg name="parameterNamePrefix" value="?"/> ! <constructor-arg name="exceptionType" value="MySql.Data.MySqlClient.MySqlException, MySql.Data, Version=1.0.10.1, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <constructor-arg name="useParameterNamePrefixInParameterCollection" value="true"/> <constructor-arg name="bindByName" value="true"/> |
From: Mark P. <mar...@us...> - 2007-10-10 20:59:18
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9957 Modified Files: dbprovider.xml logging.xml Log Message: SPRNET-693 Add MultiDelegatingDbProvider to main distribution to support easy access to multiple databases selected at runtime. SPRNET-544 - Docs for Common.Logging point to netcommon sourceforge site instead of being repeated within spring documentation update MySql 1.0 provider version clean up using statements Index: logging.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/logging.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** logging.xml 10 Oct 2007 19:13:01 -0000 1.3 --- logging.xml 10 Oct 2007 20:59:13 -0000 1.4 *************** *** 27,34 **** url="http://netcommon.sourceforge.net/doc-latest/reference/html/index.html">HTML</ulink> , <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/html/index.html">PDF</ulink>, and <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/htmlhelp/htmlhelp.chm">HTMLHelp</ulink> ! formats.</para> </section> </chapter> \ No newline at end of file --- 27,34 ---- url="http://netcommon.sourceforge.net/doc-latest/reference/html/index.html">HTML</ulink> , <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/pdf/commong-logging-reference.pdf">PDF</ulink>, and <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/htmlhelp/htmlhelp.chm">HTML ! Help</ulink> formats.</para> </section> </chapter> \ No newline at end of file Index: dbprovider.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/dbprovider.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** dbprovider.xml 10 Oct 2007 19:13:00 -0000 1.12 --- dbprovider.xml 10 Oct 2007 20:59:13 -0000 1.13 *************** *** 217,221 **** <para>This redirects any reference to an older version of the assembly ! MySql.Data to the version 1.0.10.1. </para> </section> --- 217,221 ---- <para>This redirects any reference to an older version of the assembly ! MySql.Data to the version 1.0.10.1.</para> </section> *************** *** 323,331 **** </objects></programlisting> ! <para>TODO: The second option is to use a custom schema specific to your ! database. The case of using SqlServer is shown below.</para> ! <programlisting></programlisting> </section> </chapter> \ No newline at end of file --- 323,352 ---- </objects></programlisting> + </section> ! <section> ! <title>MultiDelegatingDbProvider </title> ! <para>There are use-cases in which there will need to be a runtime ! selection of the database to connect to among many possible candidates. ! This is often the case when there is the same schema installed in separate ! databases for different clients. The ! <classname>MultiDelegatingDbProvider</classname> implements the ! <classname>IDbProvider</classname> interface and provides an abstraction ! to the multiple databases and can be used in DAO layer such that the DAO ! layer is unaware of the switching between databases. ! <classname>MultiDelegatingDbProvider</classname> does it job by looking ! into thread local storage under the key dbProviderName. In this storage ! location should be stored the name of the dbProvider that is to be used ! for processing the request. ! <classname>MultiDelegatingDbProvider</classname> is configured using the ! dictionary property <literal>TargetDbProviders</literal>. The key of this ! dictionary contains the name of a dbProvider and its value is a dbProvider ! object. During request processing, once you have determined which target ! dbProvider should be use, in this example database1Providername, you ! should execute the following code ! <literal>LogicalThreadContext.SetData("dbProviderName", ! "database1ProviderName")</literal> and then call the data access layer. ! </para> </section> </chapter> \ No newline at end of file |
From: Bruno B. <bb...@us...> - 2007-10-10 19:17:12
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv2337 Modified Files: AbstractObjectFactory.cs DefaultListableObjectFactory.cs Log Message: PropertyOverrideConfigurer on abstract object definition does not work [SPRNET-733] Index: AbstractObjectFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** AbstractObjectFactory.cs 7 Sep 2007 01:52:25 -0000 1.71 --- AbstractObjectFactory.cs 10 Oct 2007 19:17:07 -0000 1.72 *************** *** 561,565 **** } ! RootObjectDefinition rootDefinition = MergeObjectDefinitions(name, parentDefinition, childDefinition); return rootDefinition; } --- 561,566 ---- } ! RootObjectDefinition rootDefinition = CreateRootObjectDefinition(parentDefinition); ! rootDefinition.OverrideFrom(childDefinition); return rootDefinition; } *************** *** 570,574 **** } } ! /// <summary> /// Merges the object definitions. --- 571,575 ---- } } ! /* /// <summary> /// Merges the object definitions. *************** *** 585,589 **** return rootDefinition; } ! /// <summary> /// Creates the root object definition. --- 586,590 ---- return rootDefinition; } ! */ /// <summary> /// Creates the root object definition. *************** *** 635,639 **** public abstract IObjectDefinition GetObjectDefinition(string name, bool includeAncestors); - /// <summary> /// Gets the type for the given FactoryObject. --- 636,639 ---- *************** *** 686,690 **** return null; } - } --- 686,689 ---- *************** *** 918,922 **** } - /// <summary> /// Resolves the type of the object for the specified object definition resolving --- 917,920 ---- *************** *** 1047,1051 **** } - /// <summary> /// Determines whether the object with the given name matches the specified type. --- 1045,1048 ---- *************** *** 1370,1374 **** } - #endregion --- 1367,1370 ---- *************** *** 1421,1425 **** #region IObjectFactory Members - /// <summary> /// Is this object a singleton? --- 1417,1420 ---- *************** *** 1478,1482 **** } - /// <summary> /// Determines whether the specified object name is prototype. That is, will GetObject --- 1473,1476 ---- *************** *** 1527,1530 **** --- 1521,1525 ---- } } + /// <summary> /// Does this object factory contain an object with the given name? *************** *** 1819,1823 **** } - /// <summary> /// Determines whether the specified object name is currently in creation.. --- 1814,1817 ---- *************** *** 1850,1854 **** } - /// <summary> /// Add a new <see cref="Spring.Objects.Factory.Config.IObjectPostProcessor"/> --- 1844,1847 ---- *************** *** 1875,1879 **** hasDestructionAwareBeanPostProcessors = true; } - } --- 1868,1871 ---- Index: DefaultListableObjectFactory.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/DefaultListableObjectFactory.cs,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** DefaultListableObjectFactory.cs 27 Aug 2007 15:18:34 -0000 1.41 --- DefaultListableObjectFactory.cs 10 Oct 2007 19:17:07 -0000 1.42 *************** *** 263,267 **** return (rod.HasObjectType && checkedType.IsAssignableFrom(rod.ObjectType)); } ! /// <summary> /// Merges the object definitions. --- 263,267 ---- return (rod.HasObjectType && checkedType.IsAssignableFrom(rod.ObjectType)); } ! /* /// <summary> /// Merges the object definitions. *************** *** 278,282 **** return rootDefinition; } ! #endregion --- 278,282 ---- return rootDefinition; } ! */ #endregion |
From: Mark P. <mar...@us...> - 2007-10-10 19:13:09
|
Update of /cvsroot/springnet/Spring.Net/doc/reference/src In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv1032 Modified Files: dbprovider.xml logging.xml Log Message: SPRNET-667 - Update Common.Logging documentation to point to NetCommon sourceforge project web site. SPRNET-747 - Add description of how to do assembly redirects for database assemblies. Index: logging.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/logging.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** logging.xml 3 Jan 2007 12:49:29 -0000 1.2 --- logging.xml 10 Oct 2007 19:13:01 -0000 1.3 *************** *** 9,383 **** of indirection between logging calls made by Spring and the specific logging library used in your application (log4net, EntLib logging, NLog). ! Many other .NET projects have done a similar task. As such this library is ! to be moved out of the Spring project and into a more general open source ! project. Stay tuned for further information.</para> ! ! <para>This logging abstraction goes by the name 'Common.Logging' and is ! simply a more packaged version of the logging abstraction used inside the ! iBATIS project. Many thanks to them! The library is available for .NET ! 1.0, 1.1, and 2.0 with both debug and strongly signed assemblies.</para> ! ! <para>Spring ships with the base logging library, Common.Logging, that ! provides console and trace based loggers. The libraries are located under ! lib/logging. There are two enterprise logging implementations, one for ! log4net 1.2.9 and another for log4net 1.2.10. The need for two log4net ! versions is due to the fact that each is signed with a different strong ! key making assembly redirection impossible.</para> ! ! <para>Note that it is not the intention of this library to be a replacement for the many fine logging libraries that are out there. The ! API is incredibly minimal and will very likely stay that way. Only use ! this library if you truely need to support multiple logging APIs.</para> ! </section> ! ! <section id="logging-usage"> ! <title>Using Common.Logging API</title> ! ! <para>Usage of the Logging API is fairly simple. First you need to obtain ! a logger from the LogManager and call the appropriate logging ! method:</para> ! ! <programlisting>using Common.Logging; ! ... ! ILog log = LogManager.GetLogger(this.GetType()); ! log.Debug("hello world");</programlisting> ! ! <para>A logger instance provides the following methods for logging:</para> ! ! <programlisting>public interface ILog ! { ! void Debug( object message ); ! void Debug( object message, Exception exception ); ! void Error( object message ); ! void Error( object message, Exception exception ); ! void Fatal( object message ); ! void Fatal( object message, Exception exception ); ! void Info( object message ); ! void Info( object message, Exception exception ); ! void Warn( object message ); ! void Warn( object message, Exception exception ); ! ! bool IsDebugEnabled { get; } ! bool IsErrorEnabled { get; } ! bool IsFatalEnabled { get; } ! bool IsInfoEnabled { get; } ! bool IsWarnEnabled { get; } ! }</programlisting> ! ! <para>You can get a reference to an instance of an ILog using the ! LoggingManager class. Its API is shown below:</para> ! ! <programlisting>public sealed class LogManager ! { ! public static ILog GetLogger( Type type ) ... ! public static ILog GetLogger( string name ) ... ! ! public static ILoggerFactoryAdapter Adapter ... ! ! }</programlisting> ! ! <para>The Adapter property is used by the framework itself.</para> ! </section> ! ! <section id="logging-config"> ! <title>Configuring Logging</title> ! ! <para>There are 2 ways of configuring logging in your application - either ! declaratively or programmatically.</para> ! ! <section> ! <title>Declarative Configuration</title> ! ! <para>Logging configuration can be done declaratively in your ! app.config</para> ! ! <programlisting><configuration> ! <configSections> ! <sectionGroup name="common"> ! <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> ! </sectionGroup> ! </configSections> ! ! <common> ! <logging> ! <factoryAdapter type="Common.Logging.Simple.TraceLoggerFactoryAdapter, Common.Logging"> ! <arg key="level" value="DEBUG" /> ! <arg key="showLogName" value="true" /> ! <arg key="showDataTime" value="true" /> ! <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" /> ! </factoryAdapter> ! </logging> ! </common> ! </configuration></programlisting> ! ! <note> ! <para>The concrete set of <arg> elements you may specify depends ! on the FactoryAdapter being used.</para> ! </note> ! </section> ! ! <section> ! <title>Configuring Logging in your code</title> ! ! <para>You may manually configure logging by setting a ! LoggerFactoryAdapter in your code.</para> ! ! <programlisting>// create properties ! NameValueCollection properties = new NameValueCollection(); ! properties["showDateTime"] = "true"; ! ! // set Adapter ! Common.Logging.LogManager.Adapter = new Common.Logging.Simple.TraceLoggerFactoryAdapter(properties);</programlisting> ! ! <note> ! <para>The concrete set of properties you may specify depends on the ! FactoryAdapter being used.</para> ! </note> ! </section> ! </section> ! ! <section id="logging-adapters"> ! <title>Logging Adapters</title> ! ! <para>There are simple out-of-the-box implementations coming with ! Common.Logging itself. For connecting to log4net, separate adapters do ! exist.</para> ! ! <section> ! <title>NoOpLoggerFactoryAdapter</title> ! ! <para>This is the default FactoryAdapter if logging is not configured. ! It simply does nothing.</para> ! </section> ! ! <section> ! <title>ConsoleOutLoggerFactoryAdapter</title> ! ! <para>ConsoleOutLoggerFactoryAdapter uses Console.Out for logging ! output.</para> ! ! <table> ! <title>Configuration Properties</title> ! ! <tgroup cols="3"> ! <thead> ! <row> ! <entry>Key</entry> ! ! <entry>Possible Value(s)</entry> ! ! <entry>Description</entry> ! </row> ! </thead> ! ! <tbody> ! <row> ! <entry>level</entry> ! ! <entry>All Debug Info Warn Error Fatal Off</entry> ! ! <entry>Defines the global maximum level of logging.</entry> ! </row> ! ! <row> ! <entry>showDateTime</entry> ! ! <entry>true|false</entry> ! ! <entry>output timestamp?</entry> ! </row> ! ! <row> ! <entry>showLogName</entry> ! ! <entry>true|false</entry> ! ! <entry>output logger name?</entry> ! </row> ! ! <row> ! <entry>dateTimeFormat</entry> ! ! <entry>any formatstring accepted by DateTime.ToString()</entry> ! ! <entry>defines the format to be used for output the timestamp. ! If no format is specified DateTime.ToString() will be ! used.</entry> ! </row> ! </tbody> ! </tgroup> ! </table> ! </section> ! ! <section> ! <title>TraceLoggerFactoryAdapter</title> ! ! <para>TraceLoggerFactoryAdapter uses ! <classname>System.Diagnostics.Trace</classname> for logging output. For ! viewing it's output you can use any tool that is capable of capturing ! calls to Win32 <function>OutputDebugString()</function> - e.g. the tool ! "DebugView" from <ulink ! url="www.sysinternals.com">www.sysinternals.com</ulink>.</para> ! ! <table> ! <title>Configuration Properties</title> ! ! <tgroup cols="3"> ! <thead> ! <row> ! <entry>Key</entry> ! ! <entry>Possible Value(s)</entry> ! ! <entry>Description</entry> ! </row> ! </thead> ! ! <tbody> ! <row> ! <entry>level</entry> ! ! <entry>All Debug Info Warn Error Fatal Off</entry> ! ! <entry>Defines the global maximum level of logging.</entry> ! </row> ! ! <row> ! <entry>showDateTime</entry> ! ! <entry>true|false</entry> ! ! <entry>output timestamp?</entry> ! </row> ! ! <row> ! <entry>showLogName</entry> ! ! <entry>true|false</entry> ! ! <entry>output logger name?</entry> ! </row> ! ! <row> ! <entry>dateTimeFormat</entry> ! ! <entry>any formatstring accepted by DateTime.ToString()</entry> ! ! <entry>defines the format to be used for output the timestamp. ! If no format is specified DateTime.ToString() will be ! used.</entry> ! </row> ! </tbody> ! </tgroup> ! </table> ! </section> ! ! <section id="logging-adapters-log4net"> ! <title>Log4NetLoggerFactoryAdapter</title> ! ! <para>There are two implementations, both configured similarly.</para> ! ! <itemizedlist> ! <listitem> ! <para><package>Common.Logging.Log4Net</package></para> ! ! <para>is linked against log4net 1.2.10.0</para> ! </listitem> ! ! <listitem> ! <para><package>Common.Logging.Log4Net129</package></para> ! ! <para>is linked against log4net 1.2.9.0</para> ! </listitem> ! </itemizedlist> ! ! <para>The only difference is in the type specified to the factory ! adapter. Both Adapters accept the following configuration ! properties:</para> ! ! <table> ! <title>Configuration Properties</title> ! ! <tgroup cols="3"> ! <thead> ! <row> ! <entry>Key</entry> ! ! <entry>Possible Value(s)</entry> ! ! <entry>Description</entry> ! </row> ! </thead> ! ! <tbody> ! <row> ! <entry>configType</entry> ! ! <entry><para>FILE</para><para>FILE-WATCH</para><para>INLINE</para><para>EXTERNAL</para></entry> ! ! <entry><para>INLINE will simply call ! XmlConfigurator.Configure()</para><para>EXTERNAL expects log4net ! being configured somewhere else in your code and does nothing. ! </para><para>FILE, FILE-WATCH: see property "configFile" ! below.</para></entry> ! </row> ! ! <row> ! <entry>configFile</entry> ! ! <entry><path to your log4net.config file></entry> ! ! <entry>if configType is FILE or FILE-WATCH, the value of ! "configFile" is passed to XmlConfigurator.Configure (FileInfo) / ! ConfigureAndWatch(FileInfo) method.</entry> ! </row> ! </tbody> ! </tgroup> ! </table> ! ! <para>The example below will configure log4net 1.2.10.0 using the file ! <filename>log4net.config</filename> from your application's root ! directory by calling ! <function>XmlConfigurator.ConfigureAndWatch()</function>:</para> ! ! <programlisting> <common> ! <logging> ! <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4net"> ! <arg key="configType" value="FILE-WATCH" /> ! <arg key="configFile" value="~/log4net.config" /> ! </factoryAdapter> ! </logging> ! </common></programlisting> ! ! <para>For log4net 1.2.9, change the assembly name ! <package>Common.Logging.Log4Net129</package></para> ! </section> ! </section> ! ! <section id="logging-advanced"> ! <title>Advanced Logging Tasks</title> ! ! <section id="logging-advanced-customfactoryadapter"> ! <title>Implementing a custom FactoryAdapter</title> ! ! <para>f you want to plug in a new, yet unsupported logging library, you ! need to implement the ! <interfacename>Common.Logging.ILoggerFactoryAdapter</interfacename> ! interface.</para> ! ! <para><guilabel>Important:</guilabel> Any implementation ! <emphasis>must</emphasis> provide a public constructor accepting a ! <classname>NameValueCollection</classname> parameter as shown in the ! example below:<programlisting>public class MyLoggingFactoryAdapter : ILoggerFactoryAdapter ! { ! public MyLoggingFactoryAdapter(NameValueCollection properties) ! { ! // configure according to properties ! } ! public ILog GetLogger(Type type) { ... } ! public ILog GetLogger(string name) { ... } ! }</programlisting></para> ! </section> </section> </chapter> \ No newline at end of file --- 9,34 ---- of indirection between logging calls made by Spring and the specific logging library used in your application (log4net, EntLib logging, NLog). ! The library is available for .NET 1.0, 1.1, and 2.0 with both debug and ! strongly signed assemblies. Since this need is not specific to Spirng, the ! logging library was moved out of the Spring project and into a more ! general open source project called <ulink ! url="http://netcommon.sourceforge.net/">Common Infrastructure Libraries ! for .NET</ulink>. The logging abstraction within the project is known as ! Common.Logging. Note that it is not the intention of this library to be a replacement for the many fine logging libraries that are out there. The ! API is incredibly minimal and will very likely stay that way. Please note ! that this library is intended only for use where the paramount requirement ! is portability and you will generally be better served by using a specific ! logging implementation so that you can leverage its advanced features and ! extended APIs to your advantage. </para> ! <para>You can find online documentation on how to configure Common.Logging ! is available in <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/html/index.html">HTML</ulink> ! , <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/html/index.html">PDF</ulink>, ! and <ulink ! url="http://netcommon.sourceforge.net/doc-latest/reference/htmlhelp/htmlhelp.chm">HTMLHelp</ulink> ! formats.</para> </section> </chapter> \ No newline at end of file Index: dbprovider.xml =================================================================== RCS file: /cvsroot/springnet/Spring.Net/doc/reference/src/dbprovider.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dbprovider.xml 3 Oct 2007 14:38:35 -0000 1.11 --- dbprovider.xml 10 Oct 2007 19:13:00 -0000 1.12 *************** *** 132,136 **** <listitem> ! <para><code>MySql</code> - MySQL, MySQL provider 1.0.7.3007</para> </listitem> --- 132,136 ---- <listitem> ! <para><code>MySql</code> - MySQL, MySQL provider 1.0.10.1</para> </listitem> *************** *** 201,204 **** --- 201,221 ---- mechanism will eventually be replaced shorly with one based on custom configuration section in App.config/Web.config.</para> + + <para>it may happen that the version number of an assembly you have + downloaded is different than the one listed above. If it is a point + release, i.e. the API hasn't changed in anyway that is material to your + application, you should add an assembly redirect of the form shown + below.</para> + + <programlisting><dependentAssembly> + <assemblyIdentity name="MySql.Data" + publicKeyToken="c5687fc88969c44d" + culture="neutral"/> + <bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" + newVersion="1.0.10.1"/> + </dependentAssembly></programlisting> + + <para>This redirects any reference to an older version of the assembly + MySql.Data to the version 1.0.10.1. </para> </section> |
From: Mark P. <mar...@us...> - 2007-10-10 18:29:59
|
Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv15777 Modified Files: ExpressionEvaluatorTests.cs Log Message: SPRNET-740 - Add unit test, but disable it, regarding unicode support in SpEL. Index: ExpressionEvaluatorTests.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Expressions/ExpressionEvaluatorTests.cs,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** ExpressionEvaluatorTests.cs 7 Sep 2007 01:54:59 -0000 1.68 --- ExpressionEvaluatorTests.cs 10 Oct 2007 18:29:49 -0000 1.69 *************** *** 323,326 **** --- 323,332 ---- } + [Test] + [Ignore("Ignore until support unicode in SpEL. SPRNET-740")] + public void TestUnicode() + { + Assert.AreEqual("\u6f22\u5b57", ExpressionEvaluator.GetValue(null,"'\u6f22\u5b57'")); + } /// <summary> /// Tests string literals. |
From: Mark P. <mar...@us...> - 2007-10-10 18:11:55
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7959 Modified Files: CollectionValidator.cs Log Message: SPRNET-732 - CollectionValidator should allow validation of any IEnumerable type Index: CollectionValidator.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Validation/CollectionValidator.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CollectionValidator.cs 5 Mar 2007 21:41:02 -0000 1.3 --- CollectionValidator.cs 10 Oct 2007 18:10:17 -0000 1.4 *************** *** 147,153 **** } ! if (!(validationContext is ICollection)) { ! throw new ArgumentException("The type of the object for validation must be subtype of ICollection."); } --- 147,153 ---- } ! if (!(validationContext is IEnumerable)) { ! throw new ArgumentException("The type of the object for validation must be subtype of IEnumerable."); } *************** *** 156,162 **** if (EvaluateWhen(validationContext, contextParams)) { ! ICollection collectionToValidate = (validationContext is IDictionary ? ((IDictionary) validationContext).Values ! : (ICollection) validationContext); // decide whether to pass new validation errors collection --- 156,162 ---- if (EvaluateWhen(validationContext, contextParams)) { ! IEnumerable collectionToValidate = (validationContext is IDictionary ? ((IDictionary) validationContext).Values ! : (IEnumerable) validationContext); // decide whether to pass new validation errors collection |
From: Mark P. <mar...@us...> - 2007-10-10 18:07:55
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6782/Exceptions Modified Files: ExceptionHandlerAdvice.cs LogExceptionHandler.cs ReturnValueExceptionHandler.cs TranslationExceptionHandler.cs Removed Files: AbstractExceptionHandler.cs IExceptionHandler.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: ReturnValueExceptionHandler.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/ReturnValueExceptionHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReturnValueExceptionHandler.cs 2 Oct 2007 21:56:53 -0000 1.2 --- ReturnValueExceptionHandler.cs 10 Oct 2007 18:07:46 -0000 1.3 *************** *** 19,23 **** --- 19,25 ---- #endregion + using System; using System.Collections; + using Common.Logging; using Spring.Expressions; *************** *** 55,60 **** public override object HandleException(IDictionary callContextDictionary) { ! IExpression expression = Expression.Parse(ActionExpressionText); ! return expression.GetValue(null, callContextDictionary); } } --- 57,71 ---- public override object HandleException(IDictionary callContextDictionary) { ! object returnVal = null; ! try ! { ! IExpression expression = Expression.Parse(ActionExpressionText); ! returnVal = expression.GetValue(null, callContextDictionary); ! } ! catch (Exception e) ! { ! log.Warn("Was not able to evaluate action expression [" + ActionExpressionText + "]", e); ! } ! return returnVal; } } Index: TranslationExceptionHandler.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/TranslationExceptionHandler.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TranslationExceptionHandler.cs 2 Oct 2007 21:56:53 -0000 1.2 --- TranslationExceptionHandler.cs 10 Oct 2007 18:07:46 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- using System; using System.Collections; + using Common.Logging; using Spring.Expressions; *************** *** 55,60 **** public override object HandleException(IDictionary callContextDictionary) { ! IExpression expression = Expression.Parse(ActionExpressionText); ! object o = expression.GetValue(null, callContextDictionary); Exception translatedException = o as Exception; if (translatedException != null) --- 56,68 ---- public override object HandleException(IDictionary callContextDictionary) { ! object o = null; ! try { ! IExpression expression = Expression.Parse(ActionExpressionText); ! o = expression.GetValue(null, callContextDictionary); ! } ! catch (Exception e) ! { ! log.Warn("Was not able to evaluate action expression [" + ActionExpressionText + "]", e); ! } Exception translatedException = o as Exception; if (translatedException != null) Index: ExceptionHandlerAdvice.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/ExceptionHandlerAdvice.cs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ExceptionHandlerAdvice.cs 10 Oct 2007 07:38:17 -0000 1.7 --- ExceptionHandlerAdvice.cs 10 Oct 2007 18:07:46 -0000 1.8 *************** *** 156,159 **** --- 156,164 ---- object returnVal = InvokeHandlers(ex, invocation); + if (returnVal == null) + { + return null; + } + // if only logged if (returnVal.Equals("logged")) --- AbstractExceptionHandler.cs DELETED --- --- IExceptionHandler.cs DELETED --- Index: LogExceptionHandler.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/Exceptions/LogExceptionHandler.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** LogExceptionHandler.cs 2 Oct 2007 21:56:53 -0000 1.4 --- LogExceptionHandler.cs 10 Oct 2007 18:07:46 -0000 1.5 *************** *** 19,22 **** --- 19,23 ---- #endregion + using System; using System.Collections; using Common.Logging; *************** *** 73,80 **** ILog log = LogManager.GetLogger(logName); callContextDictionary.Add("log", log); ! IExpression expression = Expression.Parse(ActionExpressionText); ! expression.GetValue(null, callContextDictionary); ! ! return "logged"; } } --- 74,87 ---- ILog log = LogManager.GetLogger(logName); callContextDictionary.Add("log", log); ! try ! { ! IExpression expression = Expression.Parse(ActionExpressionText); ! expression.GetValue(null, callContextDictionary); ! } ! catch (Exception e) ! { ! log.Warn("Was not able to evaluate action expression [" + ActionExpressionText + "]", e); ! } ! return "logged"; } } |
From: Mark P. <mar...@us...> - 2007-10-10 18:07:49
|
Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv6782 Modified Files: AbstractExceptionHandler.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: AbstractExceptionHandler.cs =================================================================== RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Aop/Aspects/AbstractExceptionHandler.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AbstractExceptionHandler.cs 8 Oct 2007 22:05:16 -0000 1.1 --- AbstractExceptionHandler.cs 10 Oct 2007 18:07:46 -0000 1.2 *************** *** 21,25 **** using System; using System.Collections; - using System.Reflection; using Common.Logging; using Spring.Expressions; --- 21,24 ---- *************** *** 39,43 **** /// The logging instance /// </summary> ! protected readonly ILog log = LogManager.GetLogger(MethodInfo.GetCurrentMethod().DeclaringType); private IList sourceExceptionNames = new ArrayList(); --- 38,42 ---- /// The logging instance /// </summary> ! protected readonly ILog log; private IList sourceExceptionNames = new ArrayList(); *************** *** 154,162 **** } if (ConstraintExpressionText != null) ! { ! IExpression expression = Expression.Parse(ConstraintExpressionText); bool canProcess; try { canProcess = (bool) expression.GetValue(null, callContextDictionary); } catch (InvalidCastException e) --- 153,161 ---- } if (ConstraintExpressionText != null) ! { bool canProcess; try { + IExpression expression = Expression.Parse(ConstraintExpressionText); canProcess = (bool) expression.GetValue(null, callContextDictionary); } catch (InvalidCastException e) |