use of com.shulie.instrument.simulator.api.resource.InstrumentClassResource in project LinkAgent by shulieTech.
the class DefaultEnhanceTemplate method enhance.
@Override
public InstrumentClass enhance(ExtensionModule module, String className, EnhanceCallback callback) {
IClassMatchBuilder iClassMatchBuilder = new EventWatchBuilder(moduleEventWatcher).onClass(className);
final DefaultInstrumentClass instrumentClass = new DefaultInstrumentClass(iClassMatchBuilder);
callback.doEnhance(instrumentClass);
if (module instanceof ModuleLifecycleAdapter) {
((ModuleLifecycleAdapter) module).addReleaseResource(new InstrumentClassResource(instrumentClass));
}
instrumentClass.execute();
return instrumentClass;
}
use of com.shulie.instrument.simulator.api.resource.InstrumentClassResource in project LinkAgent by shulieTech.
the class DefaultEnhanceTemplate method enhanceWithInterface.
@Override
public InstrumentClass enhanceWithInterface(ExtensionModule module, String interfaceClassName, EnhanceCallback callback) {
IClassMatchBuilder iClassMatchBuilder = new EventWatchBuilder(moduleEventWatcher).onAnyClass().hasInterfaceTypes(interfaceClassName);
final DefaultInstrumentClass instrumentClass = new DefaultInstrumentClass(iClassMatchBuilder);
callback.doEnhance(instrumentClass);
if (module instanceof ModuleLifecycleAdapter) {
((ModuleLifecycleAdapter) module).addReleaseResource(new InstrumentClassResource(instrumentClass));
}
instrumentClass.execute();
return instrumentClass;
}
use of com.shulie.instrument.simulator.api.resource.InstrumentClassResource in project LinkAgent by shulieTech.
the class DefaultEnhanceTemplate method enhanceWithSuperClass.
@Override
public InstrumentClass enhanceWithSuperClass(ExtensionModule module, EnhanceCallback callback, String... superClassNames) {
IClassMatchBuilder iClassMatchBuilder = new EventWatchBuilder(moduleEventWatcher).onAnyClass().withSuperClass(superClassNames);
final DefaultInstrumentClass instrumentClass = new DefaultInstrumentClass(iClassMatchBuilder);
callback.doEnhance(instrumentClass);
if (module instanceof ModuleLifecycleAdapter) {
((ModuleLifecycleAdapter) module).addReleaseResource(new InstrumentClassResource(instrumentClass));
}
instrumentClass.execute();
return instrumentClass;
}
Aggregations