use of com.creditease.uav.profiling.handlers.webservice.WebServiceProfileInfo in project uavstack by uavorg.
the class ComponentProfileHandler method getDynInfoForWebService.
@SuppressWarnings("unchecked")
private void getDynInfoForWebService(String componentClassName, ProfileElementInstance inst, ProfileContext context, Map<String, Class<?>> annoAvailableClasses, FastClasspathScanner fcs) {
if (!componentClassName.equals("javax.jws.WebService")) {
return;
}
Class<?> annoClass = annoAvailableClasses.get(componentClassName);
if (null == annoClass) {
return;
}
List<String> coms = fcs.getNamesOfClassesWithAnnotation(annoClass);
if (null == coms || coms.isEmpty()) {
return;
}
// construct data "dyn" for webservice
InterceptContext ic = context.get(InterceptContext.class);
List<WebServiceProfileInfo> wsli = (ArrayList<WebServiceProfileInfo>) ic.get("webservice.profile.info");
if (wsli == null || wsli.isEmpty()) {
return;
}
for (WebServiceProfileInfo wslinfo : wsli) {
String url = wslinfo.getUrl();
String clazz = (wslinfo.getImpl() instanceof String) ? (String) wslinfo.getImpl() : wslinfo.getImpl().getClass().getName();
if (coms.contains(clazz)) {
Map<String, Object> dynInfos = new LinkedHashMap<String, Object>();
Map<String, Object> info = (Map<String, Object>) inst.getValues().get(clazz);
dynInfos.put("url", url);
dynInfos.put("className", clazz);
info.put("dyn", dynInfos);
inst.getValues().put(clazz, info);
}
}
}
use of com.creditease.uav.profiling.handlers.webservice.WebServiceProfileInfo in project uavstack by uavorg.
the class WebServiceListenerIT method obtainWsInfo.
public void obtainWsInfo(Object address, Object impl) {
InterceptContext ic = InterceptSupport.instance().getThreadLocalContext(Event.WEBCONTAINER_STARTED);
@SuppressWarnings("unchecked") List<WebServiceProfileInfo> list = (ArrayList<WebServiceProfileInfo>) ic.get("webservice.profile.info");
if (null == list) {
list = new ArrayList<WebServiceProfileInfo>();
ic.put("webservice.profile.info", list);
}
setWsInfo(list, address, impl);
}
use of com.creditease.uav.profiling.handlers.webservice.WebServiceProfileInfo in project uavstack by uavorg.
the class WebServiceListenerIT method setWsInfo.
private void setWsInfo(List<WebServiceProfileInfo> list, Object address, Object impl) {
WebServiceProfileInfo wsli = new WebServiceProfileInfo();
wsli.setImpl(impl);
wsli.setUrl((String) address);
list.add(wsli);
}
Aggregations