use of com.ramussoft.common.journal.command.NewBranchCommand in project ramus by Vitaliy-Yakovchuk.
the class JournaledEngine method createBranch.
@Override
public void createBranch(long parent, long branchId, String reason, int type, String module) {
if (parent == -1l)
parent = getActiveBranch();
deligate.createBranch(parent, branchId, reason, type, module);
synchronized (swithJournalLock) {
Journal parentBranchJournal = journalFactory.getJournal(this, parent);
parentBranchJournal.store(new NewBranchCommand(this, parent, branchId, reason, type, module));
// parentBranchJournal.setLock(true);
journal = journalFactory.getJournal(this, branchId);
}
BranchEvent event = new BranchEvent(this, false, branchId, parent);
for (BranchListener listener : getBranchListeners()) listener.branchCreated(event);
for (BranchListener listener : getBranchListeners()) listener.branchActivated(event);
}
Aggregations