use of com.creditease.uav.hook.rabbitmq.interceptors.RabbitmqIT in project uavstack by uavorg.
the class RabbitmqHookProxy method doInstallDProxy.
public void doInstallDProxy(ClassLoader webapploader, final String appid) {
/**
* set the webapploader is the target classloader
*/
dpInstall.setTargetClassLoader(webapploader);
/**
* install proxy to rabbitMQClient
*/
dpInstall.installProxy("com.rabbitmq.client.ConnectionFactory", new String[] { "com.creditease.uav.hook.rabbitmq.interceptors" }, new DynamicProxyProcessor() {
@Override
public void process(DPMethod m) throws Exception {
if ("newConnection".equals(m.getName()) && m.getParameterTypes().length >= 2) {
dpInstall.defineLocalVal(m, "mObj", RabbitmqIT.class);
m.insertAfter("{mObj=new RabbitmqIT(\"" + appid + "\");$_=mObj.doInstall($_);}");
}
}
}, false);
dpInstall.releaseTargetClassLoader();
}
Aggregations