[utilities COMMIT] /java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/component/ComponentSupport...

noreply at shibboleth.net noreply at shibboleth.net
Wed Dec 17 03:17:02 EST 2014


Author: rdw
Date: Wed Dec 17 03:17:02 2014
New Revision: 714

URL: http://svn.shibboleth.net/view/utilities?rev=714&view=rev
Log:
IDP-543 Ensure that all beans created by a factory and custom schemas are destroyed correctly.
IDP-542 By way of a test we do the tear down of all created application contexts for all tests based on AbstractMetadataParser

Modified:
    java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/component/ComponentSupport.java

Modified: java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/component/ComponentSupport.java
URL: http://svn.shibboleth.net/view/utilities/java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/component/ComponentSupport.java?rev=714&r1=713&r2=714&view=diff
==============================================================================
--- java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/component/ComponentSupport.java (original)
+++ java-support/trunk/src/main/java/net/shibboleth/utilities/java/support/component/ComponentSupport.java Wed Dec 17 03:17:02 2014
@@ -42,7 +42,10 @@
         }
 
         if (obj instanceof DestructableComponent) {
-            ((DestructableComponent) obj).destroy();
+            final DestructableComponent destructable = (DestructableComponent) obj;
+            if (!destructable.isDestroyed()) {
+                destructable.destroy();
+            }
         }
     }
 
@@ -60,7 +63,10 @@
         }
 
         if (obj instanceof InitializableComponent) {
-            ((InitializableComponent) obj).initialize();
+            final InitializableComponent initializable = (InitializableComponent) obj;
+            if (!initializable.isInitialized()) {
+                initializable.initialize();
+            }
         }
     }
 
@@ -86,7 +92,7 @@
     }
 
     /**
-     * Checks if a component has not been initialized and, if so, throws a {@link UninitializedComponentException}. If
+     * Checks if a component has not been initialized and, if so, throw)s a {@link UninitializedComponentException}. If
      * the component is also an instance of {@link IdentifiedComponent}, the component's ID is included in the error
      * message.
      * 



More information about the commits mailing list