/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.transport.jms.JmsConnection
 *  javax.jms.ExceptionListener
 *  javax.jms.JMSException
 *  javax.jms.MessageListener
 */
package com.l7tech.server.transport.jms2;

import com.l7tech.gateway.common.transport.jms.JmsConnection;
import com.l7tech.server.transport.jms.JmsBag;
import com.l7tech.server.transport.jms.JmsRuntimeException;
import com.l7tech.server.transport.jms2.AbstractJmsEndpointListener;
import com.l7tech.server.transport.jms2.JmsConnectionMaxWaitException;
import com.l7tech.server.transport.jms2.asynch.JmsTask;
import javax.jms.ExceptionListener;
import javax.jms.JMSException;
import javax.jms.MessageListener;
import javax.naming.NamingException;

class a
implements Runnable {
    final AbstractJmsEndpointListener this$0;
    private static final String[] a;

    private a(AbstractJmsEndpointListener abstractJmsEndpointListener) {
        this.this$0 = abstractJmsEndpointListener;
        abstractJmsEndpointListener.g = new Thread((Runnable)this, this.toString());
        abstractJmsEndpointListener.g.setDaemon(true);
    }

    private void a() throws NamingException, JmsRuntimeException, JMSException, JmsConnectionMaxWaitException {
        int n2 = 1;
        String string = this.this$0._endpointCfg.getConnection().properties().getProperty(JmsConnection.PROP_DEDICATED_CONSUMER_SIZE);
        if (string != null) {
            n2 = Integer.parseInt(string);
        }
        if (n2 < 1) {
            n2 = 1;
        }
        for (int i2 = 0; i2 < n2; ++i2) {
            JmsBag jmsBag = this.this$0.resourceManager.borrowJmsBag(this.this$0._endpointCfg);
            try {
                jmsBag.getMessageConsumer().setMessageListener((MessageListener)new JmsTask(this.this$0._endpointCfg, jmsBag));
                this.this$0.receivers.add(jmsBag);
                if (jmsBag.getConnection() == null) continue;
                jmsBag.getConnection().setExceptionListener((ExceptionListener)this.this$0);
                continue;
            }
            catch (NamingException namingException) {
                throw com.l7tech.server.transport.jms2.a.a(namingException);
            }
        }
    }

    /*
     * Exception decompiling
     */
    @Override
    public final void run() {
        /*
         * This method has failed to decompile.  When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file.
         * 
         * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [10[UNCONDITIONALDOLOOP]], but top level block is 0[TRYBLOCK]
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484)
         *     at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278)
         *     at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201)
         *     at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94)
         *     at org.benf.cfr.reader.entities.Method.analyse(Method.java:531)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055)
         *     at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942)
         *     at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257)
         *     at org.benf.cfr.reader.Driver.doJar(Driver.java:139)
         *     at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76)
         *     at org.benf.cfr.reader.Main.main(Main.java:54)
         */
        throw new IllegalStateException("Decompilation failed");
    }

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

    /*
     * Enabled aggressive block sorting
     */
    static {
        String[] stringArray = new String[3];
        int n2 = 0;
        String string = "Vs\u000bP^\u0014nb'.m}]pjk\bE\\]ok'\u001f\u0010S\u001aVs\u0005RZ\u0014nb'.m}]pjk\bE\\]ok'\u001f\u0010S\u001aVs\u000bP^\u0014nb'.m}]pjk\bE\\]ok'\u001f\u0010S";
        int n3 = "Vs\u000bP^\u0014nb'.m}]pjk\bE\\]ok'\u001f\u0010S\u001aVs\u0005RZ\u0014nb'.m}]pjk\bE\\]ok'\u001f\u0010S\u001aVs\u000bP^\u0014nb'.m}]pjk\bE\\]ok'\u001f\u0010S".length();
        int n4 = 26;
        int n5 = -1;
        while (true) {
            int n6 = ++n5;
            stringArray[n2++] = com.l7tech.server.transport.jms2.a.a(109, com.l7tech.server.transport.jms2.a.a(string.substring(n6, n6 + n4)));
            if ((n5 += n4) >= n3) {
                a = stringArray;
                return;
            }
            n4 = string.charAt(n5);
        }
    }

    private static char[] a(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x6D);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 104;
                    case 1 -> 106;
                    case 2 -> 9;
                    case 3 -> 77;
                    case 4 -> 67;
                    case 5 -> 16;
                    default -> 109;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

