use of com.shulie.instrument.simulator.api.instrument.InstrumentClass in project LinkAgent by shulieTech.
the class AkkaPlugin method onActive.
@Override
public boolean onActive() throws Throwable {
this.enhanceTemplate.enhanceWithSuperClass(this, "akka.dispatch.Mailbox", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod enqueueMethod = target.getDeclaredMethod("enqueue", "akka.actor.ActorRef", "akka.dispatch.Envelope");
enqueueMethod.addInterceptor(Listeners.of(MailboxEnqueueInterceptor.class));
InstrumentMethod dequeueMethod = target.getDeclaredMethod("dequeue");
dequeueMethod.addInterceptor(Listeners.of(MailboxDequeueInterceptor.class));
}
});
this.enhanceTemplate.enhance(this, "akka.dispatch.Mailbox", new EnhanceCallback() {
@Override
public void doEnhance(InstrumentClass target) {
InstrumentMethod enqueueMethod = target.getDeclaredMethod("enqueue", "akka.actor.ActorRef", "akka.dispatch.Envelope");
enqueueMethod.addInterceptor(Listeners.of(MailboxEnqueueInterceptor.class));
InstrumentMethod dequeueMethod = target.getDeclaredMethod("dequeue");
dequeueMethod.addInterceptor(Listeners.of(MailboxDequeueInterceptor.class));
}
});
return true;
}
use of com.shulie.instrument.simulator.api.instrument.InstrumentClass 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