|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecttp.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 TMRemoteExceptionWC.start()
public void commit(Transaction xid)
throws InvalidTransactionException,
TransactionAbortedException,
RemoteException
TM
commit in interface TMxid - transaction identifier
InvalidTransactionException
TransactionAbortedException
RemoteExceptionWC.commit(Transaction)
public void abort(Transaction xid)
throws RemoteException
TM
abort in interface TMxid - transaction identifier
RemoteExceptionWC.abort(Transaction)
public boolean enlist(Transaction xid,
String enlistingRM)
throws TransactionAbortedException,
InvalidTransactionException,
RemoteException
TM
enlist in interface TMxid - transaction identifierenlistingRM - RM to add to transaction identified by xid
true when enlisted. false otherwise.
TransactionAbortedException
InvalidTransactionException
RemoteExceptionRM.getName()
public void register(String rm)
throws RemoteException
rm. This makes easier to
coordinate two-phase commit.
register in interface TMrm - the name of RM to register
RemoteExceptionRM.getName()
public void shutdown()
throws RemoteException
CSEP545ServiceRegistry.unbind(String)
shutdown in interface CSEP545Serviceshutdown in class CSEP545ServiceObjectRemoteExceptionRegistry.unbind(String)
protected void init(String[] args)
throws Exception
CSEP545ServiceObject
init in class CSEP545ServiceObjectargs - command line arguments except common arguments
Exception
protected void initStorage()
throws Exception
CSEP545ServiceObjectRM
and commit log file for TM
initStorage in class CSEP545ServiceObjectException
protected void recovery()
throws Exception
CSEP545ServiceObject
recovery in class CSEP545ServiceObjectException
protected void startUp()
throws Exception
CSEP545ServiceObject
startUp in class CSEP545ServiceObjectException
protected void readyToServe()
throws Exception
CSEP545ServiceObject
readyToServe in class CSEP545ServiceObjectException
public void refresh()
throws RemoteException,
NotBoundException
CSEP545Service
refresh in interface CSEP545ServiceRemoteException
NotBoundException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||