- for (String pid : repositories.keySet()) {
- try {
- RepositoryContext repositoryContext = repositories.get(pid);
- // Must start in another thread otherwise shutdown is interrupted
- // TODO use an executor?
- new Thread(() -> {
- repositoryContext.getRepository().shutdown();
- if (log.isDebugEnabled())
- log.debug("Shut down repository " + pid
- + (pidToCn.containsKey(pid) ? " (" + pidToCn.get(pid) + ")" : ""));
- }, "Shutdown JCR repository " + pid).start();
- } catch (Exception e) {
- log.error("Error when shutting down Jackrabbit repository " + pid, e);
+ if (this.repositoryContext != null) {
+ this.repositoryContext.getRepository().shutdown();
+ }
+// for (String pid : repositories.keySet()) {
+// try {
+// RepositoryContext repositoryContext = repositories.get(pid);
+// // Must start in another thread otherwise shutdown is interrupted
+// // TODO use an executor?
+// new Thread(() -> {
+// repositoryContext.getRepository().shutdown();
+// if (log.isDebugEnabled())
+// log.debug("Shut down repository " + pid
+// + (pidToCn.containsKey(pid) ? " (" + pidToCn.get(pid) + ")" : ""));
+// }, "Shutdown JCR repository " + pid).start();
+// } catch (Exception e) {
+// log.error("Error when shutting down Jackrabbit repository " + pid, e);
+// }
+// }
+ }
+
+// @Override
+// public String getName() {
+// return "Jackrabbit repository service factory";
+// }
+
+ /** Override the provided config with the framework properties */
+ private Dictionary<String, Object> getNodeRepositoryConfig() {
+ Dictionary<String, Object> props = new Hashtable<String, Object>();
+ addDeployProperty(CmsDeployProperty.DB_URL, RepoConf.dburl, props);
+ addDeployProperty(CmsDeployProperty.DB_USER, RepoConf.dbuser, props);
+ addDeployProperty(CmsDeployProperty.DB_PASSWORD, RepoConf.dbpassword, props);
+ for (RepoConf repoConf : RepoConf.values()) {
+ Object value = getFrameworkProp(NODE_REPO_PROP_PREFIX + repoConf.name());
+ if (value != null) {
+ props.put(repoConf.name(), value);
+ if (log.isDebugEnabled())
+ log.debug("Set node repo configuration " + repoConf.name() + " to " + value);