175.

previous chapter table of contents next chapter
  

TransactionManager

A transaction manager looks after the two-phase commit protocol for all the participants in a transaction. It is responsible for creating a new transaction with its create() method. Any of the participants can force the transaction to abort by calling abort() , or they can force it to the two-phase commit stage by calling commit() .

 public interface TransactionManager {     Created create(long leaseFor) throws ...;     void join(long id, TransactionParticipant part,               long crashCount) throws ...;     void commit(long id) throws ...;     void abort(long id) throws ...;     ... } 

When a participant joins a transaction, it registers a listener of type TransactionParticipant . If any participant calls commit() , the transaction manager starts the voting process using all of these listeners. If all of these are prepared to commit, then the manager moves all of these listeners to the commit stage. Alternatively, any of the participants can call abort() , which forces all of the listeners to abort.

  


A Programmer[ap]s Guide to Jini Technology
A Programmer[ap]s Guide to Jini Technology
ISBN: 1893115801
EAN: N/A
Year: 2000
Pages: 189

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net