[java-identity-provider COMMIT] in /trunk: idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService....

noreply at shibboleth.net noreply at shibboleth.net
Mon Apr 21 11:39:20 EDT 2014


Author: rdw
Date: Mon Apr 21 11:39:20 2014
New Revision: 5754

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=5754&view=rev
Log:
IDP-391 Add the infrastructure for the reloadable MetadataProvider resolver from relyingparty.xml

Added:
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/ReloadingRelyingPartyConfigurationResolver.java
      - copied, changed from r5751, trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/ReloadableRelyingPartyConfigurationResolver.java
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/propertyPlaceholder.xml   (with props)
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/test-metadata-in.xml   (with props)
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/test-metadata-out.xml   (with props)
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/metadata/impl/ReloadingRelyingPartyMetadataProvider.java   (with props)
Modified:
    trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService.java
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/DefaultRelyingPartyConfigurationResolver.java
    trunk/idp-profile-impl/src/main/java/net/shibboleth/idp/relyingparty/impl/ReloadableRelyingPartyConfigurationResolver.java
    trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/RelyingPartyGroupTest.java
    trunk/idp-profile-spring/src/test/java/net/shibboleth/idp/profile/spring/relyingparty/metadata/AbstractMetadataParserTest.java
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/beans.xml
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/file.properties
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/relying-party-group.xml
    trunk/idp-profile-spring/src/test/resources/net/shibboleth/idp/profile/spring/relyingparty/services.xml
    trunk/idp-saml-impl/src/main/java/net/shibboleth/idp/saml/metadata/impl/RelyingPartyMetadataProvider.java

Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService.java?rev=5754&r1=5753&r2=5754&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService.java Mon Apr 21 11:39:20 2014
@@ -60,12 +60,18 @@
     /** The class we are looking for. */
     private final Class<T> theClaz;
 
+    /**
+     * The precise class to look for. This is required if the parsed file may produce more than one
+     * {@link ServiceableComponent}.
+     */
+    private final Class<? extends ServiceableComponent> theServiceClaz;
+
     /** Application context owning this engine. */
     private ApplicationContext parentContext;
 
     /** The bean name. */
     private String beanName;
-    
+
     /** The last known good component. */
     private ServiceableComponent<T> cachedComponent;
 
@@ -85,6 +91,18 @@
      */
     public ReloadableSpringService(Class<T> claz) {
         theClaz = claz;
+        theServiceClaz = ServiceableComponent.class;
+    }
+
+    /**
+     * Constructor.
+     * 
+     * @param claz The interface being implemented.
+     * @param servicableClaz the service to look for.
+     */
+    public ReloadableSpringService(Class<T> claz, Class<? extends ServiceableComponent> servicableClaz) {
+        theClaz = claz;
+        theServiceClaz = servicableClaz;
     }
 
     /**
@@ -157,7 +175,7 @@
 
     /** {@inheritDoc} */
     // Checkstyle: CyclomaticComplexity OFF
-    protected boolean shouldReload() {
+    @Override protected boolean shouldReload() {
         // Loop over each resource and check if the any resources have been changed since
         // the last time the service was reloaded. I believe a read lock is all we need here
         // to allow use of the service to proceed while we check on the state. Actual reloading
@@ -218,7 +236,7 @@
     // Checkstyle: CyclomaticComplexity ON
 
     /** {@inheritDoc} */
-    protected void doReload() throws ServiceException {
+    @Override protected void doReload() throws ServiceException {
         super.doReload();
 
         log.debug("Creating new ApplicationContext for service '{}'", getId());
@@ -231,14 +249,15 @@
 
         log.trace("{} New Application Context created.", getLogPrefix());
 
-        final Collection<ServiceableComponent> components =
-                appContext.getBeansOfType(ServiceableComponent.class).values();
+        final Collection<? extends ServiceableComponent> components =

[... 500 lines stripped ...]


More information about the commits mailing list