SyncTransactable.java 1.82 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.transaction.RollbackException
 *  javax.transaction.Synchronization
 *  javax.transaction.SystemException
 *  javax.transaction.Transaction
 *  org.slf4j.Logger
 *  org.slf4j.LoggerFactory
 */
package com.adobe.service;

import com.adobe.service.ResourcePeerImpl;
import com.adobe.service.Transactable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;

class SyncTransactable
implements Transactable {
    private static final Logger logger = LoggerFactory.getLogger(SyncTransactable.class);

    public boolean enlist(Transaction transact, ResourcePeerImpl resourcePeer) throws RollbackException, SystemException, IllegalStateException {
        if (transact == null) {
            return false;
        }
        try {
            transact.registerSynchronization((Synchronization)resourcePeer);
        }
        catch (RollbackException e) {
            logger.warn("Error enlisting with transaction", (Throwable)e);
            throw new RollbackException(e.toString());
        }
        catch (SystemException e) {
            logger.warn("Error enlisting with transaction", (Throwable)e);
            throw new SystemException(e.toString());
        }
        catch (IllegalStateException e) {
            logger.warn("Error enlisting with transaction", (Throwable)e);
            throw new IllegalStateException(e.toString());
        }
        return true;
    }

    public boolean delist(Transaction transact, ResourcePeerImpl resourcePeer) throws SystemException, IllegalStateException {
        if (transact == null) {
            return false;
        }
        return true;
    }
}