public void info(CharSequence msg) { info(msg, null); }
public void info(CharSequence msg) { info(msg, null); }
void prePassivate() { log.info("Evicting cache " + emitted); emitted.clear(); classCache.clear(); }
void prePassivate() { log.info("Evicting cache " + emitted); emitted.clear(); classCache.clear(); }
/** * @inheritDoc * @throws IllegalArgumentException if the originating element contains a null value */ public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException, IllegalArgumentException { // Gard against null element (java compiler is OK but ecj is not) for (Object originatingElement : originatingElements) { if (originatingElement == null) { throw new IllegalArgumentException("Originating elements contains a null element"); } } log.info("Creating source file for name=" + name + " elements=" + Arrays.asList(originatingElements)); return env.getFiler().createSourceFile(name, originatingElements); }
/** * @inheritDoc * @throws IllegalArgumentException if the originating element contains a null value */ public JavaFileObject createSourceFile(CharSequence name, Element... originatingElements) throws IOException, IllegalArgumentException { // Gard against null element (java compiler is OK but ecj is not) for (Object originatingElement : originatingElements) { if (originatingElement == null) { throw new IllegalArgumentException("Originating elements contains a null element"); } } log.info("Creating source file for name=" + name + " elements=" + Arrays.asList(originatingElements)); return env.getFiler().createSourceFile(name, originatingElements); }
/** * @inheritDoc * @throws IllegalArgumentException if the originating element contains a null value */ public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException, IllegalArgumentException { // Gard against null element (java compiler is OK but ecj is not) for (Object originatingElement : originatingElements) { if (originatingElement == null) { throw new IllegalArgumentException("Originating elements contains a null element"); } } log.info("Creating class file for name=" + name + " elements=" + Arrays.asList(originatingElements)); return env.getFiler().createClassFile(name, originatingElements); }
public void close() { if (state != null && state.size() > 0) { for (Iterator<Scoped> i = state.values().iterator();i.hasNext();) { Scoped scoped = i.next(); i.remove(); try { scoped.destroy(); } catch (Throwable t) { log.info("Error when destroying object", t); } } } } }
/** * @inheritDoc * @throws IllegalArgumentException if the originating element contains a null value */ public JavaFileObject createClassFile(CharSequence name, Element... originatingElements) throws IOException, IllegalArgumentException { // Gard against null element (java compiler is OK but ecj is not) for (Object originatingElement : originatingElements) { if (originatingElement == null) { throw new IllegalArgumentException("Originating elements contains a null element"); } } log.info("Creating class file for name=" + name + " elements=" + Arrays.asList(originatingElements)); return env.getFiler().createClassFile(name, originatingElements); }
public void close() { if (state != null && state.size() > 0) { for (Iterator<Scoped> i = state.values().iterator();i.hasNext();) { Scoped scoped = i.next(); i.remove(); try { scoped.destroy(); } catch (Throwable t) { log.info("Error when destroying object", t); } } } } }
@Override public void processAnnotationAdded(ModuleMetaModel metaModel, AnnotationKey key, AnnotationState added) { Name pkg = key.getElement().getPackageName(); log.info("Adding less annotation for package " + pkg); annotations.put(pkg, added); }
@Override public void processAnnotationRemoved(ModuleMetaModel metaModel, AnnotationKey key, AnnotationState removed) { Name pkg = key.getElement().getPackageName(); log.info("Removing less annotation for package " + pkg); annotations.remove(pkg); }
@Override public void processAnnotationRemoved(ModuleMetaModel metaModel, AnnotationKey key, AnnotationState removed) { Name pkg = key.getElement().getPackageName(); log.info("Removing less annotation for package " + pkg); annotations.remove(pkg); }
public FileObject createResource(JavaFileManager.Location location, Name pkg, CharSequence relativeName, Element... originatingElements) throws IOException { if (tool.getOverwriteReadingResource()) { Key key = new Key(location, pkg, relativeName.toString()); FileObject resource = resources != null ? resources.get(key) : null; if (resource == null) { log.info("Creating resource file for location=" + location + " pkg=" + pkg + " relativeName=" + relativeName + " elements=" + Arrays.asList(originatingElements)); resource = env.getFiler().createResource(location, pkg, relativeName, originatingElements); if (resources == null) { resources = new HashMap<Key, FileObject>(); } resources.put(new Key(location, pkg, relativeName.toString()), resource); } return resource; } else { return env.getFiler().createResource(location, pkg, relativeName, originatingElements); } }
@Override public void processAnnotationAdded(ModuleMetaModel metaModel, AnnotationKey key, AnnotationState added) { Name pkg = key.getElement().getPackageName(); log.info("Adding less annotation for package " + pkg); annotations.put(pkg, added); }
public FileObject createResource(JavaFileManager.Location location, Name pkg, CharSequence relativeName, Element... originatingElements) throws IOException { if (tool.getOverwriteReadingResource()) { Key key = new Key(location, pkg, relativeName.toString()); FileObject resource = resources != null ? resources.get(key) : null; if (resource == null) { log.info("Creating resource file for location=" + location + " pkg=" + pkg + " relativeName=" + relativeName + " elements=" + Arrays.asList(originatingElements)); resource = env.getFiler().createResource(location, pkg, relativeName, originatingElements); if (resources == null) { resources = new HashMap<Key, FileObject>(); } resources.put(new Key(location, pkg, relativeName.toString()), resource); } return resource; } else { return env.getFiler().createResource(location, pkg, relativeName, originatingElements); } }
@Override public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) { Iterable<? extends Completion> completions; // For now we don't provide completion when element is absent if (element != null) { // Get state (but we won't save it) log.info("Activating model"); state.metaModel.postActivate(getContext()); AnnotationKey annotationKey = new AnnotationKey(element, Name.parse(((TypeElement)annotation.getAnnotationType().asElement()).getQualifiedName().toString())); AnnotationState annotationState = AnnotationState.create(annotation); completions = state.context.getCompletions(annotationKey, annotationState, member.getSimpleName().toString(), userText); } else { completions = Collections.emptyList(); } return completions != null ? completions : Collections.<Completion>emptyList(); } }
@Override public Iterable<? extends Completion> getCompletions(Element element, AnnotationMirror annotation, ExecutableElement member, String userText) { Iterable<? extends Completion> completions; // For now we don't provide completion when element is absent if (element != null) { // Get state (but we won't save it) log.info("Activating model"); state.metaModel.postActivate(getContext()); AnnotationKey annotationKey = new AnnotationKey(element, Name.parse(((TypeElement)annotation.getAnnotationType().asElement()).getQualifiedName().toString())); AnnotationState annotationState = AnnotationState.create(annotation); completions = state.context.getCompletions(annotationKey, annotationState, member.getSimpleName().toString(), userText); } else { completions = Collections.emptyList(); } return completions != null ? completions : Collections.<Completion>emptyList(); } }
public ModuleContextImpl(Logger log, BridgeContext bridgeContext, ResourceResolver resolver) { // ModuleRuntime<?> lifeCycle; if (bridgeContext.getRunMode().isDynamic()) { ReadFileSystem<?> sourcePath = bridgeContext.getSourcePath(); log.info("Initializing live module at " + sourcePath.getDescription()); lifeCycle = new ModuleRuntime.Dynamic(log, Thread.currentThread().getContextClassLoader(), sourcePath); } else { log.info("Initializing module in " + bridgeContext.getRunMode().name().toLowerCase() + " mode"); ReadFileSystem<?> classPath = bridgeContext.getClassPath(); lifeCycle = new ModuleRuntime.Static(log, Thread.currentThread().getContextClassLoader(), classPath); } // this.bridgeContext = bridgeContext; this.resolver = resolver; this.runtime = lifeCycle; }
public ModuleContextImpl(Logger log, BridgeContext bridgeContext, ResourceResolver resolver) { // ModuleRuntime<?> lifeCycle; if (bridgeContext.getRunMode().isDynamic()) { ReadFileSystem<?> sourcePath = bridgeContext.getSourcePath(); log.info("Initializing live module at " + sourcePath.getDescription()); lifeCycle = new ModuleRuntime.Dynamic(log, Thread.currentThread().getContextClassLoader(), sourcePath); } else { log.info("Initializing module in " + bridgeContext.getRunMode().name().toLowerCase() + " mode"); ReadFileSystem<?> classPath = bridgeContext.getClassPath(); lifeCycle = new ModuleRuntime.Static(log, Thread.currentThread().getContextClassLoader(), classPath); } // this.bridgeContext = bridgeContext; this.resolver = resolver; this.runtime = lifeCycle; }