generified FactoryBeans and further Java 5 code style updates
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 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.
|
||||
@@ -68,7 +68,7 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
* @see javax.resource.cci.Connection#getLocalTransaction
|
||||
* @see org.springframework.jca.cci.connection.CciLocalTransactionManager
|
||||
*/
|
||||
public class LocalConnectionFactoryBean implements FactoryBean, InitializingBean {
|
||||
public class LocalConnectionFactoryBean implements FactoryBean<Object>, InitializingBean {
|
||||
|
||||
private ManagedConnectionFactory managedConnectionFactory;
|
||||
|
||||
@@ -126,7 +126,7 @@ public class LocalConnectionFactoryBean implements FactoryBean, InitializingBean
|
||||
return this.connectionFactory;
|
||||
}
|
||||
|
||||
public Class getObjectType() {
|
||||
public Class<?> getObjectType() {
|
||||
return (this.connectionFactory != null ? this.connectionFactory.getClass() : null);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 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.
|
||||
@@ -48,7 +48,7 @@ import org.springframework.util.Assert;
|
||||
* @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
|
||||
* @see javax.resource.spi.ResourceAdapter#stop()
|
||||
*/
|
||||
public class ResourceAdapterFactoryBean implements FactoryBean, InitializingBean, DisposableBean {
|
||||
public class ResourceAdapterFactoryBean implements FactoryBean<ResourceAdapter>, InitializingBean, DisposableBean {
|
||||
|
||||
private ResourceAdapter resourceAdapter;
|
||||
|
||||
@@ -124,11 +124,11 @@ public class ResourceAdapterFactoryBean implements FactoryBean, InitializingBean
|
||||
}
|
||||
|
||||
|
||||
public Object getObject() {
|
||||
public ResourceAdapter getObject() {
|
||||
return this.resourceAdapter;
|
||||
}
|
||||
|
||||
public Class getObjectType() {
|
||||
public Class<? extends ResourceAdapter> getObjectType() {
|
||||
return (this.resourceAdapter != null ? this.resourceAdapter.getClass() : ResourceAdapter.class);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -103,7 +103,7 @@ import org.springframework.transaction.PlatformTransactionManager;
|
||||
* @see org.springframework.aop.framework.ProxyFactoryBean
|
||||
*/
|
||||
public class TransactionProxyFactoryBean extends AbstractSingletonProxyFactoryBean
|
||||
implements FactoryBean, BeanFactoryAware {
|
||||
implements BeanFactoryAware {
|
||||
|
||||
private final TransactionInterceptor transactionInterceptor = new TransactionInterceptor();
|
||||
|
||||
@@ -174,8 +174,7 @@ public class TransactionProxyFactoryBean extends AbstractSingletonProxyFactoryBe
|
||||
if (this.transactionInterceptor.getTransactionManager() == null &&
|
||||
beanFactory instanceof ListableBeanFactory) {
|
||||
ListableBeanFactory lbf = (ListableBeanFactory) beanFactory;
|
||||
PlatformTransactionManager ptm = (PlatformTransactionManager)
|
||||
BeanFactoryUtils.beanOfTypeIncludingAncestors(lbf, PlatformTransactionManager.class);
|
||||
PlatformTransactionManager ptm = BeanFactoryUtils.beanOfTypeIncludingAncestors(lbf, PlatformTransactionManager.class);
|
||||
this.transactionInterceptor.setTransactionManager(ptm);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user