mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-19 07:53:08 +00:00
[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:
@@ -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>
|
||||||
|
@@ -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() );
|
||||||
|
Reference in New Issue
Block a user