public class ParamsCache extends Object implements org.springframework.context.ApplicationContextAware
ParamsHelper which maintains an
OriginalFile ID+SHA1-to-JobParams mapping in memory rather
than storing ParseJob instances in the database. All scripts are read once on
start and them subsequently based on the omero.scripts.cache.cron setting.
JobParams instances may be removed from the cache based on the
omero.scripts.cache.spec setting. If a key is not present in the cache on
#getParams(String) then an attempt will be made to load it. Any
exceptions thrown will be propagated to the caller.| Constructor and Description |
|---|
ParamsCache(Registry reg,
Roles roles,
ScriptRepoHelper scripts,
String spec) |
| Modifier and Type | Method and Description |
|---|---|
omero.grid.JobParams |
getParams(Long id,
String sha1,
Ice.Current curr)
Lookup a cached
JobParams instance for the given key. |
omero.grid.JobParams |
lookup(ome.services.blitz.util.ParamsCache.Key key)
Called by the
LoadingCache when a cache-miss occurs. |
void |
lookupAll()
Called from a Quartz cron trigger for periodically reloading all scripts.
|
void |
removeParams(Long id)
Remove a cached
JobParams instance. |
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx)
Set the ApplicationContext that this object runs in.
|
public ParamsCache(Registry reg, Roles roles, ScriptRepoHelper scripts, String spec)
public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
throws org.springframework.beans.BeansException
org.springframework.context.ApplicationContextAwareInvoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader),
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) and
MessageSourceAware, if applicable.
setApplicationContext in interface org.springframework.context.ApplicationContextAwarectx - the ApplicationContext object to be used by this objectorg.springframework.context.ApplicationContextException - in case of context initialization errorsorg.springframework.beans.BeansException - if thrown by application context methodsBeanInitializationExceptionpublic omero.grid.JobParams getParams(Long id, String sha1, Ice.Current curr) throws Ice.UserException
JobParams instance for the given key. If none
is present, then an attempt will be made to load one, possibly throwing
a UserException.key - Ice.UserExceptionpublic void removeParams(Long id)
JobParams instance.public omero.grid.JobParams lookup(ome.services.blitz.util.ParamsCache.Key key)
throws Exception
LoadingCache when a cache-miss occurs.Exception
Version: 5.1.3-ice35-b52
Copyright © 2015 The University of Dundee & Open Microscopy Environment. All Rights Reserved.