Polishing

This commit is contained in:
Juergen Hoeller 2018-07-04 15:07:17 +02:00
parent 094c9b8bd2
commit 5dc8b5de6d
7 changed files with 17 additions and 15 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -41,6 +41,7 @@ public class DefaultParameterNameDiscoverer extends PrioritizedParameterNameDisc
private static final boolean kotlinPresent = private static final boolean kotlinPresent =
ClassUtils.isPresent("kotlin.Unit", DefaultParameterNameDiscoverer.class.getClassLoader()); ClassUtils.isPresent("kotlin.Unit", DefaultParameterNameDiscoverer.class.getClassLoader());
public DefaultParameterNameDiscoverer() { public DefaultParameterNameDiscoverer() {
if (kotlinPresent) { if (kotlinPresent) {
addDiscoverer(new KotlinReflectionParameterNameDiscoverer()); addDiscoverer(new KotlinReflectionParameterNameDiscoverer());

View File

@ -25,9 +25,9 @@ import org.springframework.transaction.support.ResourceHolderSupport;
import org.springframework.util.Assert; import org.springframework.util.Assert;
/** /**
* Connection holder, wrapping a JDBC Connection. * Resource holder wrapping a JDBC {@link Connection}.
* {@link DataSourceTransactionManager} binds instances of this class * {@link DataSourceTransactionManager} binds instances of this class
* to the thread, for a specific DataSource. * to the thread, for a specific {@link javax.sql.DataSource}.
* *
* <p>Inherits rollback-only support for nested JDBC transactions * <p>Inherits rollback-only support for nested JDBC transactions
* and reference count functionality from the base class. * and reference count functionality from the base class.

View File

@ -38,9 +38,9 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ReflectionUtils; import org.springframework.util.ReflectionUtils;
/** /**
* JMS resource holder, wrapping a JMS Connection and a JMS Session. * Resource holder wrapping a JMS {@link Connection} and a JMS {@link Session}.
* JmsTransactionManager binds instances of this class to the thread, * {@link JmsTransactionManager} binds instances of this class to the thread,
* for a given JMS ConnectionFactory. * for a given JMS {@link ConnectionFactory}.
* *
* <p>Note: This is an SPI class, not intended to be used by applications. * <p>Note: This is an SPI class, not intended to be used by applications.
* *

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,7 +21,7 @@ import javax.jms.Session;
import org.springframework.jms.connection.JmsResourceHolder; import org.springframework.jms.connection.JmsResourceHolder;
/** /**
* JmsResourceHolder marker subclass that indicates local exposure, * {@link JmsResourceHolder} marker subclass that indicates local exposure,
* i.e. that does not indicate an externally managed transaction. * i.e. that does not indicate an externally managed transaction.
* *
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -203,7 +203,7 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
* @see org.springframework.jdbc.core.JdbcTemplate * @see org.springframework.jdbc.core.JdbcTemplate
*/ */
public void setDataSource(@Nullable DataSource dataSource) { public void setDataSource(@Nullable DataSource dataSource) {
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) { if (dataSource instanceof TransactionAwareDataSourceProxy) {
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions // If we got a TransactionAwareDataSourceProxy, we need to perform transactions
// for its underlying target DataSource, else data access code won't see // for its underlying target DataSource, else data access code won't see
// properly exposed transactions (i.e. transactions for the target DataSource). // properly exposed transactions (i.e. transactions for the target DataSource).

View File

@ -255,7 +255,7 @@ public class JpaTransactionManager extends AbstractPlatformTransactionManager
* @see org.springframework.jdbc.core.JdbcTemplate * @see org.springframework.jdbc.core.JdbcTemplate
*/ */
public void setDataSource(@Nullable DataSource dataSource) { public void setDataSource(@Nullable DataSource dataSource) {
if (dataSource != null && dataSource instanceof TransactionAwareDataSourceProxy) { if (dataSource instanceof TransactionAwareDataSourceProxy) {
// If we got a TransactionAwareDataSourceProxy, we need to perform transactions // If we got a TransactionAwareDataSourceProxy, we need to perform transactions
// for its underlying target DataSource, else data access code won't see // for its underlying target DataSource, else data access code won't see
// properly exposed transactions (i.e. transactions for the target DataSource). // properly exposed transactions (i.e. transactions for the target DataSource).

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2018 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -21,10 +21,9 @@ import javax.resource.cci.Connection;
import org.springframework.transaction.support.ResourceHolderSupport; import org.springframework.transaction.support.ResourceHolderSupport;
/** /**
* Connection holder, wrapping a CCI Connection. * Resource holder wrapping a CCI {@link Connection}.
* * {@link CciLocalTransactionManager} binds instances of this class to the thread,
* <p>CciLocalTransactionManager binds instances of this class * for a given {@link javax.resource.cci.ConnectionFactory}.
* to the thread, for a given ConnectionFactory.
* *
* <p>Note: This is an SPI class, not intended to be used by applications. * <p>Note: This is an SPI class, not intended to be used by applications.
* *
@ -38,10 +37,12 @@ public class ConnectionHolder extends ResourceHolderSupport {
private final Connection connection; private final Connection connection;
public ConnectionHolder(Connection connection) { public ConnectionHolder(Connection connection) {
this.connection = connection; this.connection = connection;
} }
public Connection getConnection() { public Connection getConnection() {
return this.connection; return this.connection;
} }