Native2PDFSvc.java 3.15 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Property
 *  org.apache.felix.scr.annotations.Service
 *  org.apache.sling.commons.osgi.OsgiUtil
 */
package com.adobe.native2pdf.bmc;

import com.adobe.native2pdf.bmc.ConverterBslJService;
import com.adobe.native2pdf.bmc.Native2PDFSvcMBean;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Property;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.commons.osgi.OsgiUtil;

@Component(metatype=1, immediate=1, label="%native2pdf.bmc.name", description="%native2pdf.bmc.description", inherit=1)
@Service
public class Native2PDFSvc
extends ConverterBslJService
implements Native2PDFSvcMBean {
    private static final int DEFAULT_MAX_LAUNCH_APP_RETRY_COUNT = 1;
    @Property(intValue={1})
    private static final String PROP_MAX_LAUNCH_APP_RETRY_COUNT = "native2pdf.bmc.maxLaunchAppRetryCount";
    private static final boolean DEFAULT_USE_CUSTOM_LAUNCHER = true;
    @Property(boolValue={1})
    private static final String PROP_USE_CUSTOM_LAUNCHER = "UseCustomLauncher";
    protected int m_maxLaunchAppRetryCount;
    protected boolean m_useCustomLauncher;

    public Native2PDFSvc() {
        this.m_MainClassArg = "com.adobe.native2pdf.bmc.Native2PDFConverterServer";
        this.mKillsplwow64 = "True";
        this.m_maxLaunchAppRetryCount = 0;
    }

    protected void initializeConfig(Map config) {
        super.initializeConfig(config);
        int maxAppRetryCount = OsgiUtil.toInteger(config.get("native2pdf.bmc.maxLaunchAppRetryCount"), (int)1);
        this.setMaxLaunchAppRetryCount(maxAppRetryCount);
        boolean useCustomLauncher = OsgiUtil.toBoolean(config.get("UseCustomLauncher"), (boolean)true);
        this.setUseCustomLauncher(useCustomLauncher);
    }

    protected synchronized void copyConfigResources(File persistentDir) throws IOException {
    }

    public boolean getDebug() {
        return super.getDebug();
    }

    public int getMaximumReUseCount() {
        return super.getMaximumReUseCount();
    }

    public String getORBParams() {
        return super.getORBParams();
    }

    public int getPoolMax() {
        return super.getPoolMax();
    }

    public void setDebug(boolean debug) {
        super.setDebug(debug);
    }

    public void setMaximumReUseCount(int count) {
        super.setMaximumReUseCount(count);
    }

    public void setORBParams(String params) {
        super.setORBParams(params);
    }

    public void setPoolMax(int newMax) {
        super.setPoolMax(newMax);
    }

    public int getMaxLaunchAppRetryCount() {
        return this.m_maxLaunchAppRetryCount;
    }

    public void setMaxLaunchAppRetryCount(int newMax) {
        if (newMax >= 0) {
            this.m_maxLaunchAppRetryCount = newMax;
        }
    }

    public boolean getUseCustomLauncher() {
        return this.m_useCustomLauncher;
    }

    public void setUseCustomLauncher(boolean useCustomLauncher) {
        this.m_useCustomLauncher = useCustomLauncher;
    }
}