use of com.shulie.instrument.simulator.api.instrument.InstrumentMethod in project LinkAgent by shulieTech.
the class AerospikePlugin method addTransformers.
private boolean addTransformers() {
this.enhanceTemplate.enhance(this, "com.aerospike.client.Key", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod method = target.getConstructors();
method.addInterceptor(Listeners.of(KeyConstructorInterceptor.class, "KEY_SCOPE", ExecutionPolicy.BOUNDARY, Interceptors.SCOPE_CALLBACK));
}
});
this.enhanceTemplate.enhance(this, "com.aerospike.client.AerospikeClient", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod method = target.getDeclaredMethods("put", "append", "prepend", "add", "delete", "touch", "exists", "exists", "get", "getHeader", "operate", "getLargeList", "getLargeMap", "getLargeStack", "execute", "query", "queryNode", "queryAggregate");
method.addInterceptor(Listeners.of(AreospikeOperateInterceptor.class));
InstrumentMethod scanNodeMethod = target.getDeclaredMethods("scanNode");
scanNodeMethod.addInterceptor(Listeners.of(ScanNodeParameterWrapInterceptor.class));
InstrumentMethod scanAllMethod = target.getDeclaredMethods("scanAll");
scanAllMethod.addInterceptor(Listeners.of(ScanAllParameterWrapInterceptor.class));
}
});
this.enhanceTemplate.enhance(this, "com.aerospike.client.async.AsyncClient", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod method = target.getDeclaredMethods("put", "append", "prepend", "add", "delete", "touch", "exists", "exists", "get", "getHeader", "operate", "getLargeList", "getLargeMap", "getLargeStack", "execute", "query", "queryNode", "queryAggregate");
method.addInterceptor(Listeners.of(AreospikeOperateInterceptor.class));
InstrumentMethod scanNodeMethod = target.getDeclaredMethods("scanNode");
scanNodeMethod.addInterceptor(Listeners.of(ScanNodeParameterWrapInterceptor.class));
scanNodeMethod.addInterceptor(Listeners.of(ScanNodeParameterWrapInterceptor.class));
InstrumentMethod scanAllMethod = target.getDeclaredMethods("scanAll");
scanAllMethod.addInterceptor(Listeners.of(ScanAllParameterWrapInterceptor.class));
scanAllMethod.addInterceptor(Listeners.of(AreospikeScanAllInterceptor.class));
}
});
return true;
}
Aggregations