protected < X > void registerConfigurations ( Enumeration < URL > bindingsConfiguration ) { List < BindingConfiguration > configs = new ArrayList < BindingConfiguration > ( ) ; for ( URL nextLocation : IterableEnumeration . wrapEnumeration ( bindingsConfiguration ) ) { // Filter built in bindings - these are already registered by calling registerConfiguration directly URL builtIn = getBuiltInBindingsURL ( ) ; if ( ! builtIn . toString ( ) . equals ( nextLocation . toString ( ) ) ) { configs . add ( BindingXmlLoader . load ( nextLocation ) ) ; } } for ( BindingConfiguration nextConfig : configs ) { for ( Provider nextProvider : nextConfig . getProviders ( ) ) { try { registerConverterProvider ( nextProvider . getProviderClass ( ) . newInstance ( ) ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binding provider class: " + nextProvider . getProviderClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binding provider class: " + nextProvider . getProviderClass ( ) . getName ( ) ) ; } } for ( Extension < ? > nextExtension : nextConfig . getExtensions ( ) ) { try { @ SuppressWarnings ( "unchecked" ) Extension < X > myExtension = ( Extension < X > ) nextExtension ; @ SuppressWarnings ( "unchecked" ) X myImplementation = ( X ) nextExtension . getImplementationClass ( ) . newInstance ( ) ; registerExtendedBinder ( myExtension . getExtensionClass ( ) , myImplementation ) ; } catch ( InstantiationException e ) { throw new IllegalStateException ( "Cannot instantiate binder extension class: " + nextExtension . getExtensionClass ( ) . getName ( ) ) ; } catch ( IllegalAccessException e ) { throw new IllegalStateException ( "Cannot access binder extension class: " + nextExtension . getExtensionClass ( ) . getName ( ) ) ; } } registerBindingConfigurationEntries ( nextConfig . getBindingEntries ( ) ) ; } }
Registers a set of configurations for the given list of URLs . This is typically used to process all the various bindings . xml files discovered in jars on the classpath . It is given protected scope to allow subclasses to register additional configurations