Mercurial > hg > blitz_condensed
comparison src/org/dancres/blitz/remote/TxnGatewayImpl.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.remote; | |
2 | |
3 import java.rmi.RemoteException; | |
4 | |
5 import net.jini.core.transaction.UnknownTransactionException; | |
6 import net.jini.core.transaction.CannotJoinException; | |
7 | |
8 import net.jini.core.transaction.server.TransactionManager; | |
9 import net.jini.core.transaction.server.TransactionParticipant; | |
10 import net.jini.core.transaction.server.CrashCountException; | |
11 | |
12 import org.dancres.blitz.txn.TxnGateway; | |
13 import org.dancres.blitz.txn.TxnId; | |
14 | |
15 /** | |
16 "Glue" between the non-remote internals of Blitz and the outside (remote) | |
17 world. | |
18 */ | |
19 class TxnGatewayImpl implements TxnGateway { | |
20 private long theCrashCount = System.currentTimeMillis(); | |
21 private TransactionParticipant theParticipantStub; | |
22 | |
23 TxnGatewayImpl(TransactionParticipant aStub) { | |
24 theParticipantStub = aStub; | |
25 } | |
26 | |
27 public void join(TxnId anId) | |
28 throws UnknownTransactionException, CannotJoinException, | |
29 CrashCountException, RemoteException { | |
30 | |
31 anId.getManager().join(anId.getId(), theParticipantStub, | |
32 theCrashCount); | |
33 } | |
34 | |
35 public int getState(TxnId anId) | |
36 throws UnknownTransactionException, RemoteException { | |
37 | |
38 return anId.getManager().getState(anId.getId()); | |
39 } | |
40 } |