/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.AuditDetailMessage
 *  com.l7tech.gateway.common.audit.SystemMessages
 *  com.l7tech.objectmodel.polback.BackgroundTask
 *  com.l7tech.util.ExceptionUtils
 */
package com.l7tech.server.task;

import com.l7tech.gateway.common.audit.AuditDetailMessage;
import com.l7tech.gateway.common.audit.SystemMessages;
import com.l7tech.objectmodel.polback.BackgroundTask;
import com.l7tech.server.message.PolicyEnforcementContext;
import com.l7tech.server.policy.assertion.AssertionStatusException;
import com.l7tech.server.task.ScheduledPolicyRunner;
import com.l7tech.util.ExceptionUtils;

class a
implements Runnable {
    final BackgroundTask val$task;
    final String val$jobName;
    final PolicyEnforcementContext val$context;
    final ScheduledPolicyRunner this$0;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    a(ScheduledPolicyRunner scheduledPolicyRunner, BackgroundTask backgroundTask, String string, PolicyEnforcementContext policyEnforcementContext) {
        this.this$0 = scheduledPolicyRunner;
        this.val$task = backgroundTask;
        this.val$jobName = string;
        this.val$context = policyEnforcementContext;
    }

    @Override
    public void run() {
        block7: {
            try {
                this.val$task.run();
            }
            catch (RuntimeException runtimeException) {
                block8: {
                    try {
                        if (!(runtimeException instanceof AssertionStatusException)) break block8;
                        this.this$0.a().logAndAudit((AuditDetailMessage)SystemMessages.SCHEDULER_POLICY_ERROR, new String[]{this.val$jobName, ((AssertionStatusException)runtimeException).getAssertionStatus().getMessage()}, ExceptionUtils.getDebugException((Throwable)runtimeException));
                        break block7;
                    }
                    catch (RuntimeException runtimeException2) {
                        throw a.a(runtimeException2);
                    }
                }
                this.this$0.a().logAndAudit((AuditDetailMessage)SystemMessages.SCHEDULER_POLICY_ERROR, new String[]{this.val$jobName, runtimeException.getMessage()}, ExceptionUtils.getDebugException((Throwable)runtimeException));
            }
            finally {
                this.val$context.close();
            }
        }
    }

    private static RuntimeException a(RuntimeException runtimeException) {
        return runtimeException;
    }
}

