polishing

This commit is contained in:
Juergen Hoeller 2011-11-11 09:57:34 +00:00
parent 0b078f2ff9
commit b21e1ee669
3 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2008 the original author or authors. * Copyright 2002-2011 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.
@ -19,7 +19,6 @@ package org.springframework.jdbc.datasource;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.sql.Connection; import java.sql.Connection;
import java.sql.SQLException; import java.sql.SQLException;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
@ -141,7 +140,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
} }
// Create Connection through invoking WSDataSource.getConnection(JDBCConnectionSpec) // Create Connection through invoking WSDataSource.getConnection(JDBCConnectionSpec)
return (Connection) ReflectionUtils.invokeJdbcMethod( return (Connection) ReflectionUtils.invokeJdbcMethod(
this.wsDataSourceGetConnectionMethod, getTargetDataSource(), new Object[] {connSpec}); this.wsDataSourceGetConnectionMethod, getTargetDataSource(), connSpec);
} }
/** /**
@ -162,16 +161,16 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
Object connSpec = ReflectionUtils.invokeJdbcMethod(this.newJdbcConnSpecMethod, null); Object connSpec = ReflectionUtils.invokeJdbcMethod(this.newJdbcConnSpecMethod, null);
if (isolationLevel != null) { if (isolationLevel != null) {
ReflectionUtils.invokeJdbcMethod(this.setTransactionIsolationMethod, connSpec, new Object[] {isolationLevel}); ReflectionUtils.invokeJdbcMethod(this.setTransactionIsolationMethod, connSpec, isolationLevel);
} }
if (readOnlyFlag != null) { if (readOnlyFlag != null) {
ReflectionUtils.invokeJdbcMethod(this.setReadOnlyMethod, connSpec, new Object[] {readOnlyFlag}); ReflectionUtils.invokeJdbcMethod(this.setReadOnlyMethod, connSpec, readOnlyFlag);
} }
// If the username is empty, we'll simply let the target DataSource // If the username is empty, we'll simply let the target DataSource
// use its default credentials. // use its default credentials.
if (StringUtils.hasLength(username)) { if (StringUtils.hasLength(username)) {
ReflectionUtils.invokeJdbcMethod(this.setUserNameMethod, connSpec, new Object[] {username}); ReflectionUtils.invokeJdbcMethod(this.setUserNameMethod, connSpec, username);
ReflectionUtils.invokeJdbcMethod(this.setPasswordMethod, connSpec, new Object[] {password}); ReflectionUtils.invokeJdbcMethod(this.setPasswordMethod, connSpec, password);
} }
return connSpec; return connSpec;
} }

View File

@ -396,7 +396,8 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
* <p>Default is "false", throwing an exception if a non-default isolation level * <p>Default is "false", throwing an exception if a non-default isolation level
* is specified for a transaction. Turn this flag on if affected resource adapters * is specified for a transaction. Turn this flag on if affected resource adapters
* check the thread-bound transaction context and apply the specified isolation * check the thread-bound transaction context and apply the specified isolation
* levels individually (e.g. through a IsolationLevelDataSourceRouter). * levels individually (e.g. through an IsolationLevelDataSourceAdapter).
* @see org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
* @see org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter * @see org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
*/ */
public void setAllowCustomIsolationLevels(boolean allowCustomIsolationLevels) { public void setAllowCustomIsolationLevels(boolean allowCustomIsolationLevels) {

View File

@ -44,14 +44,14 @@ public interface FlashMapManager {
* {@code Map<String, Object>} with "input" flash attributes if any. * {@code Map<String, Object>} with "input" flash attributes if any.
* @see org.springframework.web.servlet.support.RequestContextUtils#getInputFlashMap(HttpServletRequest) * @see org.springframework.web.servlet.support.RequestContextUtils#getInputFlashMap(HttpServletRequest)
*/ */
public static final String INPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".INPUT_FLASH_MAP"; String INPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".INPUT_FLASH_MAP";
/** /**
* Name of request attribute that holds the "output" {@link FlashMap} with * Name of request attribute that holds the "output" {@link FlashMap} with
* attributes to save for a subsequent request. * attributes to save for a subsequent request.
* @see org.springframework.web.servlet.support.RequestContextUtils#getOutputFlashMap(HttpServletRequest) * @see org.springframework.web.servlet.support.RequestContextUtils#getOutputFlashMap(HttpServletRequest)
*/ */
public static final String OUTPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".OUTPUT_FLASH_MAP"; String OUTPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".OUTPUT_FLASH_MAP";
/** /**
* Perform the following tasks unless the {@link #OUTPUT_FLASH_MAP_ATTRIBUTE} * Perform the following tasks unless the {@link #OUTPUT_FLASH_MAP_ATTRIBUTE}