1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package com.ontotext.ordi.tripleset.impl;
19
20 import java.util.List;
21
22 import com.ontotext.ordi.exception.ORDIException;
23 import com.ontotext.ordi.tripleset.ConnectionImpl;
24 import com.ontotext.ordi.tripleset.Listener;
25 import com.ontotext.ordi.tripleset.TConnection;
26 import com.ontotext.ordi.tripleset.TSource;
27
28 public abstract class TConnectionImpl extends ConnectionImpl implements
29 TConnection {
30
31 protected final CallMultiplexor listeners = new CallMultiplexor();
32
33 public TConnectionImpl(TSource source) {
34 super(source);
35 }
36
37 public void addListener(Listener listener) {
38 if (listener != null) {
39 listeners.addListener(listener);
40 }
41 }
42
43 public void removeListener(Listener listener) {
44 listeners.removeListener(listener);
45 }
46
47 public List<Listener> listListeners() {
48 return listeners.listListeners();
49 }
50
51 public void close() throws ORDIException {
52 listeners.onClose();
53 }
54
55 public void commit() throws ORDIException {
56 listeners.onCommit();
57 }
58
59 public void rollback() throws ORDIException {
60 listeners.onRollback();
61 }
62 }