[java-shib-shared] 01/05: cee048c9dbcf44d55998c00825d13a486d64b5c1
Codeberg
noreply at shibboleth.net
Mon May 25 14:43:06 UTC 2026
This is an automated email from the git hooks/post-receive script.
codeberg pushed a commit to branch dev/JSSH-71
in repository java-shib-shared.
View the commit online:
https://codeberg.org/Shibboleth/java-shib-shared/commit/340903e85787a1515845a8d6a4a5e28fe015a542
commit 340903e85787a1515845a8d6a4a5e28fe015a542
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sun May 24 15:29:58 2026 +0100
cee048c9dbcf44d55998c00825d13a486d64b5c1
---
.../httpclient/FileCachingHttpClientBuilder.java | 47 ++++++++--------------
1 file changed, 17 insertions(+), 30 deletions(-)
diff --git a/shib-networking/src/main/java/net/shibboleth/shared/httpclient/FileCachingHttpClientBuilder.java b/shib-networking/src/main/java/net/shibboleth/shared/httpclient/FileCachingHttpClientBuilder.java
index ced7ceb3..6eb39085 100644
--- a/shib-networking/src/main/java/net/shibboleth/shared/httpclient/FileCachingHttpClientBuilder.java
+++ b/shib-networking/src/main/java/net/shibboleth/shared/httpclient/FileCachingHttpClientBuilder.java
@@ -265,7 +265,7 @@ public class FileCachingHttpClientBuilder extends HttpClientBuilder {
* {@link ManagedHttpCacheStorage}, and manages the scheduled maintenance and lifecycle of the latter.
*/
private static class StorageManagingHttpClient extends AbstractHttpClient
- implements InitializableComponent, DestructableComponent {
+ implements InitializableComponent {
/** Logger. */
@Nonnull private Logger log = LoggerFactory.getLogger(StorageManagingHttpClient.class);
@@ -282,9 +282,6 @@ public class FileCachingHttpClientBuilder extends HttpClientBuilder {
/** Initialized flag. */
private boolean initialized;
- /** Destroyed flag. */
- private boolean destroyed;
-
/** Scheduled task timer. */
@NonnullAfterInit private Timer timer;
@@ -314,10 +311,6 @@ public class FileCachingHttpClientBuilder extends HttpClientBuilder {
throw new UninitializedComponentException(
"StorageManagingHttpClient has not yet been initialized and cannot be used.");
}
- if (isDestroyed()) {
- throw new DestroyedComponentException(
- "StorageManagingHttpClient has already been destroyed and can no longer be used.");
- }
}
@@ -351,11 +344,6 @@ public class FileCachingHttpClientBuilder extends HttpClientBuilder {
return initialized;
}
- /** {@inheritDoc} */
- public boolean isDestroyed() {
- return destroyed;
- }
-
/** {@inheritDoc} */
public void initialize() throws ComponentInitializationException {
timer = new Timer(TimerSupport.getTimerName(this), true);
@@ -365,25 +353,24 @@ public class FileCachingHttpClientBuilder extends HttpClientBuilder {
initialized = true;
}
- /** {@inheritDoc} */
- @PreDestroy public synchronized void destroy() {
- maintenanceTask.cancel();
- timer.cancel();
- maintenanceTask = null;
- timer = null;
-
- try {
- log.debug("Executing ManagedHttpCacheStorage shutdown()");
- storage.shutdown();
- } catch (final Throwable t) {
- log.warn("Error invoking ManagedHttpCacheStorage shutdown()", t);
+ /** Bean-specific function to handle tear down. */
+ @PreDestroy public synchronized void teardowbn() {
+ if (maintenanceTask != null) {
+ maintenanceTask.cancel();
+ timer.cancel();
+ maintenanceTask = null;
+ timer = null;
+
+ try {
+ log.debug("Executing ManagedHttpCacheStorage shutdown()");
+ storage.shutdown();
+ } catch (final Throwable t) {
+ log.warn("Error invoking ManagedHttpCacheStorage shutdown()", t);
+ }
+ storage = null;
+ httpClient = null;
}
- storage = null;
- httpClient = null;
-
- destroyed = true;
}
-
}
/**
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list