[java-identity-provider COMMIT] /trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingpart...

noreply at shibboleth.net noreply at shibboleth.net
Mon Dec 15 18:00:39 EST 2014


Author: putmanb
Date: Mon Dec 15 18:00:37 2014
New Revision: 7105

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7105&view=rev
Log:
Make init and destroy calls conditional on the component not already being inited and destroyed.

Modified:
    trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/FileCachingHttpClientFactoryBean.java

Modified: trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/FileCachingHttpClientFactoryBean.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/FileCachingHttpClientFactoryBean.java?rev=7105&r1=7104&r2=7105&view=diff
==============================================================================
--- trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/FileCachingHttpClientFactoryBean.java (original)
+++ trunk/idp-profile-spring/src/main/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/FileCachingHttpClientFactoryBean.java Mon Dec 15 18:00:37 2014
@@ -81,7 +81,10 @@
         HttpClient client = super.createInstance();
         synchronized(this) {
             if (client instanceof InitializableComponent) {
-                ((InitializableComponent)client).initialize();
+                InitializableComponent component = (InitializableComponent) client;
+                if (!component.isInitialized()) {
+                   component.initialize(); 
+                }
             }
             clientRefs.add(client);
         }
@@ -93,7 +96,10 @@
         synchronized (this) {
             for (HttpClient client : clientRefs) {
                 if (client instanceof DestructableComponent) {
-                   ((DestructableComponent)client).destroy();
+                    DestructableComponent component = (DestructableComponent) client;
+                    if (!component.isDestroyed()) {
+                        component.destroy();
+                    }
                 }
             }
             clientRefs.clear();



More information about the commits mailing list