[DSRV-14] Upgrading Service Manager to support Spring 3.0.5-RELEASE

git-svn-id: http://scm.dspace.org/svn/repo/modules/dspace-services/trunk@6340 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2011-04-23 00:34:06 +00:00
parent 88bd2b6057
commit 26c0fe2eb5
2 changed files with 3 additions and 3 deletions

View File

@@ -79,7 +79,7 @@
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId> <artifactId>spring-context-support</artifactId>
<version>2.5.6</version> <version>3.0.5.RELEASE</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -113,7 +113,7 @@ public final class SpringServiceManager implements ServiceManagerSystem {
if (name == null if (name == null
&& bean == null) { && bean == null) {
try { try {
Map<String, Object> map = applicationContext.getBeansOfType(type); Map<String, T> map = applicationContext.getBeansOfType(type);
if (map.size() == 1) { if (map.size() == 1) {
// only return the bean if there is exactly one // only return the bean if there is exactly one
bean = (T) map.values().iterator().next(); bean = (T) map.values().iterator().next();
@@ -130,7 +130,7 @@ public final class SpringServiceManager implements ServiceManagerSystem {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> List<T> getServicesByType(Class<T> type) { public <T> List<T> getServicesByType(Class<T> type) {
ArrayList<T> l = new ArrayList<T>(); ArrayList<T> l = new ArrayList<T>();
Map<String, Object> beans; Map<String, T> beans;
try { try {
beans = applicationContext.getBeansOfType(type, true, true); beans = applicationContext.getBeansOfType(type, true, true);
l.addAll( (Collection<? extends T>) beans.values() ); l.addAll( (Collection<? extends T>) beans.values() );