Klasse AjPipeliningCompilerAdapter
java.lang.Object
org.aspectj.ajdt.internal.compiler.AbstractCompilerAdapter
org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter
- Alle implementierten Schnittstellen:
ICompilerAdapter
Adapts standard JDT Compiler to add in AspectJ specific behaviours. This version implements pipelining - where files are compiled
and then woven immediately, unlike AjCompilerAdapter which compiles everything then weaves everything. (One small note: because
all aspects have to be known before weaving can take place, the weaving pipeline is 'stalled' until all aspects have been
compiled).
The basic strategy is this:
1. diet parse all input source files - this is enough for us to implement ITD matching - this enables us to determine which are
aspects 2. sort the input files, aspects first - keep a note of how many files contain aspects 3. if there are aspects, mark the
pipeline as 'stalled' 3. repeat 3a. compile a file 3b. have we now compiled all aspects? NO - put file in a weave pending queue
YES- unstall the 'pipeline' 3c. is the pipeline stalled? NO - weave all pending files and this one YES- do nothing
Complexities arise because of: - what does -XterminateAfterCompilation mean? since there is no stage where everything is compiled
and nothing is woven
Here is the compiler loop difference when pipelining.
the old way: Finished diet parsing [C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java] Finished diet parsing
[C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java] > AjLookupEnvironment.completeTypeBindings() <
AjLookupEnvironment.completeTypeBindings() compiling C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java
>Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java)
<Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java) compiling
C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java
>Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java)
<Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) >AjCompilerAdapter.weave()
>BcelWeaver.prepareForWeave <BcelWeaver.prepareForWeave woven class ClassOne (from
C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java) woven class ClassTwo (from
C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) <AjCompilerAdapter.weave()
the new way (see the compiling/weaving mixed up): Finished diet parsing
[C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java] Finished diet parsing
[C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java] >AjLookupEnvironment.completeTypeBindings()
<AjLookupEnvironment.completeTypeBindings() compiling C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java
>Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java)
<Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java) >AjCompilerAdapter.weave()
>BcelWeaver.prepareForWeave <BcelWeaver.prepareForWeave woven class ClassOne (from
C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassOne.java) <AjCompilerAdapter.weave() compiling
C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java
>Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java)
<Compiler.process(C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) >AjCompilerAdapter.weave() woven class ClassTwo
(from C:\temp\ajcSandbox\aspectjhead\ajcTest23160.tmp\ClassTwo.java) Ungültige Eingabe: "<"AjCompilerAdapter.weave()
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic booleanSECRET: FOR TESTING - this can be used to collect information that tests can verify. -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungAjPipeliningCompilerAdapter(Compiler compiler, boolean isBatchCompile, BcelWorld world, BcelWeaver weaver, EclipseFactory eFactory, IIntermediateResultsRequestor intRequestor, IProgressListener progressListener, IOutputClassFileNameProvider outputFileNameProvider, IBinarySourceProvider binarySourceProvider, Map fullBinarySourceEntries, boolean isXterminateAfterCompilation, boolean proceedOnError, boolean noAtAspectJProcessing, boolean makeReflectable, AjState incrementalCompilationState) Create an adapter, and tell it everything it needs to now to drive the AspectJ parts of a compile cycle. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidacceptResult(CompilationResult result) voidvoidafterCompiling(CompilationUnitDeclaration[] units) voidIn a pipelining compilation system, we need to ensure aspects are through the pipeline first.voidvoidafterProcessing(CompilationUnitDeclaration unit, int unitIndex) voidvoidvoidbeforeCompiling(ICompilationUnit[] sourceUnits) voidvoidvoidstatic String
-
Felddetails
-
pipelineTesting
public static boolean pipelineTestingSECRET: FOR TESTING - this can be used to collect information that tests can verify. -
pipelineOutput
-
-
Konstruktordetails
-
AjPipeliningCompilerAdapter
public AjPipeliningCompilerAdapter(Compiler compiler, boolean isBatchCompile, BcelWorld world, BcelWeaver weaver, EclipseFactory eFactory, IIntermediateResultsRequestor intRequestor, IProgressListener progressListener, IOutputClassFileNameProvider outputFileNameProvider, IBinarySourceProvider binarySourceProvider, Map fullBinarySourceEntries, boolean isXterminateAfterCompilation, boolean proceedOnError, boolean noAtAspectJProcessing, boolean makeReflectable, AjState incrementalCompilationState) Create an adapter, and tell it everything it needs to now to drive the AspectJ parts of a compile cycle.- Parameter:
compiler- the JDT compiler that produces class files from sourceisBatchCompile- true if this is a full build (non-incremental)world- the bcelWorld used for type resolution during weavingweaver- the weaverintRequestor- recipient of interim compilation results from compiler (pre-weave)outputFileNameProvider- implementor of a strategy providing output file names for resultsbinarySourceProvider- binary source that we didn't compile, but that we need to weaveincrementalCompilationState- if we are doing an incremental build, and the weaver determines that we need to weave the world, this is the set of intermediate results that will be passed to the weaver.
-
-
Methodendetails
-
afterDietParsing
In a pipelining compilation system, we need to ensure aspects are through the pipeline first. Only when they are all through (and therefore we know about all static/dynamic crosscutting) can be proceed to weave anything. Effectively the weaving part of the pipeline stalls until all the aspects have been fully compiled. This method sorts the compilation units such that any containing aspects are fully compiled first and it keeps a note on how long it should stall the pipeline before commencing weaving.- Angegeben von:
afterDietParsingin SchnittstelleICompilerAdapter- Angegeben von:
afterDietParsingin KlasseAbstractCompilerAdapter
-
beforeCompiling
- Angegeben von:
beforeCompilingin SchnittstelleICompilerAdapter- Angegeben von:
beforeCompilingin KlasseAbstractCompilerAdapter
-
beforeProcessing
- Angegeben von:
beforeProcessingin SchnittstelleICompilerAdapter- Angegeben von:
beforeProcessingin KlasseAbstractCompilerAdapter
-
beforeResolving
- Angegeben von:
beforeResolvingin SchnittstelleICompilerAdapter- Angegeben von:
beforeResolvingin KlasseAbstractCompilerAdapter
-
afterResolving
- Angegeben von:
afterResolvingin SchnittstelleICompilerAdapter- Angegeben von:
afterResolvingin KlasseAbstractCompilerAdapter
-
beforeAnalysing
- Angegeben von:
beforeAnalysingin SchnittstelleICompilerAdapter- Angegeben von:
beforeAnalysingin KlasseAbstractCompilerAdapter
-
afterAnalysing
- Angegeben von:
afterAnalysingin SchnittstelleICompilerAdapter- Angegeben von:
afterAnalysingin KlasseAbstractCompilerAdapter
-
beforeGenerating
- Angegeben von:
beforeGeneratingin SchnittstelleICompilerAdapter- Angegeben von:
beforeGeneratingin KlasseAbstractCompilerAdapter
-
afterGenerating
- Angegeben von:
afterGeneratingin SchnittstelleICompilerAdapter- Angegeben von:
afterGeneratingin KlasseAbstractCompilerAdapter
-
afterCompiling
- Angegeben von:
afterCompilingin SchnittstelleICompilerAdapter- Angegeben von:
afterCompilingin KlasseAbstractCompilerAdapter
-
afterProcessing
- Angegeben von:
afterProcessingin SchnittstelleICompilerAdapter- Angegeben von:
afterProcessingin KlasseAbstractCompilerAdapter
-
acceptResult
- Angegeben von:
acceptResultin KlasseAbstractCompilerAdapter
-
getPipelineDebugOutput
-
getResultsPendingWeave
- Angegeben von:
getResultsPendingWeavein KlasseAbstractCompilerAdapter
-