use of com.creditease.agent.spi.AbstractHttpHandler in project uavstack by uavorg.
the class HBClientDefaultHandler method getServiceURLs.
/**
* get the node's http service url
*
* @return
*/
@SuppressWarnings("rawtypes")
private Map<String, String> getServiceURLs() {
Set<Object> components = this.getConfigManager().getComponents();
Map<String, String> services = new LinkedHashMap<String, String>();
for (Object comp : components) {
if (!AbstractBaseHttpServComponent.class.isAssignableFrom(comp.getClass())) {
continue;
}
AbstractBaseHttpServComponent asc = (AbstractBaseHttpServComponent) comp;
String compid = asc.getFeature() + "-" + asc.getName();
String httpRootURL = asc.getHttpRootURL();
List handlers = asc.getHandlers();
for (Object handler : handlers) {
if (!AbstractHttpHandler.class.isAssignableFrom(handler.getClass())) {
continue;
}
AbstractHttpHandler abshandler = (AbstractHttpHandler) handler;
String serviceId = compid + "-" + abshandler.getContextPath();
String serviceHttpURL = httpRootURL + abshandler.getContextPath();
services.put(serviceId, serviceHttpURL);
}
}
return services;
}
Aggregations