public ResourceManager deriveManager( final ResourceManager parent ) throws ResourceLoadingException { return new ResourceManager( parent, new BundleResourceManagerBackend( repository, parent.getBackend(), bundleKey ) ); } }
public StaticDocumentBundle( final Repository repository, final ResourceManager resourceManager, final ResourceKey outsideContextKey ) throws ResourceException { if ( repository == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } this.repository = repository; final BundleResourceManagerBackend backend = new BundleResourceManagerBackend( repository, resourceManager.getBackend(), outsideContextKey ); this.bundleKey = backend.getBundleMainKey(); this.resourceManager = new ResourceManager( resourceManager, backend ); this.documentMetaData = new StaticDocumentMetaData( this.resourceManager, this.bundleKey ); }
public ResourceKey deriveKey( final ResourceKey parent, final String path, final Map<? extends ParameterKey, ? extends Object> parameters ) throws ResourceKeyCreationException { if ( parent == null ) { if ( path == null ) { throw new NullPointerException(); } return createKey( path, parameters ); } if ( loader.isSupportedKey( parent ) ) { try { return loader.deriveKey( parent, path, parameters ); } catch ( ResourceKeyCreationException rkce ) { ResourceKey context = computeContextKey( parent ); while ( context != null ) { try { return backend.deriveKey( context, path, parameters ); } catch ( ResourceKeyCreationException rkce2 ) { rkce = rkce2; // ignore ... we are just guessing ... } context = computeContextKey( context ); } throw rkce; } } return backend.deriveKey( parent, path, parameters ); }
public MemoryDocumentBundle( final ResourceKey parent ) { this.zipRepository = new ZipRepository(); this.metaData = new MemoryDocumentMetaData(); final ResourceManager defaultResourceManager = new ResourceManager(); final BundleResourceManagerBackend backend = new BundleResourceManagerBackend( zipRepository, defaultResourceManager.getBackend(), parent ); this.bundleKey = backend.getBundleMainKey(); this.resourceManager = new ResourceManager( defaultResourceManager, backend ); }