Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/3.0' into feature/collector
Browse files Browse the repository at this point in the history
  • Loading branch information
peng-yongsheng committed Mar 24, 2017
2 parents 54ae4b9 + 53f3670 commit 2e396b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static class Factory extends AbstractPostProvider<SegmentPost> {

@Override
public String servletPath() {
return "/segment";
return "/segments";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,27 @@ public enum ServiceManager {

public void boot() {
bootedServices = loadAllServices();
startup();
}

private Map<Class, BootService> loadAllServices() {
HashMap<Class, BootService> bootedServices = new HashMap<Class, BootService>();
Iterator<BootService> serviceIterator = load().iterator();
while (serviceIterator.hasNext()) {
BootService bootService = serviceIterator.next();
bootedServices.put(bootService.getClass(), bootService);
}
return bootedServices;
}

private void startup() {
for (BootService service : bootedServices.values()) {
try {
bootService.bootUp();
bootedServices.put(bootService.getClass(), bootService);
service.bootUp();
} catch (Throwable e) {
logger.error(e, "ServiceManager try to start [{}] fail.", bootService.getClass().getName());
logger.error(e, "ServiceManager try to start [{}] fail.", service.getClass().getName());
}
}
return bootedServices;
}

/**
Expand Down

0 comments on commit 2e396b2

Please sign in to comment.