Class DataStoreTransactionManager

java.lang.Object
org.openjump.core.ui.plugin.datastore.transaction.DataStoreTransactionManager

public class DataStoreTransactionManager extends Object
Central class to manage datastore transactions from OpenJUMP. There is only one DataStoreTransactionManager (singleton) for the whole Workbench. This transactionManager register layers with a RWDataStoreDataSource, and each RWDataStoreDataSource record user edits (Evolutions) between two transactions. The commit method of DataStoreTransactionManager call the commit method of each registered RWDataStoreDataSource.
  • Constructor Details

    • DataStoreTransactionManager

      protected DataStoreTransactionManager()
      Don't use this constructor. Use getTransactionManager instead. The constructor is made protected to be able to sublass it.
  • Method Details

    • getTxInstance

      public static <T extends DataStoreTransactionManager> T getTxInstance(String clazz)
    • registerLayer

      public void registerLayer(Layer layer, Task task)
      Register a new Layer in the DataStoreTransactionManager. Edits happening in this Layer will be recorded in the associated RWDataStoreDataSource.
      Parameters:
      layer - the layer to be listened to.
      task - the task in which the layer is.
    • getLayers

      public Collection<Layer> getLayers()
      Get layers registered in the DataStoreTransactionManager.
    • getTask

      public Task getTask(Layer layer)
    • getLayers

      public Collection<Layer> getLayers(Task task)
    • update

      public void update(TaskFrame taskFrame)
      Update all layers associated to a RWDataStoreDataSource.
    • inspect

      public void inspect(TaskFrame taskFrame)
    • commit

      public void commit() throws Exception
      Commit all edits permformed on all registered layers since last commit.
      Throws:
      Exception