use of com.creditease.uav.hook.mongoclients.interceptors.MongoClientIT in project uavstack by uavorg.
the class MongoClientHookProxy method doInstallDProxy.
public void doInstallDProxy(ClassLoader webapploader, final String appid) {
/**
* set the webapploader is the target classloader
*/
dpInstall.setTargetClassLoader(webapploader);
/**
* install proxy to MongoClient
*/
dpInstall.installProxy("com.mongodb.MongoClient", new String[] { "com.creditease.uav.hook.mongoclients.interceptors" }, new DynamicProxyProcessor() {
@Override
public void process(DPMethod m) throws Exception {
if ("getDatabase".equals(m.getName())) {
dpInstall.defineLocalVal(m, "mObj", MongoClientIT.class);
m.insertAfter("{mObj=new MongoClientIT(\"" + appid + "\");$_=mObj.doInstall($_);}");
}
}
}, false);
dpInstall.releaseTargetClassLoader();
}
Aggregations