@Test public void install() { InputStream stream = ApplicationArchive.class.getResourceAsStream("app.zip"); Application app = mgr.install(stream); validate(app); assertEquals("incorrect features URI used", app.featuresRepo().get(), ((TestFeaturesService) mgr.featuresService).uri); assertEquals("incorrect app count", 1, mgr.getApplications().size()); assertEquals("incorrect app", app, mgr.getApplication(APP_ID)); assertEquals("incorrect app state", INSTALLED, mgr.getState(APP_ID)); mgr.registerDeactivateHook(app.id(), this::deactivateHook); }
@Override public Application install(InputStream appDescStream) { checkNotNull(appDescStream, "Application archive stream cannot be null"); Application app = store.create(appDescStream); SecurityUtil.register(app.id()); return app; }
ApplicationManager extends AbstractListenerManager<ApplicationEvent, ApplicationListener> implements ApplicationService, ApplicationAdminService { @Override public Application install(InputStream appDescStream) { checkNotNull(appDescStream, "Application archive stream cannot be null"); Application app = store.create(appDescStream); SecurityUtil.register(app.id()); return app; } }
ApplicationManager extends AbstractListenerManager<ApplicationEvent, ApplicationListener> implements ApplicationService, ApplicationAdminService { @Override public Application install(InputStream appDescStream) { checkNotNull(appDescStream, "Application archive stream cannot be null"); Application app = store.create(appDescStream); SecurityUtil.register(app.id()); return app; }  }
ApplicationManager extends AbstractListenerManager<ApplicationEvent, ApplicationListener> implements ApplicationService, ApplicationAdminService { @Override public Application install(InputStream appDescStream) { checkNotNull(appDescStream, "Application archive stream cannot be null"); Application app = store.create(appDescStream); SecurityUtil.register(app.id()); return app; }  @Activate void activate(); @Deactivate void deactivate(); @Override Set<Application> getApplications(); @Override ApplicationId getId(String name); @Override Application getApplication(ApplicationId appId); @Override ApplicationState getState(ApplicationId appId); @Override Set<Permission> getPermissions(ApplicationId appId); @Override void registerDeactivateHook(ApplicationId appId, Runnable hook); @Override Application install(InputStream appDescStream); @Override void uninstall(ApplicationId appId); @Override void activate(ApplicationId appId); @Override void deactivate(ApplicationId appId); @Override void setPermissions(ApplicationId appId, Set<Permission> permissions); }
ApplicationManager extends AbstractListenerManager<ApplicationEvent, ApplicationListener> implements ApplicationService, ApplicationAdminService { @Override public Application install(InputStream appDescStream) { checkNotNull(appDescStream, "Application archive stream cannot be null"); Application app = store.create(appDescStream); SecurityUtil.register(app.id()); return app; }  @Activate void activate(); @Deactivate void deactivate(); @Override Set<Application> getApplications(); @Override ApplicationId getId(String name); @Override Application getApplication(ApplicationId appId); @Override ApplicationState getState(ApplicationId appId); @Override Set<Permission> getPermissions(ApplicationId appId); @Override void registerDeactivateHook(ApplicationId appId, Runnable hook); @Override Application install(InputStream appDescStream); @Override void uninstall(ApplicationId appId); @Override void activate(ApplicationId appId); @Override void deactivate(ApplicationId appId); @Override void setPermissions(ApplicationId appId, Set<Permission> permissions);  }