org.modeshape.graph.connector.map
Class LockBasedTransaction

java.lang.Object
  extended by org.modeshape.graph.connector.map.LockBasedTransaction
All Implemented Interfaces:
MapRepositoryTransaction

@Immutable
public class LockBasedTransaction
extends Object
implements MapRepositoryTransaction

A MapRepositoryTransaction based upon a Lock.


Constructor Summary
LockBasedTransaction(Lock lock)
          Create a transaction given the lock.
 
Method Summary
 void commit()
          Commit any changes that have been made to the repository.
 void rollback()
          Rollback any changes that have been made to this repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LockBasedTransaction

public LockBasedTransaction(Lock lock)
Create a transaction given the lock. This construtor attempts to acquire the lock.

Parameters:
lock - the lock; may not be null
Method Detail

commit

public void commit()
Commit any changes that have been made to the repository. This method may throw runtime exceptions if there are failures committing the changes, but the transaction is still expected to be closed.

Specified by:
commit in interface MapRepositoryTransaction
See Also:
MapRepositoryTransaction.commit()

rollback

public void rollback()
Rollback any changes that have been made to this repository. This method may throw runtime exceptions if there are failures rolling back the changes, but the transaction is still expected to be closed.

Specified by:
rollback in interface MapRepositoryTransaction
See Also:
MapRepositoryTransaction.rollback()


Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.