Lines 41-46
Link Here
|
41 |
import org.aspectj.weaver.bcel.Utility; |
41 |
import org.aspectj.weaver.bcel.Utility; |
42 |
import org.aspectj.weaver.loadtime.definition.Definition; |
42 |
import org.aspectj.weaver.loadtime.definition.Definition; |
43 |
import org.aspectj.weaver.loadtime.definition.DocumentParser; |
43 |
import org.aspectj.weaver.loadtime.definition.DocumentParser; |
|
|
44 |
import org.aspectj.weaver.ltw.LTWWorld; |
44 |
import org.aspectj.weaver.patterns.PatternParser; |
45 |
import org.aspectj.weaver.patterns.PatternParser; |
45 |
import org.aspectj.weaver.patterns.TypePattern; |
46 |
import org.aspectj.weaver.patterns.TypePattern; |
46 |
import org.aspectj.weaver.tools.GeneratedClassHandler; |
47 |
import org.aspectj.weaver.tools.GeneratedClassHandler; |
Lines 53-58
Link Here
|
53 |
|
54 |
|
54 |
private final static String AOP_XML = "META-INF/aop.xml"; |
55 |
private final static String AOP_XML = "META-INF/aop.xml"; |
55 |
|
56 |
|
|
|
57 |
private LTWWorld ltwWorld; |
56 |
private List m_dumpTypePattern = new ArrayList(); |
58 |
private List m_dumpTypePattern = new ArrayList(); |
57 |
private boolean m_dumpBefore = false; |
59 |
private boolean m_dumpBefore = false; |
58 |
private List m_includeTypePattern = new ArrayList(); |
60 |
private List m_includeTypePattern = new ArrayList(); |
Lines 104-110
Link Here
|
104 |
return; |
106 |
return; |
105 |
} |
107 |
} |
106 |
|
108 |
|
107 |
bcelWorld = new BcelWorld( |
109 |
//bcelWorld = new BcelWorld( |
|
|
110 |
bcelWorld = ltwWorld = new LTWWorld( |
108 |
loader, getMessageHandler(), new ICrossReferenceHandler() { |
111 |
loader, getMessageHandler(), new ICrossReferenceHandler() { |
109 |
public void addCrossReference(ISourceLocation from, ISourceLocation to, IRelationship.Kind kind, boolean runtimeTest) { |
112 |
public void addCrossReference(ISourceLocation from, ISourceLocation to, IRelationship.Kind kind, boolean runtimeTest) { |
110 |
;// for tools only |
113 |
;// for tools only |
Lines 119-131
Link Here
|
119 |
|
122 |
|
120 |
weaver = new BcelWeaver(bcelWorld); |
123 |
weaver = new BcelWeaver(bcelWorld); |
121 |
|
124 |
|
|
|
125 |
ltwWorld.setLoadingAspects(true); |
122 |
// register the definitions |
126 |
// register the definitions |
123 |
registerDefinitions(weaver, loader, definitions); |
127 |
registerDefinitions(weaver, loader, definitions); |
124 |
|
128 |
|
125 |
//bcelWorld.setResolutionLoader(loader.getParent());//(ClassLoader)null);// |
129 |
//bcelWorld.setResolutionLoader(loader.getParent());//(ClassLoader)null);// |
126 |
|
130 |
|
127 |
// after adding aspects |
131 |
// after adding aspects |
128 |
weaver.prepareForWeave(); |
132 |
weaver.prepareForWeave(); |
|
|
133 |
ltwWorld.setLoadingAspects(false); |
129 |
} |
134 |
} |
130 |
|
135 |
|
131 |
/** |
136 |
/** |
Lines 637-640
Link Here
|
637 |
warn("define generated class failed",e); |
642 |
warn("define generated class failed",e); |
638 |
} |
643 |
} |
639 |
} |
644 |
} |
|
|
645 |
|
646 |
protected byte[] getWovenBytes(String name, byte[] bytes) throws IOException { |
647 |
try { |
648 |
ltwWorld.startLoading(name); |
649 |
return super.getWovenBytes(name, bytes); |
650 |
} finally { |
651 |
ltwWorld.stopLoading(name); |
652 |
} |
653 |
} |
654 |
|
655 |
protected byte[] getAtAspectJAspectBytes(String name, byte[] bytes) throws IOException { |
656 |
try { |
657 |
ltwWorld.startLoading(name); |
658 |
return super.getAtAspectJAspectBytes(name, bytes); |
659 |
} finally { |
660 |
ltwWorld.stopLoading(name); |
661 |
} |
662 |
} |
640 |
} |
663 |
} |