[java-identity-provider COMMIT] in /trunk/idp-core/src/main/java/net/shibboleth/idp: service/AbstractSpringService.ja...
noreply at shibboleth.net
noreply at shibboleth.net
Sun Nov 24 09:06:50 EST 2013
Author: rdw
Date: Sun Nov 24 09:06:49 2013
New Revision: 4964
URL: http://svn.shibboleth.net/view/java-identity-provider?rev=4964&view=rev
Log:
IdP-298 Make it possible to configure the 'Services; via things other than Shibboleth Resources (prior to removing them entirely)
Added:
trunk/idp-core/src/main/java/net/shibboleth/idp/spring/resource/ShibbolethResourceImpl.java (with props)
Modified:
trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractSpringService.java
Modified: trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractSpringService.java
URL: http://svn.shibboleth.net/view/java-identity-provider/trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractSpringService.java?rev=4964&r1=4963&r2=4964&view=diff
==============================================================================
--- trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractSpringService.java (original)
+++ trunk/idp-core/src/main/java/net/shibboleth/idp/service/AbstractSpringService.java Sun Nov 24 09:06:49 2013
@@ -17,6 +17,7 @@
package net.shibboleth.idp.service;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -26,6 +27,8 @@
import javax.annotation.concurrent.ThreadSafe;
import net.shibboleth.idp.spring.SpringSupport;
+import net.shibboleth.idp.spring.resource.ShibbolethResourceImpl;
+import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
import net.shibboleth.utilities.java.support.resource.Resource;
import org.slf4j.Logger;
@@ -33,7 +36,9 @@
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.ResourceLoader;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
@@ -53,7 +58,8 @@
* change occurs the service context will not be replaced until after all current reads have completed.
*/
@ThreadSafe
-public abstract class AbstractSpringService extends AbstractService implements ApplicationContextAware {
+public abstract class AbstractSpringService extends AbstractService implements ApplicationContextAware,
+ ResourceLoaderAware {
/** Key under which the Spring Application Context is stored in the start/stop context. */
public static final String APP_CTX_CTX_KEY = "appContext";
@@ -64,6 +70,9 @@
/** List of configuration resources for this service. */
private List<Resource> serviceConfigurations = Collections.emptyList();
+ /** List of configuration resource objects for this service. */
+ private List<Object> configurations;
+
/** Application context owning this service. */
private ApplicationContext parentContext;
@@ -71,12 +80,32 @@
private GenericApplicationContext serviceContext;
/**
+ * The Resource Loader.
+ */
+ private ResourceLoader resourceLoader;
+
+ /**
* Gets the application context that is the parent to this service's context.
*
* @return application context that is the parent to this service's context
*/
@Nullable public ApplicationContext getParentContext() {
return parentContext;
+ }
+
+ /** {@inheritDoc} */
+ public void setResourceLoader(ResourceLoader loader) {
+ resourceLoader = loader;
+ }
+
+ /**
+ * Gets the Resource loader associated with this bean.
+ *
+ * @return the loader.
+ */
+ public ResourceLoader getResourceLoader() {
+
+ return resourceLoader;
}
/**
@@ -90,7 +119,6 @@
if (isInitialized()) {
return;
}
-
parentContext = context;
}
@@ -111,19 +139,67 @@
}
/**
- * Sets the list of configurations for this service.
+ * Gets the untyped configurations.
+ *
+ * @return Returns the configurations - if any have been set.
+ */
+ @Nullable public List<Object> getConfigurations() {
+ return configurations;
+ }
+
+ /**
+ * Sets the configurations (suitable for injection as a <util:List>). <br/>
+ * These have to be staged because the resource loader may be set after this.
+ *
+ * @param configs The configurations to set.
+ */
+ public void setConfigurations(@Nonnull List<Object> configs) {
+ configurations = configs;
+ }
+
+ /**
+ * Sets the list of configurations for this service.<br/>
+ * This is a legacy api left in place to allow the IdP to continue to work
+ * in backwards
*
* This setting can not be changed after the service has been initialized.
*
- * @param configs list of configurations for this service, may be null or empty
- */
- public synchronized void setServiceConfigurations(@Nonnull final List<Resource> configs) {
[... 40 lines stripped ...]
More information about the commits
mailing list