1
0

Basic implementation for files app

This commit is contained in:
2022-05-06 23:01:23 +02:00
parent 4e12f4805e
commit 7d6c6c6321
54 changed files with 2381 additions and 94 deletions

View File

@@ -0,0 +1,18 @@
package de.nbscloud.webcontainer.registry;
public interface App {
// New app:
// 1) Create module
// 2) Add dependencies (like other app modules)
// 3) Register module in web-container module
// 4) Add module to dependency management in aggregator pom
// 5) Add module package to web-container application @ComponentScan
String getId();
String getIcon();
String getStartPath();
int getIndex();
}

View File

@@ -0,0 +1,23 @@
package de.nbscloud.webcontainer.registry;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
@Component
public class AppRegistry {
private final List<App> apps = new CopyOnWriteArrayList<>();
public void registerApp(App app) {
this.apps.add(app);
this.apps.sort(Comparator.comparing(App::getIndex));
}
public List<App> getAll() {
return Collections.unmodifiableList(this.apps);
}
}