properties, contextRules, mutuallyExclusive);
// no advice method following the rules was found
if (cacheCollection == null || cacheCollection.isEmpty())
{
throw new NoMatchingAdviceException(properties, adviceType,
adviceMatchingMessage.toString());
}
synchronized(cacheCollection)
{
LinkedList<AdviceInfo> rankedAdvices =
new LinkedList<AdviceInfo>(cacheCollection);
// validate and retrive best match
AdviceInfo bestAdvice = bestValidAdvice(rankedAdvices, properties,
contextRules);
if (bestAdvice == null)
{
throw new NoMatchingAdviceException(properties, adviceType,
adviceMatchingMessage.toString());
}
// assign best Advice info to properties
bestAdvice.assignAdviceInfo(properties);
properties.setAdviceOverloaded(rankedAdvices.size() > 1);