use of com.creditease.uav.monitorframework.webservice.interceptors.WebServiceListenerIT in project uavstack by uavorg.
the class WebServiceListener method doInstallDProxy.
public void doInstallDProxy(ClassLoader webapploader, final String appid, String contextPath) {
// like SMS, which uses the sun jax-ws RI/Metro-jax-ws RI bind webservices when the servlet starts should
// profile in ComponentProfileHandler
FastClasspathScanner fcs = new FastClasspathScanner(new ClassLoader[] { webapploader });
fcs.scan();
List<String> endPoints = fcs.getNamesOfDirectSubclassesOf("javax.xml.ws.Endpoint");
if (!endPoints.isEmpty()) {
dpInstall.setTargetClassLoader(webapploader);
for (int i = 0; i < endPoints.size(); i++) {
dpInstall.installProxy(endPoints.get(i), new String[] { "com.creditease.uav.monitorframework.webservice.interceptors" }, new DynamicProxyProcessor() {
@Override
public void process(DPMethod m) throws Exception {
if ("publish".equals(m.getName()) && m.getParameterTypes().length > 0 && m.getParameterTypes()[0].getSimpleName().equals("String")) {
dpInstall.defineLocalVal(m, "mObj", WebServiceListenerIT.class);
m.insertBefore("{mObj=new WebServiceListenerIT(\"" + appid + "\");mObj.obtainWsInfo($1,getImplementor());}");
}
}
}, false);
}
// release loader
dpInstall.releaseTargetClassLoader();
}
}
Aggregations