/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.audit.Audit
 *  com.l7tech.policy.assertion.AssertionStatus
 */
package com.l7tech.server;

import com.l7tech.gateway.common.audit.Audit;
import com.l7tech.policy.assertion.AssertionStatus;
import com.l7tech.server.MessageProcessor;
import com.l7tech.server.MessageProcessorMediator;
import com.l7tech.server.audit.AuditContext;
import com.l7tech.server.audit.AuditContextFactory;
import com.l7tech.server.audit.AuditLogFormatter;
import com.l7tech.server.message.PolicyEnforcementContext;
import java.util.concurrent.Callable;

class as
implements Callable<AssertionStatus> {
    final PolicyEnforcementContext val$context;
    final AssertionStatus[] val$status;
    final MessageProcessorMediator val$messageProcessorMediator;
    final MessageProcessor this$0;

    /*
     * Ignored method signature, as it can't be verified against descriptor
     */
    as(MessageProcessor messageProcessor, PolicyEnforcementContext policyEnforcementContext, AssertionStatus[] assertionStatusArray, MessageProcessorMediator messageProcessorMediator) {
        this.this$0 = messageProcessor;
        this.val$context = policyEnforcementContext;
        this.val$status = assertionStatusArray;
        this.val$messageProcessorMediator = messageProcessorMediator;
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Loose catch block
     */
    @Override
    public AssertionStatus call() throws Exception {
        AssertionStatus assertionStatus;
        block10: {
            AuditContext auditContext = AuditContextFactory.getCurrent();
            this.val$context.setAuditContext(auditContext);
            try {
                this.val$status[0] = this.this$0.a(this.val$context, this.val$messageProcessorMediator);
                this.val$messageProcessorMediator.processMessagePostReallyProcessMessage(this.val$status[0]);
                assertionStatus = this.val$status[0];
                this.this$0.a(this.val$context, this.val$status[0], this.val$messageProcessorMediator);
            }
            catch (Throwable throwable) {
                block11: {
                    this.this$0.a(this.val$context, this.val$status[0], this.val$messageProcessorMediator);
                    String[] stringArray = AuditLogFormatter.getContextVariablesUsed();
                    try {
                        try {
                            if (stringArray == null || stringArray.length <= 0) break block11;
                        }
                        catch (Exception exception) {
                            throw as.a(exception);
                        }
                        auditContext.setContextVariables(this.val$context.getVariableMap(stringArray, (Audit)this.this$0.x));
                    }
                    catch (Exception exception) {
                        throw as.a(exception);
                    }
                }
                throw throwable;
            }
            String[] stringArray = AuditLogFormatter.getContextVariablesUsed();
            if (stringArray == null) break block10;
            try {
                block12: {
                    if (stringArray.length <= 0) break block10;
                    break block12;
                    catch (Exception exception) {
                        throw as.a(exception);
                    }
                }
                auditContext.setContextVariables(this.val$context.getVariableMap(stringArray, (Audit)this.this$0.x));
            }
            catch (Exception exception) {
                throw as.a(exception);
            }
        }
        return assertionStatus;
    }

    private static Exception a(Exception exception) {
        return exception;
    }
}

