comparison src/org/dancres/blitz/txn/LocalTxnManager.java @ 0:3dc0c5604566

Initial checkin of blitz 2.0 fcs - no installer yet.
author Dan Creswell <dan.creswell@gmail.com>
date Sat, 21 Mar 2009 11:00:06 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:3dc0c5604566
1 package org.dancres.blitz.txn;
2
3 import java.io.Serializable;
4
5 import java.rmi.RemoteException;
6
7 import net.jini.core.lease.LeaseDeniedException;
8 import net.jini.core.transaction.*;
9 import net.jini.core.transaction.server.*;
10
11 /**
12 Provides uniformity in the way we handle transactions. Where all
13 transactions are seen to have a manager. Thus, all null transactions
14 have a transaction manager of type LocalTxnManager.
15 */
16 class LocalTxnManager implements TransactionManager, Serializable {
17
18 /**
19 * This will need updating based on reading the log or reading
20 * from checkpoint or both! NO IT WON'T we simply won't log these - they
21 * either complete or they don't - they're one operation wonders which
22 * don't need logging.
23 */
24 private long theNextNullKey = 0;
25
26 long nextId() {
27 synchronized(this) {
28 return theNextNullKey++;
29 }
30 }
31
32 public Created create(long lease)
33 throws LeaseDeniedException, RemoteException {
34
35 throw new org.dancres.util.NotImplementedException();
36 }
37
38 public void join(long id, TransactionParticipant part, long crashCount)
39 throws UnknownTransactionException, CannotJoinException,
40 CrashCountException, RemoteException {
41
42 throw new org.dancres.util.NotImplementedException();
43 }
44
45 public int getState(long id)
46 throws UnknownTransactionException, RemoteException {
47
48 throw new org.dancres.util.NotImplementedException();
49 }
50
51 public void commit(long id)
52 throws UnknownTransactionException, CannotCommitException,
53 RemoteException {
54
55 throw new org.dancres.util.NotImplementedException();
56 }
57
58 public void commit(long id, long waitFor)
59 throws UnknownTransactionException, CannotCommitException,
60 TimeoutExpiredException, RemoteException {
61
62 throw new org.dancres.util.NotImplementedException();
63 }
64
65 public void abort(long id)
66 throws UnknownTransactionException, CannotAbortException,
67 RemoteException {
68
69 throw new org.dancres.util.NotImplementedException();
70 }
71
72 public void abort(long id, long waitFor)
73 throws UnknownTransactionException, CannotAbortException,
74 TimeoutExpiredException, RemoteException {
75
76 throw new org.dancres.util.NotImplementedException();
77 }
78
79 public String toString() {
80 return "NullTxnMgr";
81 }
82
83 public int hashCode() {
84 return 1;
85 }
86
87 public boolean equals(Object anObject) {
88 if (anObject instanceof LocalTxnManager)
89 return true;
90 else
91 return false;
92 }
93 }