public RepositoryResourceBundleLoader( final Repository repository,
final ResourceKey outsideContextKey ) {
if ( repository == null ) {
throw new NullPointerException();
}
this.repository = repository;
final HashMap<FactoryParameterKey, Object> map = new HashMap<FactoryParameterKey, Object>();
map.put( new FactoryParameterKey( "repository" ), repository );
map.put( new FactoryParameterKey( "repository-loader" ), this );
this.bundleKey = new ResourceKey( outsideContextKey, SCHEMA, new Object(), map );
final String bundleType = BundleUtilities.getBundleType( repository );
final String bundleMapping = BundleUtilities.getBundleMapping( bundleType );
if ( bundleMapping == null ) {
throw new IllegalStateException( "Invalid configuration: No Bundle-Mapping for the bundle-type " + bundleType );
}
this.mainKey = new ResourceKey( bundleKey, INNER_SCHEMA, bundleMapping, null );
}