[java-identity-provider COMMIT] in /trunk: idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadableServic...

noreply at shibboleth.net noreply at shibboleth.net
Thu May 7 07:57:12 EDT 2015


Author: serac
Date: Thu May  7 07:57:11 2015
New Revision: 7502

URL: http://svn.shibboleth.net/view/java-identity-provider?rev=7502&view=rev
Log:
IDP-615 Call unpinComponent and rename for consistency.

Added:
    trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadingServiceRegistry.java
      - copied, changed from r7501, trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadableServiceRegistry.java
Modified:
    trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadableServiceRegistry.java
    trunk/idp-conf/src/main/resources/system/conf/services-system.xml

Copied: trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadingServiceRegistry.java (from r7501, trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadableServiceRegistry.java)
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadingServiceRegistry.java?p2=trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadingServiceRegistry.java&p1=trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadableServiceRegistry.java&r1=7501&r2=7502&rev=7502&view=diff
==============================================================================
--- trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadableServiceRegistry.java	(original)
+++ trunk/idp-cas-impl/src/main/java/net/shibboleth/idp/cas/service/ReloadingServiceRegistry.java	Thu May  7 07:57:11 2015
@@ -32,10 +32,10 @@
  *
  * @author Marvin S. Addison
  */
-public class ReloadableServiceRegistry extends AbstractIdentifiableInitializableComponent implements ServiceRegistry {
+public class ReloadingServiceRegistry extends AbstractIdentifiableInitializableComponent implements ServiceRegistry {
 
     /** Class logger. */
-    @Nonnull private final Logger log = LoggerFactory.getLogger(ReloadableServiceRegistry.class);
+    @Nonnull private final Logger log = LoggerFactory.getLogger(ReloadingServiceRegistry.class);
 
     /** The service that manages the reloading. */
     private final ReloadableService<ServiceRegistry> service;
@@ -45,18 +45,25 @@
      *
      * @param delegate The service to which operations are delegated.
      */
-    public ReloadableServiceRegistry(@Nonnull ReloadableService<ServiceRegistry> delegate) {
+    public ReloadingServiceRegistry(@Nonnull ReloadableService<ServiceRegistry> delegate) {
         service = Constraint.isNotNull(delegate, "ReloadableService cannot be null");
     }
 
     @Nullable
     @Override
     public Service lookup(@Nonnull String serviceURL) {
-        ServiceableComponent<ServiceRegistry> component = service.getServiceableComponent();
-        if (null == component) {
-            log.error("ServiceRegistry '{}': error looking up service registry: Invalid configuration.", getId());
-            return null;
+        ServiceableComponent<ServiceRegistry> component = null;
+        try {
+            component = service.getServiceableComponent();
+            if (null == component) {
+                log.error("ServiceRegistry '{}': error looking up service registry: Invalid configuration.", getId());
+                return null;
+            }
+            return component.getComponent().lookup(serviceURL);
+        } finally {
+            if (null != component) {
+                component.unpinComponent();
+            }
         }
-        return component.getComponent().lookup(serviceURL);
     }
 }

Modified: trunk/idp-conf/src/main/resources/system/conf/services-system.xml
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-conf/src/main/resources/system/conf/services-system.xml?rev=7502&r1=7501&r2=7502&view=diff
==============================================================================
--- trunk/idp-conf/src/main/resources/system/conf/services-system.xml	(original)
+++ trunk/idp-conf/src/main/resources/system/conf/services-system.xml	Thu May  7 07:57:11 2015
@@ -133,7 +133,7 @@
         c:resolverService-ref="shibboleth.AttributeResolverService" />
 
     <bean id="cas.ServiceRegistry"
-          class="net.shibboleth.idp.cas.service.ReloadableServiceRegistry"
+          class="net.shibboleth.idp.cas.service.ReloadingServiceRegistry"
           c:delegate-ref="cas.ReloadableServiceRegistry" />
 
  </beans>



More information about the commits mailing list