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
Modifizierer und TypFeldBeschreibungstatic boolean
SECRET: FOR TESTING - this can be used to collect information that tests can verify. -
Konstruktorübersicht
KonstruktorBeschreibungAjPipeliningCompilerAdapter
(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 TypMethodeBeschreibungvoid
acceptResult
(CompilationResult result) void
void
afterCompiling
(CompilationUnitDeclaration[] units) void
In a pipelining compilation system, we need to ensure aspects are through the pipeline first.void
void
afterProcessing
(CompilationUnitDeclaration unit, int unitIndex) void
void
void
beforeCompiling
(ICompilationUnit[] sourceUnits) void
void
void
static 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:
afterDietParsing
in SchnittstelleICompilerAdapter
- Angegeben von:
afterDietParsing
in KlasseAbstractCompilerAdapter
-
beforeCompiling
- Angegeben von:
beforeCompiling
in SchnittstelleICompilerAdapter
- Angegeben von:
beforeCompiling
in KlasseAbstractCompilerAdapter
-
beforeProcessing
- Angegeben von:
beforeProcessing
in SchnittstelleICompilerAdapter
- Angegeben von:
beforeProcessing
in KlasseAbstractCompilerAdapter
-
beforeResolving
- Angegeben von:
beforeResolving
in SchnittstelleICompilerAdapter
- Angegeben von:
beforeResolving
in KlasseAbstractCompilerAdapter
-
afterResolving
- Angegeben von:
afterResolving
in SchnittstelleICompilerAdapter
- Angegeben von:
afterResolving
in KlasseAbstractCompilerAdapter
-
beforeAnalysing
- Angegeben von:
beforeAnalysing
in SchnittstelleICompilerAdapter
- Angegeben von:
beforeAnalysing
in KlasseAbstractCompilerAdapter
-
afterAnalysing
- Angegeben von:
afterAnalysing
in SchnittstelleICompilerAdapter
- Angegeben von:
afterAnalysing
in KlasseAbstractCompilerAdapter
-
beforeGenerating
- Angegeben von:
beforeGenerating
in SchnittstelleICompilerAdapter
- Angegeben von:
beforeGenerating
in KlasseAbstractCompilerAdapter
-
afterGenerating
- Angegeben von:
afterGenerating
in SchnittstelleICompilerAdapter
- Angegeben von:
afterGenerating
in KlasseAbstractCompilerAdapter
-
afterCompiling
- Angegeben von:
afterCompiling
in SchnittstelleICompilerAdapter
- Angegeben von:
afterCompiling
in KlasseAbstractCompilerAdapter
-
afterProcessing
- Angegeben von:
afterProcessing
in SchnittstelleICompilerAdapter
- Angegeben von:
afterProcessing
in KlasseAbstractCompilerAdapter
-
acceptResult
- Angegeben von:
acceptResult
in KlasseAbstractCompilerAdapter
-
getPipelineDebugOutput
-
getResultsPendingWeave
- Angegeben von:
getResultsPendingWeave
in KlasseAbstractCompilerAdapter
-