public void setup(Context context) {
_javascript.setupJavascript(context.getConfiguration().get("arguments"), context, context);
_javascript._engine.put("_query", context.getConfiguration().get("mongo.input.query"));
// Set up cache if one is specified
InfiniteMongoConfig config = new InfiniteMongoConfig(context.getConfiguration());
BasicDBList caches = config.getCacheList();
if ((null != caches) && !caches.isEmpty()) {
try {
CacheUtils.addJSONCachesToEngine(caches, _javascript._engine, _javascript._secManager, (config.getLimit() > 0));
} catch (Exception e) {
throw new RuntimeException("Error setting up caches: " + caches);
}
}
}