/** * Submit the specified application previously registered * via {@link #registerTopology(String, BiConsumer) registerTopology}. * @param appName name of registered application * @param config See {@link #submit(Topology, JsonObject) submit}. May be null. * * @throws Exception on failure starting applications. */ private void submitApplication(String appName, JsonObject config) throws Exception { if (systemApps.contains(appName)) { throw new IllegalArgumentException("appName"); } ApplicationServiceMXBean bean = getControlService().getControl(ApplicationServiceMXBean.TYPE, ApplicationService.ALIAS, ApplicationServiceMXBean.class); bean.submit(appName, config==null ? null : config.toString()); } }
/** * Submit the specified application previously registered * via {@link #registerTopology(String, BiConsumer) registerTopology}. * @param appName name of registered application * @param config See {@link #submit(Topology, JsonObject) submit}. May be null. * * @throws Exception on failure starting applications. */ private void submitApplication(String appName, JsonObject config) throws Exception { if (systemApps.contains(appName)) { throw new IllegalArgumentException("appName"); } ApplicationServiceMXBean bean = getControlService().getControl(ApplicationServiceMXBean.TYPE, ApplicationService.ALIAS, ApplicationServiceMXBean.class); bean.submit(appName, config==null ? null : config.toString()); } }
/** * Start this provider by starting its system applications * and any autoSubmit-enabled registered applications. * * @throws Exception on failure starting applications. */ public void start() throws Exception { ApplicationServiceMXBean bean = getControlService().getControl(ApplicationServiceMXBean.TYPE, ApplicationService.ALIAS, ApplicationServiceMXBean.class); for (String systemAppName : systemApps) { bean.submit(systemAppName, null /* no config */); } for (Entry<String,JsonObject> e : autoSubmitApps.entrySet()) { submitApplication(e.getKey(), e.getValue()); } }
/** * Start this provider by starting its system applications * and any autoSubmit-enabled registered applications. * * @throws Exception on failure starting applications. */ public void start() throws Exception { ApplicationServiceMXBean bean = getControlService().getControl(ApplicationServiceMXBean.TYPE, ApplicationService.ALIAS, ApplicationServiceMXBean.class); for (String systemAppName : systemApps) { bean.submit(systemAppName, null /* no config */); } for (Entry<String,JsonObject> e : autoSubmitApps.entrySet()) { submitApplication(e.getKey(), e.getValue()); } }