[java-identity-provider COMMIT] in /trunk/idp-core/src: main/java/net/shibboleth/idp/service/AbstractReloadableServic...
noreply at shibboleth.net
noreply at shibboleth.net
Thu Dec 5 13:32:14 EST 2013
Author: rdw
Date: Thu Dec 5 13:32:13 2013
New Revision: 4987
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4987&view=rev
Log:
IdP-330 Tests for ReloadableSpringService, plus bug fixes
Added:
trunk/idp-core/src/test/java/net/shibboleth/idp/service/
trunk/idp-core/src/test/java/net/shibboleth/idp/service/ReloadableSpringServiceTest.java (with props)
trunk/idp-core/src/test/java/net/shibboleth/idp/service/TestServiceableComponent.java (with props)
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/BrokenBean1.xml (with props)
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/BrokenBean2.xml (with props)
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/ServiceableBean1.xml (with props)
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/ServiceableBean2.xml (with props)
Modified:
trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java
trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractServicableComponent.java
trunk/idp-core/src/main/java/net/shibboleth/idp/service/ReloadableSpringService.java
Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java?rev=4987&r1=4986&r2=4987&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractReloadableService.java Thu Dec 5 13:32:13 2013
@@ -38,6 +38,7 @@
import org.joda.time.chrono.ISOChronology;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.BeanInitializationException;
/**
* Base class for {@link ReloadableService}. This base class will start a background thread that will perform a periodic
@@ -213,8 +214,7 @@
try {
initialize();
} catch (ComponentInitializationException e) {
- log.error("{} Could not start service : {}", getLogPrefix(), e);
- return;
+ throw new BeanInitializationException("Could not start service", e);
}
}
@@ -255,7 +255,7 @@
/** {@inheritDoc}. */
public boolean isRunning() {
- return isInitialized();
+ return isInitialized() && !isDestroyed();
}
/**
Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractServicableComponent.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractServicableComponent.java?rev=4987&r1=4986&r2=4987&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractServicableComponent.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractServicableComponent.java Thu Dec 5 13:32:13 2013
@@ -24,6 +24,7 @@
import net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent;
+import org.springframework.beans.factory.DisposableBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
@@ -34,7 +35,7 @@
* @param <T> The type of service.
*/
public abstract class AbstractServicableComponent<T> extends AbstractDestructableIdentifiableInitializableComponent
- implements ServiceableComponent<T>, ApplicationContextAware {
+ implements ServiceableComponent<T>, ApplicationContextAware, DisposableBean {
/** The context used to load this bean. */
private ApplicationContext applicationContext;
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=4987&r1=4986&r2=4987&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 Thu Dec 5 13:32:13 2013
@@ -30,6 +30,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.springframework.beans.FatalBeanException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.core.io.Resource;
@@ -117,7 +118,7 @@
*
* @param configs list of configurations for this service, may be null or empty
*/
[... 98 lines stripped ...]
More information about the commits
mailing list