Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java (revision 618196) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ClusterNode.java (working copy) @@ -26,7 +26,7 @@ import org.apache.jackrabbit.core.journal.RecordConsumer; import org.apache.jackrabbit.core.journal.Record; import org.apache.jackrabbit.core.journal.JournalException; -import org.apache.jackrabbit.core.journal.FileRevision; +import org.apache.jackrabbit.core.journal.InstanceRevision; import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException; import org.apache.jackrabbit.core.nodetype.NodeTypeDef; import org.apache.jackrabbit.core.observation.EventState; @@ -50,7 +50,6 @@ import java.util.Iterator; import java.util.Set; import java.util.HashSet; -import java.io.File; /** * Default clustered node implementation. @@ -64,11 +63,6 @@ public static final String SYSTEM_PROPERTY_NODE_ID = "org.apache.jackrabbit.core.cluster.node_id"; /** - * Revision counter parameter name. - */ - private static final String REVISION_NAME = "revision"; - - /** * Used for padding short string representations. */ private static final String SHORT_PADDING = "0000"; @@ -174,9 +168,9 @@ private NodeTypeEventListener nodeTypeListener; /** - * Instance revision file. + * Instance revision manager. */ - private FileRevision instanceRevision; + private InstanceRevision instanceRevision; /** * Workspace name used when consuming records. @@ -219,18 +213,11 @@ clusterNodeId = getClusterNodeId(cc.getId()); syncDelay = cc.getSyncDelay(); - JournalConfig jc = cc.getJournalConfig(); - - String revisionName = jc.getParameters().getProperty(REVISION_NAME); - if (revisionName == null) { - String msg = "Revision not specified."; - throw new ClusterException(msg); - } try { - instanceRevision = new FileRevision(new File(revisionName)); - + JournalConfig jc = cc.getJournalConfig(); journal = (Journal) jc.newInstance(); journal.init(clusterNodeId, clusterContext.getNamespaceResovler()); + instanceRevision = journal.getInstanceRevision(); journal.register(this); } catch (ConfigurationException e) { throw new ClusterException(e.getMessage(), e.getCause()); Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java (revision 618196) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/AbstractJournal.java (working copy) @@ -71,6 +71,15 @@ private final ReadWriteLock rwLock = new ReentrantWriterPreferenceReadWriteLock(); /** + * The path of the local revision file on disk. Configurable through the repository.xml. + * + * Note: this field is not located in the FileJournal class for upgrade reasons (before + * JCR-1087 had been fixed all Journals used a revision file on the local file system. + * Also see {@link DatabaseJournal#initInstanceRevisionAndJanitor()}). + */ + private String revision; + + /** * {@inheritDoc} */ public void init(String id, NamespaceResolver resolver) throws JournalException { @@ -336,5 +345,22 @@ public NamePathResolver getNamePathResolver() { return npResolver; } + + /* + * Bean getters and setters. + */ + + /** + * @return the path of the cluster node's local revision file + */ + public String getRevision() { + return revision; + } + /** + * @param revision the path of the cluster node's local revision file to set + */ + public void setRevision(String revision) { + this.revision = revision; + } } Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java (revision 618196) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/journal/DatabaseJournal.java (working copy) @@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory; import java.io.BufferedReader; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -32,6 +33,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.util.Calendar; import javax.jcr.RepositoryException; @@ -43,8 +45,6 @@ *

* It is configured through the following properties: *