Groovy Documentation

org.grails.plugin.resource.util
[Groovy] Class ResourceMetaStore

java.lang.Object
  org.grails.plugin.resource.util.ResourceMetaStore

class ResourceMetaStore

A special URI -> ResourceMeta store that is non-reentrant and will create entries on demand, causing other threads to wait until the resource has been created if creation has already started

Authors:
Marc Palmer (marc@grailsrocks.com)


Property Summary
static java.lang.Object CLOSED_LATCH

java.util.Map latches

java.lang.Object log

java.util.Map resourcesByURI

 
Constructor Summary
ResourceMetaStore()

 
Method Summary
void addDeclaredResource(groovy.lang.Closure resourceCreator)

Note that this is not re-entrant safe, and is only to be called at app startup, before requests come in

private java.lang.Object addResource(java.lang.Object resource, boolean adHocResource = false)

void evict(java.lang.String uri)

For development reloading only, evict the meta for a URI so that we can regenerate it

java.lang.Object getAt(java.lang.String key)

ResourceMeta getOrCreateAdHocResource(java.lang.String uri, groovy.lang.Closure resourceCreator)

A threadsafe synchronous method to get an existing resource or create an ad-hoc resource

java.lang.Object keySet()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

CLOSED_LATCH

static java.lang.Object CLOSED_LATCH


latches

java.util.Map latches


log

java.lang.Object log


resourcesByURI

java.util.Map resourcesByURI


 
Constructor Detail

ResourceMetaStore

ResourceMetaStore()


 
Method Detail

addDeclaredResource

void addDeclaredResource(groovy.lang.Closure resourceCreator)
Note that this is not re-entrant safe, and is only to be called at app startup, before requests come in


addResource

private java.lang.Object addResource(java.lang.Object resource, boolean adHocResource = false)


evict

void evict(java.lang.String uri)
For development reloading only, evict the meta for a URI so that we can regenerate it


getAt

java.lang.Object getAt(java.lang.String key)


getOrCreateAdHocResource

ResourceMeta getOrCreateAdHocResource(java.lang.String uri, groovy.lang.Closure resourceCreator)
A threadsafe synchronous method to get an existing resource or create an ad-hoc resource


keySet

java.lang.Object keySet()


 

Groovy Documentation