|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectabc.tm.weaving.weaver.tmanalysis.stages.AbstractAnalysisStage
public abstract class AbstractAnalysisStage
An abstract analysis Stage that provides base functionality such as updating shadows and running assertion checks.
Shadows can be updated in two different flavours:
disableShadow(String) or disableAll(Set), which means that they are
deregistered with ShadowRegistry, they are pruned from existing MatchingTMSymbolTags,
those tags are removed if empty and finally the entire tracematch(es) those shadows belong to are removed
from the TMGlobalAspectInfo if there are no shadows remaining for them. This functionality
if mostly implemented in ShadowRegistry.disableShadow(String) and
ShadowRegistry.removeTracematchesWithNoRemainingShadows().
retainShadow(String) or retainAll(Set),
meaning that no later stage can remove those shadows. This should be called for shadows that become known
to be crucial for a sound weaving process.
| Field Summary | |
|---|---|
protected java.lang.String |
name
name of this analysis stage; inferred from class name; used for statistical output |
protected Timer |
shadowUpdateTimer
timer to time the duration of shadow updating |
protected Timer |
stageTimer
timer to time the duration of this stage |
protected java.util.Set |
validationChecks
set of validation checks to run after this stage has completed and the shadows have been updated |
| Constructor Summary | |
|---|---|
protected |
AbstractAnalysisStage()
Creates a new analysis stage without any assertion checks. |
protected |
AbstractAnalysisStage(java.lang.Runnable validationCheck)
Creates a new analysis stage with an attached assertion check. |
protected |
AbstractAnalysisStage(java.util.Set validationChecks)
Creates a new analysis stage with an attached assertion checks. |
| Method Summary | |
|---|---|
protected void |
appendStatistics()
Subclasses can overwrite this method to add something to the statistics. |
void |
apply()
Applies this stage. |
protected void |
defaultStatistics()
Outputs some statistics such as analysis time and number of removed and remaining shadows. |
protected void |
disableAll(java.util.Set shadowsToDisable)
Adds the given shadows to the set of shadows to disable. |
protected void |
disableShadow(java.lang.String uniqueShadowId)
Adds the given shadow to the set of shadows to disable. |
protected abstract void |
doAnalysis()
Performs the actual analysis. |
protected void |
logToStatistics(java.lang.String label,
int value)
Logs the given label/value pair to the statistics. |
protected void |
logToStatistics(java.lang.String label,
java.lang.Object value)
Logs the given label/value pair to the statistics. |
protected void |
retainAll(java.util.Set shadowsToRetain)
Adds the given shadows to the set of shadows to explicitly retain. |
protected void |
retainShadow(java.lang.String uniqueShadowId)
Adds the given shadow to the set of shadows to retain. |
protected void |
runChecks()
Runs all attached checks. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Set validationChecks
protected final java.lang.String name
protected final Timer stageTimer
protected final Timer shadowUpdateTimer
| Constructor Detail |
|---|
protected AbstractAnalysisStage()
protected AbstractAnalysisStage(java.lang.Runnable validationCheck)
validationCheck - a check in form of a Runnable; it should throw an exception
if the check is violatedprotected AbstractAnalysisStage(java.util.Set validationChecks)
validationChecks - a set of validation checksAbstractAnalysisStage(Runnable)| Method Detail |
|---|
public void apply()
apply in interface Stageprotected abstract void doAnalysis()
protected void runChecks()
protected void disableAll(java.util.Set shadowsToDisable)
shadowsToDisable - a set of unique shadow IDsNaming.uniqueShadowID(String, int),
Naming.uniqueShadowID(String, String, int)protected void disableShadow(java.lang.String uniqueShadowId)
uniqueShadowId - ID of the shadow to disableNaming.uniqueShadowID(String, int),
Naming.uniqueShadowID(String, String, int)protected void retainAll(java.util.Set shadowsToRetain)
shadowsToDisable - a set of unique shadow IDsNaming.uniqueShadowID(String, int),
Naming.uniqueShadowID(String, String, int)protected void retainShadow(java.lang.String uniqueShadowId)
uniqueShadowId - ID of the shadow to retainNaming.uniqueShadowID(String, int),
Naming.uniqueShadowID(String, String, int)
protected void logToStatistics(java.lang.String label,
java.lang.Object value)
label - any labelvalue - any object
protected void logToStatistics(java.lang.String label,
int value)
label - any labelvalue - any intprotected void appendStatistics()
logToStatistics(String, Object) to do so.
protected void defaultStatistics()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||