edu.internet2.middleware.shibboleth.common.config
Class SpringConfigurationUtils

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.config.SpringConfigurationUtils

public final class SpringConfigurationUtils
extends Object

Utilities to help configure Spring beans.


Method Summary
static org.springframework.beans.factory.config.RuntimeBeanReference parseCustomElement(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parses a bean definition using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).
static org.springframework.beans.factory.config.RuntimeBeanReference parseCustomElement(Element element, String idAttribute, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parses a bean definition using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).
static org.springframework.beans.factory.config.RuntimeBeanReference parseCustomElementReference(Element element, String refAttribute, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parses a custom element that is a reference to a bean declared elsewhere.
static org.springframework.beans.factory.support.ManagedList parseCustomElements(List<Element> elements, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parse list of elements into bean definitions.
static org.springframework.beans.factory.support.ManagedList parseCustomElements(List<Element> elements, String idAttribute, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parse list of elements into bean definitions.
static long parseDurationToMillis(String propertyName, String duration, int toMillisFactor)
          Deprecated. 
static org.springframework.beans.factory.config.BeanDefinition parseInnerCustomElement(Element element, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parses a bean definition using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).
static org.springframework.beans.factory.support.ManagedList parseInnerCustomElements(List<Element> elements, org.springframework.beans.factory.xml.ParserContext parserContext)
          Parser a list of bean definitions using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).
static void populateRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry beanRegistry, List<org.opensaml.util.resource.Resource> configurationResources)
          Loads a set of spring configuration resources into a given application context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

populateRegistry

public static void populateRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry beanRegistry,
                                    List<org.opensaml.util.resource.Resource> configurationResources)
                             throws org.opensaml.util.resource.ResourceException
Loads a set of spring configuration resources into a given application context.

Parameters:
beanRegistry - registry of spring beans to be populated with information from the given configurations
configurationResources - list of spring configuration resources
Throws:
org.opensaml.util.resource.ResourceException - thrown if there is a problem reading the spring configuration resources into the registry

parseInnerCustomElement

public static org.springframework.beans.factory.config.BeanDefinition parseInnerCustomElement(Element element,
                                                                                              org.springframework.beans.factory.xml.ParserContext parserContext)
Parses a bean definition using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).

Parameters:
element - configuration element
parserContext - current parser context
Returns:
bean definition

parseInnerCustomElements

public static org.springframework.beans.factory.support.ManagedList parseInnerCustomElements(List<Element> elements,
                                                                                             org.springframework.beans.factory.xml.ParserContext parserContext)
Parser a list of bean definitions using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).

Parameters:
elements - configuration elements
parserContext - current parser context
Returns:
list of bean definition

parseCustomElement

public static org.springframework.beans.factory.config.RuntimeBeanReference parseCustomElement(Element element,
                                                                                               org.springframework.beans.factory.xml.ParserContext parserContext)
Parses a bean definition using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element). Assumes the element has an attribute 'id' that provides a unique identifier for the bean.

Parameters:
element - element to parse
parserContext - current parser context
Returns:
bean definition reference

parseCustomElement

public static org.springframework.beans.factory.config.RuntimeBeanReference parseCustomElement(Element element,
                                                                                               String idAttribute,
                                                                                               org.springframework.beans.factory.xml.ParserContext parserContext)
Parses a bean definition using an xsi:type aware version of BeanDefinitionParserDelegate.parseCustomElement(Element).

Parameters:
element - element to parse
idAttribute - attribute that carries the unique ID for the bean
parserContext - current parser context
Returns:
bean definition reference

parseCustomElementReference

public static org.springframework.beans.factory.config.RuntimeBeanReference parseCustomElementReference(Element element,
                                                                                                        String refAttribute,
                                                                                                        org.springframework.beans.factory.xml.ParserContext parserContext)
Parses a custom element that is a reference to a bean declared elsewhere.

Parameters:
element - the element that references the bean
refAttribute - the name of the attribute that contains the referenced bean's name
parserContext - current parsing context
Returns:
reference to the bean or null if the element did not contain the reference attribute

parseCustomElements

public static org.springframework.beans.factory.support.ManagedList parseCustomElements(List<Element> elements,
                                                                                        org.springframework.beans.factory.xml.ParserContext parserContext)
Parse list of elements into bean definitions. The list is populated with bean references. Each configuration element is expected to contain an 'id' attribute that provides a unique ID for each bean.

Parameters:
elements - list of elements to parse
parserContext - current parsing context
Returns:
list of bean references

parseCustomElements

public static org.springframework.beans.factory.support.ManagedList parseCustomElements(List<Element> elements,
                                                                                        String idAttribute,
                                                                                        org.springframework.beans.factory.xml.ParserContext parserContext)
Parse list of elements into bean definitions.

Parameters:
elements - list of elements to parse
idAttribute - attribute that carries the unique ID for the bean
parserContext - current parsing context
Returns:
list of bean references

parseDurationToMillis

@Deprecated
public static long parseDurationToMillis(String propertyName,
                                                    String duration,
                                                    int toMillisFactor)
                                  throws IllegalArgumentException
Deprecated. 

Converts a duration, either expressed as numerical time or or ISO8601 duration. If a numerical form is used a warning message indicating that the new IS08601 duration form should be used will be written to the logs. This method will be removed once the deprecated numerical duration form is no longer allowed.

Parameters:
propertyName - Name of the property carrying the duration. This is used in the warning log message if the duration is in numerical form.
duration - the duration to be parsed
toMillisFactor - used to convert a numerical duration to milliseconds, 0 indicates no conversion
Returns:
the duration in milliseconds
Throws:
IllegalArgumentException - thrown if the given duration is either an invalid number or ISO8601 duration or if the duration is negative


Copyright © 2006-2011 Internet2. All Rights Reserved.