Issue Details (XML | Word | Printable)

Key: SPRNET-405
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Goran Milosavljevic
Reporter: Erich Eichinger
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring.NET

ApplicationContext.ConfigureObject() doesn't process IApplicationContextAware, IMessageResolvable etc.?

Created: 28/Nov/06 01:06 PM   Updated: 08/May/07 06:28 PM   Resolved: 07/Feb/07 08:07 PM
Component/s: Spring-NET-CORE
Affects Version/s: 1.1 P3
Fix Version/s: 1.1 M1

Time Tracking:
Not Specified


 Description  « Hide
At least in my Test-Web, ApplicationContext property on IApplicationContextAware controls doesn't get set if they are run through ConfigureObject()

Bruno Baia added a comment - 05/Dec/06 07:25 AM
I've added autowire support to the ConfigureObject.

ConfigureObject was calling ApplyObjectPropertyValues that does this :

RootObjectDefinition definition = GetMergedObjectDefinition(name, true);
if (definition != null)
{
   log.Debug(string.Format("configuring object '{0}' using definition '{1}'", instance, name));
   ApplyPropertyValues(name, definition, new ObjectWrapper(instance), definition.PropertyValues);
}

I've changed ConfigureObject to call PopulateObject instead, PopulateObject will call ApplyPropertyValues after autowiring and dependy checks :
RootObjectDefinition definition = GetMergedObjectDefinition(name, true);
if (definition != null)
{
    log.Debug(string.Format("configuring object '{0}' using definition '{1}'", target, name));
    PopulateObject(name, definition, new ObjectWrapper(target));
}

I didn't looked for applying IApplicationContextAware, IObjectNameAware, etc...

Bruno