DeveelDB  20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
Public Member Functions | Protected Member Functions | Package Functions | Properties | Private Member Functions | Private Attributes | List of all members
Deveel.Data.Transactions.TableCommitCallback Class Referenceabstract

Public Member Functions

void AttachTo (ITransaction transaction)
 
void DetachFrom (ITransaction transaction)
 

Protected Member Functions

 TableCommitCallback (ObjectName tableName)
 
abstract void OnAction (IEnumerable< int > addedRows, IEnumerable< int > removedRows)
 

Package Functions

void OnTransactionStarted ()
 
void OnTransactionEnd ()
 

Properties

ObjectName TableName [get, private set]
 
bool IsInTransaction [get, private set]
 

Private Member Functions

void Act ()
 
void OnCommit (TableCommitInfo commitInfo)
 

Private Attributes

readonly List< int > addedList
 
readonly List< int > removedList
 

Detailed Description

Definition at line 24 of file TableCommitCallback.cs.

Constructor & Destructor Documentation

Deveel.Data.Transactions.TableCommitCallback.TableCommitCallback ( ObjectName  tableName)
inlineprotected

Definition at line 28 of file TableCommitCallback.cs.

28  {
29  if (tableName == null)
30  throw new ArgumentNullException("tableName");
31 
32  TableName = tableName;
33 
34  addedList = new List<int>();
35  removedList = new List<int>();
36  }

Member Function Documentation

void Deveel.Data.Transactions.TableCommitCallback.Act ( )
inlineprivate

Definition at line 66 of file TableCommitCallback.cs.

66  {
67  IList<int> add, remove;
68  lock (removedList) {
69  add = new List<int>(addedList);
70  remove = new List<int>(removedList);
71 
72  addedList.Clear();
73  removedList.Clear();
74  }
75 
76  OnAction(add, remove);
77  }
abstract void OnAction(IEnumerable< int > addedRows, IEnumerable< int > removedRows)
void Deveel.Data.Transactions.TableCommitCallback.AttachTo ( ITransaction  transaction)
inline

Definition at line 52 of file TableCommitCallback.cs.

52  {
53  transaction.RegisterOnCommit(OnCommit);
54 
55  if (transaction is ICallbackHandler)
56  ((ICallbackHandler)transaction).OnCallbackAttached(this);
57  }
void OnCommit(TableCommitInfo commitInfo)
void Deveel.Data.Transactions.TableCommitCallback.DetachFrom ( ITransaction  transaction)
inline

Definition at line 59 of file TableCommitCallback.cs.

59  {
60  transaction.UnregisterOnCommit(OnCommit);
61 
62  if (transaction is ICallbackHandler)
63  ((ICallbackHandler)transaction).OnCallbackDetached(this);
64  }
void OnCommit(TableCommitInfo commitInfo)
abstract void Deveel.Data.Transactions.TableCommitCallback.OnAction ( IEnumerable< int >  addedRows,
IEnumerable< int >  removedRows 
)
protectedpure virtual
void Deveel.Data.Transactions.TableCommitCallback.OnCommit ( TableCommitInfo  commitInfo)
inlineprivate

Definition at line 79 of file TableCommitCallback.cs.

79  {
80  if (TableName.Equals(commitInfo.TableName)) {
81  addedList.AddRange(commitInfo.AddedRows);
82  removedList.AddRange(commitInfo.RemovedRows);
83  }
84  }
override bool Equals(object obj)
Definition: ObjectName.cs:241
void Deveel.Data.Transactions.TableCommitCallback.OnTransactionEnd ( )
inlinepackage
void Deveel.Data.Transactions.TableCommitCallback.OnTransactionStarted ( )
inlinepackage

Member Data Documentation

readonly List<int> Deveel.Data.Transactions.TableCommitCallback.addedList
private

Definition at line 25 of file TableCommitCallback.cs.

readonly List<int> Deveel.Data.Transactions.TableCommitCallback.removedList
private

Definition at line 26 of file TableCommitCallback.cs.

Property Documentation

bool Deveel.Data.Transactions.TableCommitCallback.IsInTransaction
getprivate setprotected

Definition at line 40 of file TableCommitCallback.cs.

ObjectName Deveel.Data.Transactions.TableCommitCallback.TableName
getprivate set

Definition at line 38 of file TableCommitCallback.cs.


The documentation for this class was generated from the following file: