The collection framework has Synchronization Wrappers that help create synchronized lists.
List list = Collections.synchronizedList(new ArrayList());
I am trying to create the list from the spring xml file. Following works fine for a simple List.
<bean id="listt" class="java.util.ArrayList"/>
Is there anyway i can directly create a synchronizedList from within the xml file?
You can construct using
Collections.synchronizedListas a static factory method: