Class TransactionProvider

java.lang.Object
org.fcrepo.http.commons.session.TransactionProvider
All Implemented Interfaces:
org.glassfish.hk2.api.Factory<org.fcrepo.kernel.api.Transaction>

public class TransactionProvider extends Object implements org.glassfish.hk2.api.Factory<org.fcrepo.kernel.api.Transaction>
Provide a fedora tranasction within the current request context
Author:
awoods
  • Constructor Details

    • TransactionProvider

      public TransactionProvider(org.fcrepo.kernel.api.TransactionManager txManager, javax.servlet.http.HttpServletRequest request, URI baseUri, String jmsBaseUrl)
      Create a new transaction provider for a request
      Parameters:
      txManager - the transaction manager
      request - the request
      baseUri - base uri for the application
      jmsBaseUrl - base url to use for jms, optional
  • Method Details

    • provide

      public org.fcrepo.kernel.api.Transaction provide()
      Specified by:
      provide in interface org.glassfish.hk2.api.Factory<org.fcrepo.kernel.api.Transaction>
    • dispose

      public void dispose(org.fcrepo.kernel.api.Transaction transaction)
      Specified by:
      dispose in interface org.glassfish.hk2.api.Factory<org.fcrepo.kernel.api.Transaction>
    • getTransactionForRequest

      public org.fcrepo.kernel.api.Transaction getTransactionForRequest()
      Returns the transaction for the Request. If the request has ATOMIC_ID_HEADER header, the transaction corresponding to that ID is returned, otherwise, a new transaction is created.
      Returns:
      the transaction for the request