|
|
|
@ -21,7 +21,6 @@ import com.fr.record.analyzer.AnalyzerConfiguration;
|
|
|
|
|
import com.fr.record.analyzer.AnalyzerKey; |
|
|
|
|
import com.fr.record.analyzer.DBMetrics; |
|
|
|
|
import com.fr.record.analyzer.FineAnalyzer; |
|
|
|
|
import com.fr.record.analyzer.advice.AnalyzerAdviceConfiguration; |
|
|
|
|
import com.fr.record.analyzer.advice.AnalyzerAdviceKey; |
|
|
|
|
import com.fr.record.analyzer.advice.FineAdviceAssistant; |
|
|
|
|
import com.fr.record.analyzer.configuration.AnalyzerAssemblyFactory; |
|
|
|
@ -60,7 +59,7 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare {
|
|
|
|
|
ExecutorService es = newSingleThreadExecutor(new NamedThreadFactory("designer-analyzer", true)); |
|
|
|
|
try { |
|
|
|
|
// 加入 retransform 部分的逻辑
|
|
|
|
|
List<AnalyzerAdviceConfiguration> adviceConfigurations = findMutable(AnalyzerAdviceKey.KEY); |
|
|
|
|
List<FineAdviceAssistant> adviceConfigurations = findMutable(AnalyzerAdviceKey.KEY); |
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(adviceConfigurations)) { |
|
|
|
|
AnalyzerConfiguration[] configurations = convertConfigurations(adviceConfigurations); |
|
|
|
@ -77,10 +76,10 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@NotNull |
|
|
|
|
private AnalyzerConfiguration[] convertConfigurations(List<AnalyzerAdviceConfiguration> list) { |
|
|
|
|
private AnalyzerConfiguration[] convertConfigurations(List<FineAdviceAssistant> list) { |
|
|
|
|
|
|
|
|
|
return list.stream() |
|
|
|
|
.map((e) -> AnalyzerConfiguration.create(new FineAdviceAssistant(e.getMatcher(), e.getAdviceClass()))) |
|
|
|
|
.map(AnalyzerConfiguration::create) |
|
|
|
|
.toArray(AnalyzerConfiguration[]::new); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -92,27 +91,27 @@ public class DesignerAnalyzerActivator extends Activator implements Prepare {
|
|
|
|
|
@Override |
|
|
|
|
public void prepare() { |
|
|
|
|
|
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( |
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( |
|
|
|
|
ElementMatchers.isAnnotatedWith(Focus.class), |
|
|
|
|
FocusAdvice.class |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( |
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( |
|
|
|
|
ElementMatchers.isAnnotatedWith(Compute.class), |
|
|
|
|
MonitorAdvice.class |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( |
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( |
|
|
|
|
ElementMatchers.isAnnotatedWith(DBMetrics.class), |
|
|
|
|
DBMonitorAdvice.class |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( |
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( |
|
|
|
|
ElementMatchers.isAnnotatedWith(PerformancePoint.class), |
|
|
|
|
PerformancePointAdvice.class |
|
|
|
|
)); |
|
|
|
|
|
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, AnalyzerAdviceConfiguration.create( |
|
|
|
|
addMutable(AnalyzerAdviceKey.KEY, FineAdviceAssistant.create( |
|
|
|
|
ElementMatchers.isAnnotatedWith(FaultTolerance.class), |
|
|
|
|
FaultToleranceAdvice.class |
|
|
|
|
)); |
|
|
|
|