/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.util.Eithers
 *  com.l7tech.util.Functions$Nullary
 *  org.springframework.transaction.TransactionStatus
 *  org.springframework.transaction.support.TransactionCallback
 */
package com.l7tech.server.module;

import com.l7tech.server.module.ServerModuleFileListener;
import com.l7tech.util.Eithers;
import com.l7tech.util.Functions;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallback;

class j
implements TransactionCallback<R> {
    final Functions.Nullary val$callback;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    j(ServerModuleFileListener serverModuleFileListener, Functions.Nullary nullary) {
        this.val$callback = nullary;
    }

    public R doInTransaction(TransactionStatus transactionStatus) {
        try {
            Object object = this.val$callback.call();
            try {
                if (!Eithers.isSuccess((Object)object)) {
                    transactionStatus.setRollbackOnly();
                }
            }
            catch (Throwable throwable) {
                throw j.a(throwable);
            }
            return object;
        }
        catch (Throwable throwable) {
            transactionStatus.setRollbackOnly();
            throw new RuntimeException(throwable);
        }
    }

    private static Throwable a(Throwable throwable) {
        return throwable;
    }
}

