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