[java-shib-shared] branch main updated: JSSH-71 Remove the impact of the DestructableComponent Interface
Codeberg
noreply at shibboleth.net
Sat Aug 1 12:27:15 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch main
in repository java-shib-shared.
View the commit online:
https://codeberg.org/Shibboleth/java-shib-shared/commit/766afae24b1228e824111e76f67b6508a2198b1f
The following commit(s) were added to refs/heads/main by this push:
new 766afae2 JSSH-71 Remove the impact of the DestructableComponent Interface
766afae2 is described below
commit 766afae24b1228e824111e76f67b6508a2198b1f
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Fri Jul 31 13:40:28 2026 +0100
JSSH-71 Remove the impact of the DestructableComponent Interface
https://shibboleth.atlassian.net/browse/JSSH-71
Make the destroy logging a standard Deprecation warning
---
.../service/AbstractServiceableComponent.java | 1 -
.../component/AbstractInitializableComponent.java | 21 ++++++++-------------
...bstractIdentifiedInitializableComponentTest.java | 7 +++++++
.../AbstractInitializableComponentTest.java | 6 ++++++
4 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/shib-service/src/main/java/net/shibboleth/shared/spring/service/AbstractServiceableComponent.java b/shib-service/src/main/java/net/shibboleth/shared/spring/service/AbstractServiceableComponent.java
index 66d26fb1..b6c5f758 100644
--- a/shib-service/src/main/java/net/shibboleth/shared/spring/service/AbstractServiceableComponent.java
+++ b/shib-service/src/main/java/net/shibboleth/shared/spring/service/AbstractServiceableComponent.java
@@ -20,7 +20,6 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.slf4j.Logger;
-import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
diff --git a/shib-support/src/main/java/net/shibboleth/shared/component/AbstractInitializableComponent.java b/shib-support/src/main/java/net/shibboleth/shared/component/AbstractInitializableComponent.java
index 5513d57d..9163e5fd 100644
--- a/shib-support/src/main/java/net/shibboleth/shared/component/AbstractInitializableComponent.java
+++ b/shib-support/src/main/java/net/shibboleth/shared/component/AbstractInitializableComponent.java
@@ -20,6 +20,8 @@ import javax.annotation.concurrent.ThreadSafe;
import org.slf4j.Logger;
import net.shibboleth.shared.annotation.OnTeardown;
+import net.shibboleth.shared.primitive.DeprecationSupport;
+import net.shibboleth.shared.primitive.DeprecationSupport.ObjectType;
import net.shibboleth.shared.primitive.LoggerFactory;
/** Base class for things that implement {@link DestructableComponent} and {@link InitializableComponent}. */
@@ -140,20 +142,13 @@ public abstract class AbstractInitializableComponent implements DestructableComp
@Deprecated(forRemoval = true, since = "9.3")
protected void doDestroy() {
- if (getLog().isTraceEnabled()) {
- //
- // In a V6.0 ready system nothing should be being called here.
- // Add a lot of logging (at TRACE) to help find out where this comes from.
- //
- if (this instanceof IdentifiedComponent) {
- final String theName = ((IdentifiedComponent) this).getId();
- getLog().trace("Component {} of type {} was called at destroy() {}",
- theName, this.getClass().getName(), Thread.currentThread().getStackTrace());
- } else {
- getLog().trace("Anonymous component of type {} was called at destroy {}",
- this.getClass().getName(), Thread.currentThread().getStackTrace());
- }
+ final String theName;
+ if (this instanceof IdentifiedComponent) {
+ theName = "Bean of type " + this.getClass().descriptorString() + " with id " + ((IdentifiedComponent) this).getId();
+ } else {
+ theName = "Anonymous Bean of type " + this.getClass().descriptorString();
}
+ DeprecationSupport.warnOnce(ObjectType.CONFIGURATION, theName, "`destroy=` or `default-destroy=` in config file", null);
}
/**
diff --git a/shib-support/src/test/java/net/shibboleth/shared/component/AbstractIdentifiedInitializableComponentTest.java b/shib-support/src/test/java/net/shibboleth/shared/component/AbstractIdentifiedInitializableComponentTest.java
index a165a44d..0fbd6f77 100644
--- a/shib-support/src/test/java/net/shibboleth/shared/component/AbstractIdentifiedInitializableComponentTest.java
+++ b/shib-support/src/test/java/net/shibboleth/shared/component/AbstractIdentifiedInitializableComponentTest.java
@@ -91,6 +91,13 @@ public class AbstractIdentifiedInitializableComponentTest {
return null;
}
+ @Test public void deprecationWarning() throws Exception {
+ MockComponent component = new MockComponent();
+ component.setId("Mock");
+ component.initialize();
+ component.destroy();
+ }
+
/** Mock component. */
private class MockComponent extends AbstractIdentifiedInitializableComponent {
}
diff --git a/shib-support/src/test/java/net/shibboleth/shared/component/AbstractInitializableComponentTest.java b/shib-support/src/test/java/net/shibboleth/shared/component/AbstractInitializableComponentTest.java
index 0de3b7fc..5cdbb527 100644
--- a/shib-support/src/test/java/net/shibboleth/shared/component/AbstractInitializableComponentTest.java
+++ b/shib-support/src/test/java/net/shibboleth/shared/component/AbstractInitializableComponentTest.java
@@ -40,6 +40,12 @@ public class AbstractInitializableComponentTest {
Assert.assertTrue(component.isInitialized());
Assert.assertEquals(component.getInitCount(), 1);
}
+
+ @Test public void deprecationWarning() throws Exception {
+ MockComponent component = new MockComponent();
+ component.initialize();
+ component.destroy();
+ }
public class MockComponent extends AbstractInitializableComponent {
private int initCount;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list