generified FactoryBeans and further Java 5 code style updates
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user