Merge remote-tracking branch 'origin/feature/3.0' into feature/collector

This commit is contained in:
pengys5 2017-03-24 17:57:54 +08:00
commit 2e396b2176
2 changed files with 13 additions and 7 deletions

View File

@ -128,7 +128,7 @@ public class SegmentPost extends AbstractPost {
@Override
public String servletPath() {
return "/segment";
return "/segments";
}
@Override

View File

@ -21,6 +21,7 @@ public enum ServiceManager {
public void boot() {
bootedServices = loadAllServices();
startup();
}
private Map<Class, BootService> loadAllServices() {
@ -28,16 +29,21 @@ public enum ServiceManager {
Iterator<BootService> serviceIterator = load().iterator();
while (serviceIterator.hasNext()) {
BootService bootService = serviceIterator.next();
try {
bootService.bootUp();
bootedServices.put(bootService.getClass(), bootService);
} catch (Throwable e) {
logger.error(e, "ServiceManager try to start [{}] fail.", bootService.getClass().getName());
}
bootedServices.put(bootService.getClass(), bootService);
}
return bootedServices;
}
private void startup() {
for (BootService service : bootedServices.values()) {
try {
service.bootUp();
} catch (Throwable e) {
logger.error(e, "ServiceManager try to start [{}] fail.", service.getClass().getName());
}
}
}
/**
* Find a {@link BootService} implementation, which is already started.
*