Class 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 Detail

      • TransactionProvider

        public TransactionProvider​(org.fcrepo.kernel.api.TransactionManager txManager,
                                   javax.servlet.http.HttpServletRequest request,
                                   URI baseUri)
        Create a new transaction provider for a request
        Parameters:
        txManager - the transaction manager
        request - the request
        baseUri - base uri for the application
    • Method Detail

      • 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