|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object tp.impl.CSEP545ServiceObject tp.impl.MyTM
public class MyTM
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface tp.impl.CSEP545Service |
---|
CSEP545Service.Type |
Field Summary |
---|
Fields inherited from class tp.impl.CSEP545ServiceObject |
---|
dir, registry, svcid |
Constructor Summary | |
---|---|
MyTM()
|
Method Summary | |
---|---|
void |
abort(Transaction xid)
abort transaction |
void |
commit(Transaction xid)
commit transaction |
boolean |
enlist(Transaction xid,
String enlistingRM)
enlist the RM as a member of this transaction |
protected void |
init(String[] args)
IMPLEMENT THIS METHOD process command line parameters and setup any parameterized values. |
protected void |
initStorage()
IMPLEMENT THIS METHOD Initialize necessary data files. |
protected void |
readyToServe()
IMPLEMENT THIS METHOD Bootstrapping completed and the server is up and running. |
protected void |
recovery()
IMPLEMENT THIS METHOD Run recovery algorithm and reconstruct the state of service before failure. |
void |
refresh()
Refresh all remote references used by this service. |
void |
register(String rm)
look up RMI registry to cache remote reference of RM represented by rm . |
void |
shutdown()
Gracefully shutdown target service. |
Transaction |
start()
start a new transaction |
protected void |
startUp()
IMPLEMENT THIS METHOD If you use extra threads in your service, start them in this method. |
Methods inherited from class tp.impl.CSEP545ServiceObject |
---|
getDataRoot, getServiceID, kill, lookupRemote, lookupRemote, lookupRemote, lookupRemote, main |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MyTM()
Method Detail |
---|
public Transaction start() throws RemoteException
TM
start
in interface TM
RemoteException
WC.start()
public void commit(Transaction xid) throws InvalidTransactionException, TransactionAbortedException, RemoteException
TM
commit
in interface TM
xid
- transaction identifier
InvalidTransactionException
TransactionAbortedException
RemoteException
WC.commit(Transaction)
public void abort(Transaction xid) throws RemoteException
TM
abort
in interface TM
xid
- transaction identifier
RemoteException
WC.abort(Transaction)
public boolean enlist(Transaction xid, String enlistingRM) throws TransactionAbortedException, InvalidTransactionException, RemoteException
TM
enlist
in interface TM
xid
- transaction identifierenlistingRM
- RM to add to transaction identified by xid
true
when enlisted. false
otherwise.
TransactionAbortedException
InvalidTransactionException
RemoteException
RM.getName()
public void register(String rm) throws RemoteException
rm
. This makes easier to
coordinate two-phase commit.
register
in interface TM
rm
- the name of RM to register
RemoteException
RM.getName()
public void shutdown() throws RemoteException
CSEP545Service
Registry.unbind(String)
shutdown
in interface CSEP545Service
shutdown
in class CSEP545ServiceObject
RemoteException
Registry.unbind(String)
protected void init(String[] args) throws Exception
CSEP545ServiceObject
init
in class CSEP545ServiceObject
args
- command line arguments except common arguments
Exception
protected void initStorage() throws Exception
CSEP545ServiceObject
RM
and commit log file for TM
initStorage
in class CSEP545ServiceObject
Exception
protected void recovery() throws Exception
CSEP545ServiceObject
recovery
in class CSEP545ServiceObject
Exception
protected void startUp() throws Exception
CSEP545ServiceObject
startUp
in class CSEP545ServiceObject
Exception
protected void readyToServe() throws Exception
CSEP545ServiceObject
readyToServe
in class CSEP545ServiceObject
Exception
public void refresh() throws RemoteException, NotBoundException
CSEP545Service
refresh
in interface CSEP545Service
RemoteException
NotBoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |