/** Get the MultiTaskListener instance for this context. */ public static MultiTaskListener instance(Context context) { MultiTaskListener instance = context.get(taskListenerKey); if (instance == null) instance = new MultiTaskListener(context); return instance; }
public Collection<TaskListener> getTaskListeners() { MultiTaskListener mtl = MultiTaskListener.instance(context); return mtl.getTaskListeners(); }
if (!taskListener.isEmpty()) { for (JCCompilationUnit unit: roots) { TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit); taskListener.started(e); if (!taskListener.isEmpty()) { for (JCCompilationUnit unit: roots) { TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit); taskListener.finished(e);
unmatchedProcessorOptions = initUnmatchedProcessorOptions(); messages = JavacMessages.instance(context); taskListener = MultiTaskListener.instance(context); initProcessorClassLoader();
if (!taskListener.isEmpty()) { for (JCCompilationUnit unit: roots) { TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit); taskListener.started(e); if (!taskListener.isEmpty()) { for (JCCompilationUnit unit: roots) { TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit); taskListener.finished(e);
unmatchedProcessorOptions = initUnmatchedProcessorOptions(); messages = JavacMessages.instance(context); taskListener = MultiTaskListener.instance(context); initProcessorClassLoader();
/** Run a processing round. */ void run(boolean lastRound, boolean errorStatus) { printRoundInfo(lastRound); if (!taskListener.isEmpty()) taskListener.started(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); try { if (lastRound) { filer.setLastRound(true); Set<Element> emptyRootElements = Collections.emptySet(); // immutable RoundEnvironment renv = new JavacRoundEnvironment(true, errorStatus, emptyRootElements, JavacProcessingEnvironment.this); discoveredProcs.iterator().runContributingProcs(renv); } else { discoverAndRunProcs(context, annotationsPresent, topLevelClasses, packageInfoFiles); } } catch (Throwable t) { // we're specifically expecting Abort here, but if any Throwable // comes by, we should flush all deferred diagnostics, rather than // drop them on the ground. deferredDiagnosticHandler.reportDeferredDiagnostics(); log.popDiagnosticHandler(deferredDiagnosticHandler); throw t; } finally { if (!taskListener.isEmpty()) taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING_ROUND)); } }
@Override public synchronized void init( ProcessingEnvironment processingEnv ) { Context context = ((JavacProcessingEnvironment) processingEnv).getContext(); MultiTaskListener listener = MultiTaskListener.instance( context ); // Listen to the compilation phases so that we can insert ourselves in the ANALYZE step later listener.add( new ReplaceOnAnalyzeTaskListener( context ) ); super.init( processingEnv ); }