+ private void initServices() {
+ // trackers
+ new ServiceTracker<HttpService, HttpService>(bc, HttpService.class, new PrepareHttpStc()).open();
+ new ServiceTracker<>(bc, RepositoryContext.class, new RepositoryContextStc()).open();
+
+ initTransactionManager();
+
+ // JCR
+ RepositoryServiceFactory repositoryServiceFactory = new RepositoryServiceFactory();
+ shutdownHooks.add(() -> repositoryServiceFactory.shutdown());
+ bc.registerService(ManagedServiceFactory.class, repositoryServiceFactory,
+ LangUtils.init(Constants.SERVICE_PID, NodeConstants.JACKRABBIT_FACTORY_PID));
+
+ NodeRepositoryFactory repositoryFactory = new NodeRepositoryFactory();
+ bc.registerService(RepositoryFactory.class, repositoryFactory, null);
+
+ RepositoryService repositoryService = new RepositoryService();
+ shutdownHooks.add(() -> repositoryService.shutdown());
+ bc.registerService(LangUtils.names(ManagedService.class, MetaTypeProvider.class), repositoryService,
+ LangUtils.init(Constants.SERVICE_PID, NodeConstants.NODE_REPO_PID));
+
+ // Security
+ NodeUserAdmin userAdmin = new NodeUserAdmin();
+ shutdownHooks.add(() -> userAdmin.destroy());
+ Dictionary<String, Object> props = userAdmin.currentState();
+ props.put(Constants.SERVICE_PID, NodeConstants.NODE_USER_ADMIN_PID);
+ bc.registerService(UserAdmin.class, userAdmin, props);
+
+ // UI
+ bc.registerService(ApplicationConfiguration.class, new MaintenanceUi(),
+ LangUtils.init(PROPERTY_CONTEXT_NAME, "system"));
+ bc.registerService(ApplicationConfiguration.class, new UserUi(), LangUtils.init(PROPERTY_CONTEXT_NAME, "user"));
+ }
+ // private void initUserAdmin() {
+ // userAdmin = new NodeUserAdmin();
+ // // register
+ // Dictionary<String, Object> props = userAdmin.currentState();
+ // props.put(Constants.SERVICE_PID, NodeConstants.NODE_USER_ADMIN_PID);
+ // // TODO use ManagedService
+ // bc.registerService(UserAdmin.class, userAdmin, props);
+ // }
+