improved comment

fixed AdvisorRetrievalHelper to also pick manually registered singleton advisors from the ObjectFactory
This commit is contained in:
eeichinger
2009-09-17 08:46:55 +00:00
parent 9058cb0ce7
commit 95ade89c08
2 changed files with 11 additions and 3 deletions

View File

@@ -244,11 +244,15 @@ namespace Spring.Aop.Framework.AutoProxy
}
/// <summary>
/// Extension hook that subclasses can override to register additional advisors,
/// Extension hook that subclasses can override to add additional advisors for the given object,
/// given the sorted advisors obtained to date.<br/>
/// The default implementation does nothing.<br/>
/// Typically used to add advisors that expose contextual information required by some of the later advisors.
/// </summary>
/// <remarks>
/// The advisor list passed into this method is already reduced to advisors applying to this particular object.
/// If you want to register additional common advisor candidates, override <see cref="FindCandidateAdvisors"/>.
/// </remarks>
/// <param name="advisors">Advisors that have already been identified as applying to a given object</param>
/// <param name="objectType">the type of the object to be advised</param>
/// <param name="objectName">the name of the object to be advised</param>

View File

@@ -165,8 +165,12 @@ namespace Spring.Aop.Framework.AutoProxy
/// <param name="objectName">the name of the object to be advised</param>
protected virtual bool IsEligibleObject(string advisorName, Type objectType, string objectName )
{
return this.ObjectFactory.ContainsObjectDefinition(advisorName)
&& this.ObjectFactory.GetObjectDefinition(advisorName).Role != ObjectRole.ROLE_INFRASTRUCTURE;
bool containsObjectDefinition = this.ObjectFactory.ContainsObjectDefinition(advisorName);
if (containsObjectDefinition)
{
return this.ObjectFactory.GetObjectDefinition(advisorName).Role != ObjectRole.ROLE_INFRASTRUCTURE;
}
return this.ObjectFactory.ContainsObject(advisorName);
}
}
}