use of org.apache.jackrabbit.core.journal.MemoryJournal in project jackrabbit by apache.
the class ConsistencyCheckerImplTest method createClusterNode.
private ClusterNode createClusterNode(String id) throws Exception {
final MemoryJournal journal = new MemoryJournal() {
protected boolean syncAgainOnNewRecords() {
return true;
}
};
JournalFactory jf = new JournalFactory() {
public Journal getJournal(NamespaceResolver resolver) throws RepositoryException {
return journal;
}
};
ClusterConfig cc = new ClusterConfig(id, SYNC_DELAY, jf);
SimpleClusterContext context = new SimpleClusterContext(cc);
journal.setRepositoryHome(context.getRepositoryHome());
journal.init(id, context.getNamespaceResolver());
journal.setRecords(records);
ClusterNode clusterNode = new ClusterNode();
clusterNode.init(context);
return clusterNode;
}
use of org.apache.jackrabbit.core.journal.MemoryJournal in project jackrabbit by apache.
the class ClusterRecordTest method createClusterNode.
/**
* Create a cluster node, with a memory journal referencing a list of records.
*
* @param id cluster node id
* @param records memory journal's list of records
*/
private ClusterNode createClusterNode(String id, ArrayList<MemoryRecord> records) throws Exception {
final MemoryJournal journal = new MemoryJournal();
JournalFactory jf = new JournalFactory() {
public Journal getJournal(NamespaceResolver resolver) throws RepositoryException {
return journal;
}
};
ClusterConfig cc = new ClusterConfig(id, SYNC_DELAY, jf);
SimpleClusterContext context = new SimpleClusterContext(cc);
journal.setRepositoryHome(context.getRepositoryHome());
journal.init(id, context.getNamespaceResolver());
if (records != null) {
journal.setRecords(records);
}
ClusterNode clusterNode = new ClusterNode();
clusterNode.init(context);
return clusterNode;
}
use of org.apache.jackrabbit.core.journal.MemoryJournal in project jackrabbit by apache.
the class ClusterSyncTest method createClusterNode.
/**
* Create a cluster node, with a memory journal referencing a list of records.
*
* @param id cluster node id
* @param records memory journal's list of records
* @param disableAutoSync if <code>true</code> background synchronization is disabled
*/
private ClusterNode createClusterNode(String id, boolean disableAutoSync) throws Exception {
final MemoryJournal journal = new MemoryJournal() {
protected boolean syncAgainOnNewRecords() {
return true;
}
};
JournalFactory jf = new JournalFactory() {
public Journal getJournal(NamespaceResolver resolver) throws RepositoryException {
return journal;
}
};
ClusterConfig cc = new ClusterConfig(id, SYNC_DELAY, jf);
SimpleClusterContext context = new SimpleClusterContext(cc);
journal.setRepositoryHome(context.getRepositoryHome());
journal.init(id, context.getNamespaceResolver());
journal.setRecords(records);
ClusterNode clusterNode = new ClusterNode();
clusterNode.init(context);
if (disableAutoSync) {
clusterNode.disableAutoSync();
}
return clusterNode;
}
Aggregations