Merge branch '3.4.x'

Closes gh-44875
This commit is contained in:
Stéphane Nicoll
2025-03-25 11:27:58 +01:00

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 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.
@@ -28,10 +28,10 @@ import com.unboundid.ldap.listener.InMemoryListenerConfig;
import com.unboundid.ldap.sdk.LDAPException;
import com.unboundid.ldap.sdk.schema.Schema;
import com.unboundid.ldif.LDIFReader;
import jakarta.annotation.PreDestroy;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
@@ -77,7 +77,7 @@ import org.springframework.util.StringUtils;
@ConditionalOnClass(InMemoryDirectoryServer.class)
@Conditional(EmbeddedLdapAutoConfiguration.EmbeddedLdapCondition.class)
@ImportRuntimeHints(EmbeddedLdapAutoConfigurationRuntimeHints.class)
public class EmbeddedLdapAutoConfiguration {
public class EmbeddedLdapAutoConfiguration implements DisposableBean {
private static final String PROPERTY_SOURCE_NAME = "ldap.ports";
@@ -167,8 +167,8 @@ public class EmbeddedLdapAutoConfiguration {
return (Map<String, Object>) propertySource.getSource();
}
@PreDestroy
public void close() {
@Override
public void destroy() throws Exception {
if (this.server != null) {
this.server.shutDown(true);
}