- log.debug("Initialised default Bitronix transaction manager");
- }
-
- // private void initRepositoryFactory() {
- // // TODO rationalise RepositoryFactory
- // repositoryFactory = new NodeRepositoryFactory();
- // // register
- // bc.registerService(RepositoryFactory.class, repositoryFactory, null);
- // }
-
- // private void initUi() {
- // 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 initDeployConfigs(Dictionary<String, ?> stateProps) throws IOException {
- Path deployPath = KernelUtils.getOsgiInstancePath(KernelConstants.DIR_NODE + '/' + KernelConstants.DIR_DEPLOY);
- Files.createDirectories(deployPath);
-
- Path nodeConfigPath = deployPath.resolve(NodeConstants.NODE_REPO_PID + ".properties");
- if (!Files.exists(nodeConfigPath)) {
- Dictionary<String, Object> nodeConfig = getNodeConfig(stateProps);
- nodeConfig.put(ArgeoJcrConstants.JCR_REPOSITORY_ALIAS, ArgeoJcrConstants.ALIAS_NODE);
- nodeConfig.put(RepoConf.labeledUri.name(), nodeRepoUri.toString());
- LangUtils.storeAsProperties(nodeConfig, nodeConfigPath);
- }
-
- if (cleanState) {
- try (DirectoryStream<Path> ds = Files.newDirectoryStream(deployPath)) {
- for (Path path : ds) {
- if (Files.isDirectory(path)) {// managed factories
- try (DirectoryStream<Path> factoryDs = Files.newDirectoryStream(path)) {
- for (Path confPath : factoryDs) {
- Configuration conf = configurationAdmin
- .createFactoryConfiguration(path.getFileName().toString());
- Dictionary<String, Object> props = LangUtils.loadFromProperties(confPath);
- conf.update(props);
- }
- }
- } else {// managed services
- String pid = path.getFileName().toString();
- pid = pid.substring(0, pid.length() - ".properties".length());
- Configuration conf = configurationAdmin.getConfiguration(pid);
- Dictionary<String, Object> props = LangUtils.loadFromProperties(path);
- conf.update(props);
- }
- }
- }
- }
- }
-
- // private void initRepositories(Dictionary<String, ?> stateProps) throws
- // IOException {
- // // register
- // repositoryServiceFactory = new RepositoryServiceFactory();
- // bc.registerService(ManagedServiceFactory.class, repositoryServiceFactory,
- // LangUtils.init(Constants.SERVICE_PID,
- // NodeConstants.JACKRABBIT_FACTORY_PID));
- //
- // repositoryService = new RepositoryService();
- // Dictionary<String, Object> regProps =
- // LangUtils.init(Constants.SERVICE_PID, NodeConstants.NODE_REPO_PID);
- // bc.registerService(LangUtils.names(ManagedService.class,
- // MetaTypeProvider.class), repositoryService, regProps);
- // }