|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfnug.resource.ResourceResolver
public class ResourceResolver
Entry point for resource resolving. Comprised of a number of Bundle
that are created using Config
.
Constructor Summary | |
---|---|
protected |
ResourceResolver()
Empty constructor for test cases. |
|
ResourceResolver(List<Resource> configResources)
Constructs a resolver from the given list of resources pointing out config files. |
Method Summary | |
---|---|
boolean |
checkModified()
Checks if any of the config resources passed in the constructor is changed, in which case the resolver reinitialises all bundles. |
Bundle |
getBundle(String name)
Returns the bundle for the given bundle name. |
List<Bundle> |
getBundles()
Returns a list of all configured bundles. |
GlobalConfig |
getGlobalConfig()
Returns the global config object. |
static ResourceResolver |
getInstance()
Returns the thread associated instance. |
long |
getLastModified()
Returns the last modified date of all the configured bundles, see Bundle.getLastModified() . |
Resource |
resolve(String path)
Resolves the give path. |
protected void |
setConfigs(Config... configs)
Sets the configs to use. |
void |
setThreadLocal()
Must be called before using the ResourceResolver to bind this instance of the resolver to the currently
executing thread. |
protected static void |
setThreadLocal(ResourceResolver resolver)
Sets the thread local instance to use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceResolver(List<Resource> configResources)
Config
by a ConfigParser
.
configResources
- resources to configure from.protected ResourceResolver()
Method Detail |
---|
public void setThreadLocal()
ResourceResolver
to bind this instance of the resolver to the currently
executing thread.
protected static void setThreadLocal(ResourceResolver resolver)
resolver
- Resolver to use.public static ResourceResolver getInstance()
protected void setConfigs(Config... configs)
configs
- configs to use.public Resource resolve(String path)
/mybundle/myresource.js
would be matched against a bundle named mybundle
.
path
- Path to match.
public Bundle getBundle(String name)
name
- name of the bundle
public List<Bundle> getBundles()
public long getLastModified()
Bundle.getLastModified()
.
public boolean checkModified()
public GlobalConfig getGlobalConfig()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |