...
Code Block |
---|
public interface ApplicationContext<T extends Config> { T getConfig(); } public interface Application<T extends Config> { void configure(ApplicationConfigurer configurer, ApplicationContext<T> context); } public abstract class AbstractApplication<T> implements Application<T extends Config> { ... protected final ApplicationContext<T> getContext() { return context; } } public class MyApp extends AbstractApplication<MyApp.MyConfig> { public static class MyConfig { private String stream; private String table; private MyFlowConfig flowOptions; } public void configure() { // ApplicationContext now has a method to get a custom config object whose fields will // be injected using the values given in the RESTful API MyConfig config = getContext().getConfig(); addStream(new Stream(config.stream)); createDataset(config.table, Table.class); addFlow(config.stream, config.table, config.flowOptions); } } |
Details
The sequence of events now looks like: (insert sequence diagram)
Users will still be able to deploy an app in one call. Internally it will store the artifact and then create the application from that artifact.
Users will also be able to deploy an artifact without creating an application. An application can then be created from that artifact in a separate call.
Users will also be able to update their applications to use a different version of an artifact.