Polish
This commit is contained in:
@@ -31,22 +31,25 @@ public enum Threading {
|
||||
* Platform threads. Active if virtual threads are not active.
|
||||
*/
|
||||
PLATFORM {
|
||||
|
||||
@Override
|
||||
public boolean isActive(Environment environment) {
|
||||
return !VIRTUAL.isActive(environment);
|
||||
}
|
||||
|
||||
},
|
||||
/**
|
||||
* Virtual threads. Active if {@code spring.threads.virtual.enabled} is {@code true}
|
||||
* and running on Java 21 or later.
|
||||
*/
|
||||
VIRTUAL {
|
||||
|
||||
@Override
|
||||
public boolean isActive(Environment environment) {
|
||||
boolean virtualThreadsEnabled = environment.getProperty("spring.threads.virtual.enabled", boolean.class,
|
||||
false);
|
||||
return virtualThreadsEnabled && JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.TWENTY_ONE);
|
||||
return environment.getProperty("spring.threads.virtual.enabled", boolean.class, false)
|
||||
&& JavaVersion.getJavaVersion().isEqualOrNewerThan(JavaVersion.TWENTY_ONE);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -289,6 +289,7 @@ class ActiveMQAutoConfigurationTests {
|
||||
@Bean
|
||||
ActiveMQConnectionDetails activemqConnectionDetails() {
|
||||
return new ActiveMQConnectionDetails() {
|
||||
|
||||
@Override
|
||||
public String getBrokerUrl() {
|
||||
return "tcp://localhost:12345";
|
||||
@@ -303,6 +304,7 @@ class ActiveMQAutoConfigurationTests {
|
||||
public String getPassword() {
|
||||
return "spring";
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,8 @@ include::code:MyObservationPredicate[]
|
||||
|
||||
The preceding example will prevent all observations whose name contains "denied".
|
||||
|
||||
|
||||
|
||||
[[actuator.observability.opentelemetry]]
|
||||
=== OpenTelemetry Support
|
||||
Spring Boot's actuator module includes basic support for https://opentelemetry.io/[OpenTelemetry].
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.toolchain.ToolchainManager;
|
||||
|
||||
import org.springframework.boot.loader.tools.FileUtils;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
/**
|
||||
@@ -373,10 +374,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private void addAdditionalClasspathLocations(List<URL> urls) throws MalformedURLException {
|
||||
if (!ObjectUtils.isEmpty(this.directories) && !ObjectUtils.isEmpty(this.additionalClasspathElements)) {
|
||||
throw new IllegalStateException(
|
||||
"Either additionalClasspathElements or directories (deprecated) should be set, not both");
|
||||
}
|
||||
Assert.state(ObjectUtils.isEmpty(this.directories) || ObjectUtils.isEmpty(this.additionalClasspathElements),
|
||||
"Either additionalClasspathElements or directories (deprecated) should be set, not both");
|
||||
String[] elements = !ObjectUtils.isEmpty(this.additionalClasspathElements) ? this.additionalClasspathElements
|
||||
: this.directories;
|
||||
if (elements != null) {
|
||||
|
||||
Reference in New Issue
Block a user