generified FactoryBeans and further Java 5 code style updates

This commit is contained in:
Juergen Hoeller
2009-02-25 00:34:22 +00:00
parent 555fa3b4c8
commit 160249c012
48 changed files with 346 additions and 335 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ import org.springframework.util.StringUtils;
* @author Rob Harrop
* @since 2.0
*/
public class MethodLocatingFactoryBean implements FactoryBean, BeanFactoryAware {
public class MethodLocatingFactoryBean implements FactoryBean<Method>, BeanFactoryAware {
private String targetBeanName;
@@ -78,11 +78,11 @@ public class MethodLocatingFactoryBean implements FactoryBean, BeanFactoryAware
}
public Object getObject() throws Exception {
public Method getObject() throws Exception {
return this.method;
}
public Class getObjectType() {
public Class<Method> getObjectType() {
return Method.class;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -38,7 +38,7 @@ import org.springframework.util.ClassUtils;
* @since 2.0
*/
public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
implements FactoryBean, BeanClassLoaderAware, InitializingBean {
implements FactoryBean<Object>, BeanClassLoaderAware, InitializingBean {
private Object target;
@@ -196,7 +196,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
return this.proxy;
}
public Class getObjectType() {
public Class<?> getObjectType() {
if (this.proxy != null) {
return this.proxy.getClass();
}

View File

@@ -89,7 +89,7 @@ import org.springframework.util.ObjectUtils;
* @see Advised
*/
public class ProxyFactoryBean extends ProxyCreatorSupport
implements FactoryBean, BeanClassLoaderAware, BeanFactoryAware {
implements FactoryBean<Object>, BeanClassLoaderAware, BeanFactoryAware {
/**
* This suffix in a value in an interceptor list indicates to expand globals.
@@ -256,7 +256,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
* a single one), the target bean type, or the TargetSource's target class.
* @see org.springframework.aop.TargetSource#getTargetClass
*/
public Class getObjectType() {
public Class<?> getObjectType() {
synchronized (this) {
if (this.singletonInstance != null) {
return this.singletonInstance.getClass();
@@ -448,7 +448,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
else {
// If we get here, we need to add a named interceptor.
// We must check if it's a singleton or prototype.
Object advice = null;
Object advice;
if (this.singleton || this.beanFactory.isSingleton(name)) {
// Add the real Advisor/Advice to the chain.
advice = this.beanFactory.getBean(name);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -49,7 +49,7 @@ import org.springframework.util.ClassUtils;
* @since 2.0
* @see #setProxyTargetClass
*/
public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean, BeanFactoryAware {
public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean<Object>, BeanFactoryAware {
/** The TargetSource that manages scoping */
private final SimpleBeanTargetSource scopedTargetSource = new SimpleBeanTargetSource();
@@ -117,7 +117,7 @@ public class ScopedProxyFactoryBean extends ProxyConfig implements FactoryBean,
return this.proxy;
}
public Class getObjectType() {
public Class<?> getObjectType() {
if (this.proxy != null) {
return this.proxy.getClass();
}