MCPcopy Create free account
hub / github.com/BaseXdb/basex / cache

Method cache

basex-api/src/main/java/org/basex/http/web/WebModules.java:324–344  ·  view source on GitHub ↗

Returns the module cache. @param ctx database context @return module cache @throws QueryException query exception @throws IOException I/O exception

(final Context ctx)

Source from the content-addressed store, hash-verified

322 * @throws IOException I/O exception
323 */
324 private synchronized HashMap<String, WebModule> cache(final Context ctx)
325 throws QueryException, IOException {
326
327 final HashMap<String, WebModule> cache;
328 if(parsed) {
329 // module cache is still up-to-date
330 cache = modules;
331 } else {
332 // module cache needs to be updated
333 if(!path.exists()) throw HTTPStatus.NO_RESTXQ_DIRECTORY.get();
334
335 cache = new HashMap<>();
336 parse(ctx, path, cache, modules);
337 modules = cache;
338 parsed = true;
339 }
340
341 // update last access time
342 access = System.currentTimeMillis();
343 return cache;
344 }
345
346 /**
347 * Parses the specified path for modules with relevant annotations and caches new entries.

Callers 3

wadlMethod · 0.95
findMethod · 0.95
findWsMethod · 0.95

Calls 3

parseMethod · 0.95
getMethod · 0.65
existsMethod · 0.45

Tested by

no test coverage detected