fixed webcontrol object naming compatibility issue
fixed factory product caching
This commit is contained in:
@@ -836,7 +836,7 @@ namespace Spring.Objects.Factory.Support
|
||||
|
||||
if (factory.IsSingleton && ContainsSingleton(canonicalName))
|
||||
{
|
||||
lock (factoryObjectProductCache)
|
||||
lock (factoryObjectProductCache.SyncRoot)
|
||||
{
|
||||
resultInstance = factoryObjectProductCache[canonicalName];
|
||||
if (resultInstance == null)
|
||||
@@ -844,14 +844,15 @@ namespace Spring.Objects.Factory.Support
|
||||
resultInstance = GetObjectFromFactoryObject(factory, canonicalName, rod);
|
||||
if (resultInstance != null)
|
||||
{
|
||||
factoryObjectProductCache.Add(canonicalName, resultInstance);
|
||||
factoryObjectProductCache[canonicalName] = resultInstance;
|
||||
}
|
||||
return resultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resultInstance = GetObjectFromFactoryObject(factory, canonicalName, rod);
|
||||
else
|
||||
{
|
||||
resultInstance = GetObjectFromFactoryObject(factory, canonicalName, rod);
|
||||
}
|
||||
|
||||
if (resultInstance == null)
|
||||
{
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Spring.Objects.Factory.Xml
|
||||
objectName = webObjectNameGenerator.CreatePageDefinitionName(url);
|
||||
}
|
||||
|
||||
// adjust aliases if necessary
|
||||
// strip leading homepath symbol ('~') from aliases if necessary
|
||||
for (int ai = 0; ai < aliases.Count; ai++)
|
||||
{
|
||||
string alias = (string)aliases[ai];
|
||||
@@ -70,9 +70,14 @@ namespace Spring.Objects.Factory.Xml
|
||||
}
|
||||
else if (strTypeName.EndsWith(".ascx") || strTypeName.EndsWith(".master"))
|
||||
{
|
||||
string controlName = webObjectNameGenerator.CreateControlDefinitionName(url);
|
||||
if (!StringUtils.HasText(objectName))
|
||||
{
|
||||
objectName = webObjectNameGenerator.CreateControlDefinitionName(url);
|
||||
objectName = controlName;
|
||||
}
|
||||
else
|
||||
{
|
||||
aliases.Add(controlName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user