public TypeSystemAwareCache( IManifoldHost host, String name, int size, Loader<K, V> loader ) { super( name, size, loader ); host.addTypeSystemListenerAsWeakRef( null, _cacheClearer ); }
public PathCache( IModule module, Supplier<Collection<IDirectory>> pathSupplier, Runnable clearHandler ) { _module = module; _pathSupplier = pathSupplier; _clearHandler = clearHandler; _reverseMap = new ConcurrentHashMap<>(); init(); _module.getHost().addTypeSystemListenerAsWeakRef( module, _clearer = new CacheClearer() ); }
private ClassSymbols( IModule module ) _module.getHost().addTypeSystemListenerAsWeakRef( module, new CacheClearer() ); _altJavacTask_PlainFileMgr = LocklessLazyVar.make( () -> { init();
/** * @param module The module passed into the ISourceProvider implementation constructor * @param modelMapper A function to provide a model given a qualified name and resource file */ protected void init( IModule module, BiFunction<String, Set<IFile>, M> modelMapper ) { _module = module; _modelMapper = modelMapper; _fqnToModel = LocklessLazyVar.make( this::buildFqnToModelCache ); getModule().getHost().addTypeSystemListenerAsWeakRef( getModule(), _cacheClearer = createCacheClearer() ); }
ManifoldJavaFileManager( IManifoldHost host, JavaFileManager fileManager, Context ctx, boolean fromJavaC ) { super( fileManager, ctx == null ? ctx = new Context() : ctx ); _host = host; _ctx = ctx; _fromJavaC = fromJavaC; _classFiles = new FqnCache<>(); _generatedFiles = new FqnCache<>(); if( ctx.get(JavaFileManager.class) == null ) { ctx.put( JavaFileManager.class, fileManager ); } _host.addTypeSystemListenerAsWeakRef( null, this ); }