/** * Creates a ResourceKey that carries the given Loader-Parameters contained in the optional map. * * @param data the key-data * @param parameters an optional map of parameters. * @return the generated resource-key, never null. * @throws ResourceKeyCreationException if the key-creation failed. */ public ResourceKey createKey( final Object data, final Map<? extends ParameterKey, ? extends Object> parameters ) throws ResourceKeyCreationException { return backend.createKey( data, parameters ); }
/** * Derives a new key from the given resource-key. Only keys for a hierarchical storage system (like file-systems or * URLs) can have derived keys. Since LibLoader 0.3.0 only hierarchical keys can be derived. For that, the deriving * path must be given as String. * <p/> * The optional parameter-map will be applied to the derived key after the parent's parameters have been copied to the * new key. * <p/> * Before trying to derive the key, the system tries to interpret the path as absolute key-value. * * @param parent the parent key, or null to interpret the path as absolute key. * @param path the relative path, that is used to derive the key. * @param parameters a optional map containing resource-key parameters. * @return the derived key. * @throws ResourceKeyCreationException if deriving the key failed. */ public ResourceKey deriveKey( final ResourceKey parent, final String path, final Map<? extends ParameterKey, ? extends Object> parameters ) throws ResourceKeyCreationException { return backend.deriveKey( parent, path, parameters ); }
public Resource create( final ResourceManager frontEnd, final ResourceData data, final ResourceKey context, final Class[] target ) throws ResourceLoadingException, ResourceCreationException { if ( frontEnd == null ) { throw new NullPointerException(); } if ( data == null ) { throw new NullPointerException(); } return backend.create( frontEnd, data, context, target ); }
doReturn( contentBase ).when( elem ).getContentBase(); doReturn( elementSource ).when( elem ).getDefinitionSource(); doReturn( elementSource ).when( resourceManagerBackend ).deriveKey( contentBase, "attr_0", null ); doReturn( elementSource ).when( resourceManagerBackend ).createKey( "attr_0", null );
if ( backend.isResourceUnchanged( this, resource ) ) { final ResourceBundleData resourceBundleData = (ResourceBundleData) loadedData; final ResourceManager derivedManager = resourceBundleData.deriveManager( this ); newResource = backend.create( derivedManager, resourceBundleData, context, target ); if ( isResourceCacheable( newResource ) ) { if ( EHCacheModule.CACHE_MONITOR.isDebugEnabled() ) { newResource = backend.create( this, loadedData, context, target ); if ( isResourceCacheable( newResource ) ) { if ( EHCacheModule.CACHE_MONITOR.isDebugEnabled() ) {
public void registerFactory( final ResourceFactory factory ) { backend.registerFactory( factory ); }
/** * Converts a serialized version of a <code>ResourceKey</code> into an actual <code>ResourceKey</code> by locating the * proper <code>ResourceLoader</code> that can perform the deserialization. * * @param serializedKey the String serialized key to be deserialized * @return the <code>ResourceKey</code> that has been deserialized * @throws ResourceKeyCreationException indicates an error trying to create the <code>ResourceKey</code> from the * deserialized version */ public ResourceKey deserialize( final ResourceKey bundleKey, final String serializedKey ) throws ResourceKeyCreationException { return backend.deserialize( bundleKey, serializedKey ); }
public void registerBundleLoader( final ResourceBundleLoader loader ) { backend.registerBundleLoader( loader ); }
public void registerDefaultLoaders() { backend.registerDefaultLoaders(); }
public ResourceBundleData loadResourceBundle( final ResourceManager frontEnd, final ResourceKey key ) throws ResourceLoadingException { if ( frontEnd == null ) { throw new NullPointerException(); } if ( key == null ) { throw new NullPointerException(); } if ( loader.isSupportedKey( key ) ) { return loader.loadBundle( frontEnd, key ); } return backend.loadResourceBundle( frontEnd, key ); }
public ResourceData loadRawData( final ResourceManager frontEnd, final ResourceKey key ) throws ResourceLoadingException, UnrecognizedLoaderException { return backend.loadRawData( frontEnd, key ); }
public void registerDefaultFactories() { backend.registerDefaultFactories(); }
Mockito.doReturn( elementSource ).when( element ) .getAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE ); Mockito.doReturn( elementSource ).when( resourceManagerBackend ).deriveKey( contentBase, "attr_0", null ); Mockito.doReturn( elementSource ).when( resourceManagerBackend ).createKey( "attr_0", null );
public void registerFactory( final ResourceFactory factory ) { if ( factory == null ) { throw new NullPointerException(); } backend.registerFactory( factory ); }
public ResourceKey deserialize( final ResourceKey bundleKey, final String serializedKey ) throws ResourceKeyCreationException { if ( loader.isSupportedDeserializer( serializedKey ) ) { return loader.deserialize( bundleKey, serializedKey ); } return backend.deserialize( bundleKey, serializedKey ); }
public void registerBundleLoader( final ResourceBundleLoader loader ) { if ( loader == null ) { throw new NullPointerException(); } backend.registerBundleLoader( loader ); }
public void registerDefaultLoaders() { backend.registerDefaultLoaders(); }
final ResourceBundleData data = backend.loadResourceBundle( this, key ); if ( data != null && isResourceDataCacheable( data ) ) { bundleCache.put( this, data );
public synchronized ResourceData loadRawData( final ResourceKey key ) throws UnrecognizedLoaderException, ResourceLoadingException { final ResourceDataCache dataCache = getDataCache(); // Alternative 3: This is a plain resource and not contained in a bundle. Load as binary data final ResourceDataCacheEntry cached = dataCache.get( key ); if ( cached != null ) { final ResourceData data = cached.getData(); if ( data != null ) { if ( isValidData( cached, data ) ) { return data; } dataCache.remove( data ); } } final ResourceData data = backend.loadRawData( this, key ); if ( data != null && isResourceDataCacheable( data ) ) { dataCache.put( this, data ); } return data; }
public void registerDefaultFactories() { backend.registerDefaultFactories(); }