Search in sources :

Example 41 with InstrumentMethod

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;
}
Also used : InstrumentClass(com.shulie.instrument.simulator.api.instrument.InstrumentClass) InstrumentMethod(com.shulie.instrument.simulator.api.instrument.InstrumentMethod) EnhanceCallback(com.shulie.instrument.simulator.api.instrument.EnhanceCallback)

Aggregations

EnhanceCallback (com.shulie.instrument.simulator.api.instrument.EnhanceCallback)41 InstrumentClass (com.shulie.instrument.simulator.api.instrument.InstrumentClass)41 InstrumentMethod (com.shulie.instrument.simulator.api.instrument.InstrumentMethod)41 XxlJobAdapter (com.pamirs.attach.plugin.shadowjob.adapter.XxlJobAdapter)1 IEvent (com.pamirs.pradar.pressurement.agent.event.IEvent)1 ClusterTestSwitchOffEvent (com.pamirs.pradar.pressurement.agent.event.impl.ClusterTestSwitchOffEvent)1 ClusterTestSwitchOnEvent (com.pamirs.pradar.pressurement.agent.event.impl.ClusterTestSwitchOnEvent)1 EventResult (com.pamirs.pradar.pressurement.agent.listener.EventResult)1 PradarEventListener (com.pamirs.pradar.pressurement.agent.listener.PradarEventListener)1 ShadowImplListener (com.pamirs.pradar.pressurement.agent.listener.impl.ShadowImplListener)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1