[jboss-cvs] JBossAS SVN: r82252 - trunk/spring-int/src/main/org/jboss/spring/facade.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 12 17:52:59 EST 2008
Author: alesj
Date: 2008-12-12 17:52:59 -0500 (Fri, 12 Dec 2008)
New Revision: 82252
Modified:
trunk/spring-int/src/main/org/jboss/spring/facade/ControllerBeanFactory.java
Log:
Synch on bean factory.
Modified: trunk/spring-int/src/main/org/jboss/spring/facade/ControllerBeanFactory.java
===================================================================
--- trunk/spring-int/src/main/org/jboss/spring/facade/ControllerBeanFactory.java 2008-12-12 22:45:29 UTC (rev 82251)
+++ trunk/spring-int/src/main/org/jboss/spring/facade/ControllerBeanFactory.java 2008-12-12 22:52:59 UTC (rev 82252)
@@ -115,22 +115,29 @@
return clazz.cast(result);
}
+ @SuppressWarnings({"SynchronizationOnLocalVariableOrMethodParameter"})
public Object getBean(String name, Object[] parameters) throws BeansException
{
AbstractBeanFactory result = getExactBean(name, AbstractBeanFactory.class);
ConstructorMetaData cmd = result.getConstructor();
+
BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder("Temp");
for (Object parameter : parameters )
builder.addConstructorParameter(null, parameter);
- result.setConstructor(builder.getBeanMetaData().getConstructor());
- try
+ ConstructorMetaData tempCMD = builder.getBeanMetaData().getConstructor();
+
+ synchronized (result)
{
- return createBean(result);
+ result.setConstructor(tempCMD);
+ try
+ {
+ return createBean(result);
+ }
+ finally
+ {
+ result.setConstructor(cmd);
+ }
}
- finally
- {
- result.setConstructor(cmd);
- }
}
public boolean containsBean(String name)
More information about the jboss-cvs-commits
mailing list