コード例 #1
0
 public virtual void Add(TransactionHook hook, TransactionHook_Outcome outcome)
 {
     HooksWithAttachment.Add(Pair.of(hook, outcome));
     if (outcome != null && !outcome.Successful)
     {
         FailureConflict = outcome.Failure();
     }
 }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") public void afterCommit(org.neo4j.storageengine.api.txstate.ReadableTransactionState state, org.neo4j.kernel.api.KernelTransaction tx, TransactionHooksState hooksState)
        public virtual void AfterCommit(ReadableTransactionState state, KernelTransaction tx, TransactionHooksState hooksState)
        {
            if (hooksState == null)
            {
                return;
            }
            foreach (Pair <TransactionHook, TransactionHook_Outcome> hookAndOutcome in hooksState.HooksWithOutcome())
            {
                TransactionHook         hook    = hookAndOutcome.First();
                TransactionHook_Outcome outcome = hookAndOutcome.Other();
                hook.afterCommit(state, tx, outcome);
            }
        }
コード例 #3
0
        public virtual TransactionHooksState BeforeCommit(ReadableTransactionState state, KernelTransaction tx, StorageReader storageReader)
        {
            if (Hooks.Count == 0)
            {
                return(null);
            }

            TransactionHooksState hookState = new TransactionHooksState();

            foreach (TransactionHook hook in Hooks)
            {
                TransactionHook_Outcome outcome = hook.beforeCommit(state, tx, storageReader);
                hookState.Add(hook, outcome);
            }
            return(hookState);
        }