Merge branch '1.5.x'
This commit is contained in:
@@ -740,10 +740,6 @@ content into your application; rather pick only the properties that you need.
|
||||
spring.jta.atomikos.datasource.unique-resource-name=dataSource # The unique name used to identify the resource during recovery.
|
||||
spring.jta.atomikos.properties.allow-sub-transactions=true # Specify if sub-transactions are allowed.
|
||||
spring.jta.atomikos.properties.checkpoint-interval=500 # Interval between checkpoints.
|
||||
spring.jta.atomikos.properties.console-file-count=1 # Number of debug logs files that can be created.
|
||||
spring.jta.atomikos.properties.console-file-limit=-1 # How many bytes can be stored at most in debug logs files.
|
||||
spring.jta.atomikos.properties.console-file-name=tm.out # Debug logs file name.
|
||||
spring.jta.atomikos.properties.console-log-level=warn # Console log level.
|
||||
spring.jta.atomikos.properties.default-jta-timeout=10000 # Default timeout for JTA transactions.
|
||||
spring.jta.atomikos.properties.enable-logging=true # Enable disk logging.
|
||||
spring.jta.atomikos.properties.force-shutdown-on-vm-exit=false # Specify if a VM shutdown should trigger forced shutdown of the transaction core.
|
||||
@@ -751,7 +747,6 @@ content into your application; rather pick only the properties that you need.
|
||||
spring.jta.atomikos.properties.log-base-name=tmlog # Transactions log file base name.
|
||||
spring.jta.atomikos.properties.max-actives=50 # Maximum number of active transactions.
|
||||
spring.jta.atomikos.properties.max-timeout=300000 # Maximum timeout (in milliseconds) that can be allowed for transactions.
|
||||
spring.jta.atomikos.properties.output-dir= # Directory in which to store the debug log files.
|
||||
spring.jta.atomikos.properties.recovery.delay=10000 # Delay between two recovery scans.
|
||||
spring.jta.atomikos.properties.recovery.forget-orphaned-log-entries-delay=86400000 # Delay after which recovery can cleanup pending ('orphaned') log entries.
|
||||
spring.jta.atomikos.properties.recovery.max-retries=5 # Number of retries attempts to commit the transaction before throwing an exception.
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012-2014 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.jta.atomikos;
|
||||
|
||||
/**
|
||||
* Logging levels supported by Atomikos.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
* @since 1.2.0
|
||||
* @see AtomikosProperties
|
||||
*/
|
||||
public enum AtomikosLoggingLevel {
|
||||
|
||||
/**
|
||||
* Debug Level.
|
||||
*/
|
||||
DEBUG,
|
||||
|
||||
/**
|
||||
* Info Level.
|
||||
*/
|
||||
INFO,
|
||||
|
||||
/**
|
||||
* Warning Level.
|
||||
*/
|
||||
WARN
|
||||
|
||||
}
|
||||
@@ -98,33 +98,6 @@ public class AtomikosProperties {
|
||||
*/
|
||||
private long checkpointInterval = 500;
|
||||
|
||||
/**
|
||||
* Console log level.
|
||||
*/
|
||||
private AtomikosLoggingLevel consoleLogLevel = AtomikosLoggingLevel.WARN;
|
||||
|
||||
/**
|
||||
* Directory in which to store the debug log files. Defaults to the current working
|
||||
* directory.
|
||||
*/
|
||||
private String outputDir;
|
||||
|
||||
/**
|
||||
* Debug logs file name.
|
||||
*/
|
||||
private String consoleFileName = "tm.out";
|
||||
|
||||
/**
|
||||
* Number of debug logs files that can be created.
|
||||
*/
|
||||
private int consoleFileCount = 1;
|
||||
|
||||
/**
|
||||
* How many bytes can be stored at most in debug logs files. Negative values means
|
||||
* unlimited.
|
||||
*/
|
||||
private int consoleFileLimit = -1;
|
||||
|
||||
/**
|
||||
* Use different (and concurrent) threads for two-phase commit on the participating
|
||||
* resources.
|
||||
@@ -306,68 +279,6 @@ public class AtomikosProperties {
|
||||
return this.checkpointInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the console log level. Defaults to {@link AtomikosLoggingLevel#WARN}.
|
||||
* @param consoleLogLevel the console log level
|
||||
*/
|
||||
public void setConsoleLogLevel(AtomikosLoggingLevel consoleLogLevel) {
|
||||
this.consoleLogLevel = consoleLogLevel;
|
||||
}
|
||||
|
||||
public AtomikosLoggingLevel getConsoleLogLevel() {
|
||||
return this.consoleLogLevel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the directory in which to store the debug log files. Defaults to the
|
||||
* current working directory.
|
||||
* @param outputDir the output dir
|
||||
*/
|
||||
public void setOutputDir(String outputDir) {
|
||||
this.outputDir = outputDir;
|
||||
}
|
||||
|
||||
public String getOutputDir() {
|
||||
return this.outputDir;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies the debug logs file name. Defaults to {@literal tm.out}.
|
||||
* @param consoleFileName the console file name
|
||||
*/
|
||||
public void setConsoleFileName(String consoleFileName) {
|
||||
this.consoleFileName = consoleFileName;
|
||||
}
|
||||
|
||||
public String getConsoleFileName() {
|
||||
return this.consoleFileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies how many debug logs files can be created. Defaults to {@literal 1}.
|
||||
* @param consoleFileCount the console file count
|
||||
*/
|
||||
public void setConsoleFileCount(int consoleFileCount) {
|
||||
this.consoleFileCount = consoleFileCount;
|
||||
}
|
||||
|
||||
public int getConsoleFileCount() {
|
||||
return this.consoleFileCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies how many bytes can be stored at most in debug logs files. Defaults to
|
||||
* {@literal -1}. Negative values means unlimited.
|
||||
* @param consoleFileLimit the console file limit
|
||||
*/
|
||||
public void setConsoleFileLimit(int consoleFileLimit) {
|
||||
this.consoleFileLimit = consoleFileLimit;
|
||||
}
|
||||
|
||||
public int getConsoleFileLimit() {
|
||||
return this.consoleFileLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether or not to use different (and concurrent) threads for two-phase
|
||||
* commit on the participating resources. Setting this to {@literal true} implies that
|
||||
@@ -408,11 +319,6 @@ public class AtomikosProperties {
|
||||
set(properties, "log_base_name", getLogBaseName());
|
||||
set(properties, "log_base_dir", getLogBaseDir());
|
||||
set(properties, "checkpoint_interval", getCheckpointInterval());
|
||||
set(properties, "console_log_level", getConsoleLogLevel());
|
||||
set(properties, "output_dir", getOutputDir());
|
||||
set(properties, "console_file_name", getConsoleFileName());
|
||||
set(properties, "console_file_count", getConsoleFileCount());
|
||||
set(properties, "console_file_limit", getConsoleFileLimit());
|
||||
set(properties, "threaded_2pc", isThreadedTwoPhaseCommit());
|
||||
Recovery recovery = getRecovery();
|
||||
set(properties, "forget_orphaned_log_entries_delay",
|
||||
|
||||
@@ -51,18 +51,13 @@ public class AtomikosPropertiesTests {
|
||||
this.properties.setLogBaseName("logBaseName");
|
||||
this.properties.setLogBaseDir("logBaseDir");
|
||||
this.properties.setCheckpointInterval(4);
|
||||
this.properties.setConsoleLogLevel(AtomikosLoggingLevel.WARN);
|
||||
this.properties.setOutputDir("outputDir");
|
||||
this.properties.setConsoleFileName("consoleFileName");
|
||||
this.properties.setConsoleFileCount(5);
|
||||
this.properties.setConsoleFileLimit(6);
|
||||
this.properties.setThreadedTwoPhaseCommit(true);
|
||||
this.properties.getRecovery().setForgetOrphanedLogEntriesDelay(2000);
|
||||
this.properties.getRecovery().setDelay(3000);
|
||||
this.properties.getRecovery().setMaxRetries(10);
|
||||
this.properties.getRecovery().setRetryInterval(4000);
|
||||
|
||||
assertThat(this.properties.asProperties().size()).isEqualTo(22);
|
||||
assertThat(this.properties.asProperties().size()).isEqualTo(17);
|
||||
assertProperty("com.atomikos.icatch.service", "service");
|
||||
assertProperty("com.atomikos.icatch.max_timeout", "1");
|
||||
assertProperty("com.atomikos.icatch.default_jta_timeout", "2");
|
||||
@@ -75,11 +70,6 @@ public class AtomikosPropertiesTests {
|
||||
assertProperty("com.atomikos.icatch.log_base_name", "logBaseName");
|
||||
assertProperty("com.atomikos.icatch.log_base_dir", "logBaseDir");
|
||||
assertProperty("com.atomikos.icatch.checkpoint_interval", "4");
|
||||
assertProperty("com.atomikos.icatch.console_log_level", "WARN");
|
||||
assertProperty("com.atomikos.icatch.output_dir", "outputDir");
|
||||
assertProperty("com.atomikos.icatch.console_file_name", "consoleFileName");
|
||||
assertProperty("com.atomikos.icatch.console_file_count", "5");
|
||||
assertProperty("com.atomikos.icatch.console_file_limit", "6");
|
||||
assertProperty("com.atomikos.icatch.threaded_2pc", "true");
|
||||
assertProperty("com.atomikos.icatch.forget_orphaned_log_entries_delay", "2000");
|
||||
assertProperty("com.atomikos.icatch.recovery_delay", "3000");
|
||||
@@ -106,12 +96,8 @@ public class AtomikosPropertiesTests {
|
||||
"com.atomikos.icatch.oltp_retry_interval"));
|
||||
assertThat(properties).contains(
|
||||
entry("com.atomikos.icatch.recovery_delay", defaultSettings.get(
|
||||
"com.atomikos.icatch.default_jta_timeout")),
|
||||
entry("com.atomikos.icatch.console_log_level", "WARN"),
|
||||
entry("com.atomikos.icatch.console_file_name", "tm.out"),
|
||||
entry("com.atomikos.icatch.console_file_count", "1"),
|
||||
entry("com.atomikos.icatch.console_file_limit", "-1"));
|
||||
assertThat(properties).hasSize(18);
|
||||
"com.atomikos.icatch.default_jta_timeout")));
|
||||
assertThat(properties).hasSize(14);
|
||||
}
|
||||
|
||||
private MapEntry<?, ?>[] defaultOf(Properties defaultSettings, String... keys) {
|
||||
|
||||
Reference in New Issue
Block a user