Update of /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv24742
Modified Files:
AbstractObjectFactory.cs
Log Message:
IConfigurableFactoryObject instance cannot be proxied with the AOP auto proxy functionality [SPRNET-877]
Index: AbstractObjectFactory.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/src/Spring/Spring.Core/Objects/Factory/Support/AbstractObjectFactory.cs,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** AbstractObjectFactory.cs 5 Dec 2007 00:28:04 -0000 1.73
--- AbstractObjectFactory.cs 22 Feb 2008 15:28:36 -0000 1.74
***************
*** 759,784 ****
RootObjectDefinition rod =
(ContainsObjectDefinition(objectName) ? GetMergedObjectDefinition(objectName,true) : null);
! instance = GetObjectFromFactoryObject(factory,objectName, rod);
!
! if (factory is IConfigurableFactoryObject)
! {
! IConfigurableFactoryObject configurableFactory = (IConfigurableFactoryObject)factory;
!
! #region Instrumentation
!
! if (log.IsDebugEnabled)
! {
! log.Debug(string.Format("Factory object with name '{0}' is configurable.", TransformedObjectName(name)));
! }
!
! #endregion
!
! if (configurableFactory.ProductTemplate != null)
! {
! instance = ConfigureObject(instance,
! String.Format("{0}.ProductTemplate", name),
! configurableFactory.ProductTemplate);
! }
! }
if (instance == null)
--- 759,763 ----
RootObjectDefinition rod =
(ContainsObjectDefinition(objectName) ? GetMergedObjectDefinition(objectName,true) : null);
! instance = GetObjectFromFactoryObject(factory, objectName, rod);
if (instance == null)
***************
*** 838,844 ****
}
if (instance != null)
{
! try {
instance = PostProcessObjectFromFactoryObject(instance, objectName);
}
--- 817,845 ----
}
+ if (factory is IConfigurableFactoryObject)
+ {
+ IConfigurableFactoryObject configurableFactory = (IConfigurableFactoryObject)factory;
+
+ #region Instrumentation
+
+ if (log.IsDebugEnabled)
+ {
+ log.Debug(string.Format("Factory object with name '{0}' is configurable.", TransformedObjectName(objectName)));
+ }
+
+ #endregion
+
+ if (configurableFactory.ProductTemplate != null)
+ {
+ instance = ConfigureObject(instance,
+ String.Format("{0}.ProductTemplate", objectName),
+ configurableFactory.ProductTemplate);
+ }
+ }
+
if (instance != null)
{
! try
! {
instance = PostProcessObjectFromFactoryObject(instance, objectName);
}
|