+ private static final LoadingCache<ClassLoadingStrategy,
+ LoadingCache<ImmutableSet<YangModuleInfo>, ModuleInfoBackedContext>> CONTEXT_CACHES = CacheBuilder.newBuilder()
+ .weakKeys().build(new CacheLoader<ClassLoadingStrategy,
+ LoadingCache<ImmutableSet<YangModuleInfo>, ModuleInfoBackedContext>>() {
+ @Override
+ public LoadingCache<ImmutableSet<YangModuleInfo>, ModuleInfoBackedContext> load(
+ final ClassLoadingStrategy strategy) {
+ return CacheBuilder.newBuilder().weakValues().build(
+ new CacheLoader<Set<YangModuleInfo>, ModuleInfoBackedContext>() {
+ @Override
+ public ModuleInfoBackedContext load(final Set<YangModuleInfo> key) {
+ final ModuleInfoBackedContext context = ModuleInfoBackedContext.create(strategy);
+ context.addModuleInfos(key);
+ return context;
+ }
+ });
+ }
+ });
+