|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.resourceloader.ResourceManager
public class ResourceManager
The resource manager takes care about the loaded resources, performs caching, if needed and is the central instance
when dealing with resources. Resource loading is a two-step process. In the first step, the ResourceLoader
accesses the physical storage or network connection to read in the binary data. The loaded ResourceData
carries versioning information with it an can be cached indendently from the produced result. Once the loading is
complete, a ResourceFactory
interprets the binary data and produces a Java-Object from it.
ResourceData
,
ResourceLoader
,
ResourceFactory
Field Summary | |
---|---|
static java.lang.String |
DATA_CACHE_PROVIDER_KEY
|
static java.lang.String |
FACTORY_CACHE_PROVIDER_KEY
|
Constructor Summary | |
---|---|
ResourceManager()
|
Method Summary | |
---|---|
Resource |
create(ResourceKey key,
ResourceKey context)
|
Resource |
create(ResourceKey key,
ResourceKey context,
java.lang.Class target)
|
Resource |
create(ResourceKey key,
ResourceKey context,
java.lang.Class[] target)
|
Resource |
createDirectly(java.lang.Object keyValue,
java.lang.Class target)
|
ResourceKey |
createKey(java.lang.Object data)
Creates a ResourceKey that carries no Loader-Parameters from the given object. |
ResourceKey |
createKey(java.lang.Object data,
java.util.Map parameters)
Creates a ResourceKey that carries the given Loader-Parameters contained in the optional map. |
ResourceKey |
deriveKey(ResourceKey parent,
java.lang.String path)
Derives a new key from the given resource-key. |
ResourceKey |
deriveKey(ResourceKey parent,
java.lang.String path,
java.util.Map parameters)
Derives a new key from the given resource-key. |
org.jfree.resourceloader.cache.ResourceDataCache |
getDataCache()
|
org.jfree.resourceloader.cache.ResourceFactoryCache |
getFactoryCache()
|
ResourceData |
load(ResourceKey key)
|
void |
registerDataCache()
|
void |
registerDefaultFactories()
|
void |
registerDefaultLoaders()
|
void |
registerDefaults()
|
void |
registerFactory(ResourceFactory factory)
|
void |
registerFactoryCache()
|
void |
registerLoader(ResourceLoader loader)
|
void |
setDataCache(org.jfree.resourceloader.cache.ResourceDataCache dataCache)
|
void |
setFactoryCache(org.jfree.resourceloader.cache.ResourceFactoryCache factoryCache)
|
java.net.URL |
toURL(ResourceKey key)
Tries to convert the resource-key into an URL. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DATA_CACHE_PROVIDER_KEY
public static final java.lang.String FACTORY_CACHE_PROVIDER_KEY
Constructor Detail |
---|
public ResourceManager()
Method Detail |
---|
public ResourceKey createKey(java.lang.Object data) throws ResourceKeyCreationException
data
- the key-data
ResourceKeyCreationException
- if the key-creation failed.public ResourceKey createKey(java.lang.Object data, java.util.Map parameters) throws ResourceKeyCreationException
data
- the key-dataparameters
- an optional map of parameters.
ResourceKeyCreationException
- if the key-creation failed.public ResourceKey deriveKey(ResourceKey parent, java.lang.String path) throws ResourceKeyCreationException
parent
- the parent key, must never be nullpath
- the relative path, that is used to derive the key.
ResourceKeyCreationException
public ResourceKey deriveKey(ResourceKey parent, java.lang.String path, java.util.Map parameters) throws ResourceKeyCreationException
parent
- the parent key, or null to interpret the path as absolute key.path
- the relative path, that is used to derive the key.
ResourceKeyCreationException
public java.net.URL toURL(ResourceKey key)
key
- the resource-key
public ResourceData load(ResourceKey key) throws ResourceLoadingException
ResourceLoadingException
public Resource createDirectly(java.lang.Object keyValue, java.lang.Class target) throws ResourceLoadingException, ResourceCreationException, ResourceKeyCreationException
ResourceLoadingException
ResourceCreationException
ResourceKeyCreationException
public Resource create(ResourceKey key, ResourceKey context, java.lang.Class target) throws ResourceLoadingException, ResourceCreationException
ResourceLoadingException
ResourceCreationException
public Resource create(ResourceKey key, ResourceKey context) throws ResourceLoadingException, ResourceCreationException
ResourceLoadingException
ResourceCreationException
public Resource create(ResourceKey key, ResourceKey context, java.lang.Class[] target) throws ResourceLoadingException, ResourceCreationException
ResourceLoadingException
ResourceCreationException
public org.jfree.resourceloader.cache.ResourceDataCache getDataCache()
public void setDataCache(org.jfree.resourceloader.cache.ResourceDataCache dataCache)
public org.jfree.resourceloader.cache.ResourceFactoryCache getFactoryCache()
public void setFactoryCache(org.jfree.resourceloader.cache.ResourceFactoryCache factoryCache)
public void registerDefaults()
public void registerDefaultFactories()
public void registerDataCache()
public void registerFactoryCache()
public void registerDefaultLoaders()
public void registerLoader(ResourceLoader loader)
public void registerFactory(ResourceFactory factory)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |