[java-identity-provider COMMIT] in /trunk/idp-core/src: main/java/net/shibboleth/idp/service/AbstractReloadableServic...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Dec 6 05:42:13 EST 2013
Author: rdw
Date: Fri Dec 6 05:42:13 2013
New Revision: 4999
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4999&view=rev
Log:
IdP-330 Clean up logging and add more to help debug jenkins failure
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
trunk/idp-core/src/test/java/net/shibboleth/idp/service/TestServiceableComponent.java
trunk/idp-core/src/test/resources/logback-test.xml
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/BrokenBean1.xml
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/ServiceableBean1.xml
trunk/idp-core/src/test/resources/net/shibboleth/idp/service/ServiceableBean2.xml
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=4999&r1=4998&r2=4999&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 Fri Dec 6 05:42:13 2013
@@ -190,7 +190,7 @@
if (reloadCheckDelay > 0) {
if (null == reloadTaskTimer) {
- log.info("{} no reload tast timer specified, creating default");
+ log.info("{} no reload tast timer specified, creating default", getLogPrefix());
reloadTaskTimer = new Timer("Timer for " + getId());
}
log.info("{} reload time set to: {}, starting refresh thread", getLogPrefix(), reloadCheckDelay);
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=4999&r1=4998&r2=4999&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 Fri Dec 6 05:42:13 2013
@@ -23,8 +23,13 @@
import javax.annotation.Nullable;
import net.shibboleth.utilities.java.support.component.AbstractDestructableIdentifiableInitializableComponent;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
+import net.shibboleth.utilities.java.support.component.ComponentSupport;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
+import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.ConfigurableApplicationContext;
@@ -35,7 +40,10 @@
* @param <T> The type of service.
*/
public abstract class AbstractServicableComponent<T> extends AbstractDestructableIdentifiableInitializableComponent
- implements ServiceableComponent<T>, ApplicationContextAware, DisposableBean {
+ implements ServiceableComponent<T>, ApplicationContextAware, DisposableBean, InitializingBean {
+
+ /** Class logger. */
+ private final Logger log = LoggerFactory.getLogger(AbstractServicableComponent.class);
/** The context used to load this bean. */
private ApplicationContext applicationContext;
@@ -48,6 +56,7 @@
/** {@inheritDoc} */
public void setApplicationContext(ApplicationContext context) {
+ ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
applicationContext = context;
}
@@ -63,10 +72,10 @@
/**
* {@inheritDoc}.
*/
- @Nonnull public abstract T getComponent();
+ @Nonnull public abstract T getComponent();
- /**{@inheritDoc}
- * Grab the service lock shared. This will block unloads until {@link #unpinComponent()} is called.
+ /**
+ * {@inheritDoc} Grab the service lock shared. This will block unloads until {@link #unpinComponent()} is called.
*/
public void pinComponent() {
serviceLock.readLock().lock();
@@ -77,15 +86,53 @@
serviceLock.readLock().unlock();
}
- /** {@inheritDoc}. Grab the service lock ex and then call spring to tear everything down. */
+ /** {@inheritDoc}. Grab the service lock ex and then call spring to tear everything down. */
public void unloadComponent() {
+ if (null == applicationContext) {
+ log.debug("Component '{}': Component already unloaded", getId());
+ return;
+ }
+
[... 213 lines stripped ...]
More information about the commits
mailing list