Use guava cache to better manage apps from getAllRunning(Spring|Java)Apps

This commit is contained in:
Kris De Volder
2017-11-01 14:26:32 -07:00
parent f8d4e0ca8f
commit fb3af5c1e3
7 changed files with 87 additions and 56 deletions

View File

@@ -18,17 +18,8 @@ import com.google.common.collect.ImmutableList;
public interface RunningAppProvider {
public static final RunningAppProvider DEFAULT = new RunningAppProvider() {
@Override public Collection<SpringBootApp> getAllRunningSpringApps() throws Exception {
return SpringBootApp.getAllRunningSpringApps().values();
}
};
public static final RunningAppProvider NULL = new RunningAppProvider() {
@Override public Collection<SpringBootApp> getAllRunningSpringApps() throws Exception {
return ImmutableList.of();
}
};
public static final RunningAppProvider DEFAULT = SpringBootApp::getAllRunningSpringApps;
public static final RunningAppProvider NULL = () -> ImmutableList.of();
Collection<SpringBootApp> getAllRunningSpringApps() throws Exception;
}