Skip to content

Commit 95b882c

Browse files
committed
Merge branch '3.4.x'
Closes gh-44875
2 parents dfc31cb + 7424ad5 commit 95b882c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,10 +28,10 @@
2828
import com.unboundid.ldap.sdk.LDAPException;
2929
import com.unboundid.ldap.sdk.schema.Schema;
3030
import com.unboundid.ldif.LDIFReader;
31-
import jakarta.annotation.PreDestroy;
3231

3332
import org.springframework.aot.hint.RuntimeHints;
3433
import org.springframework.aot.hint.RuntimeHintsRegistrar;
34+
import org.springframework.beans.factory.DisposableBean;
3535
import org.springframework.boot.autoconfigure.AutoConfiguration;
3636
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
3737
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
@@ -77,7 +77,7 @@
7777
@ConditionalOnClass(InMemoryDirectoryServer.class)
7878
@Conditional(EmbeddedLdapAutoConfiguration.EmbeddedLdapCondition.class)
7979
@ImportRuntimeHints(EmbeddedLdapAutoConfigurationRuntimeHints.class)
80-
public class EmbeddedLdapAutoConfiguration {
80+
public class EmbeddedLdapAutoConfiguration implements DisposableBean {
8181

8282
private static final String PROPERTY_SOURCE_NAME = "ldap.ports";
8383

@@ -167,8 +167,8 @@ private Map<String, Object> getLdapPorts(MutablePropertySources sources) {
167167
return (Map<String, Object>) propertySource.getSource();
168168
}
169169

170-
@PreDestroy
171-
public void close() {
170+
@Override
171+
public void destroy() throws Exception {
172172
if (this.server != null) {
173173
this.server.shutDown(true);
174174
}

0 commit comments

Comments
 (0)