ColorProfileSvc.java 4.49 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.service.ProcessFactoryManager
 *  com.adobe.service.ResourceFactoryManager
 *  com.adobe.service.Service
 *  com.adobe.service.ServiceAPI
 *  org.apache.felix.scr.annotations.Component
 *  org.apache.felix.scr.annotations.Property
 *  org.apache.felix.scr.annotations.Service
 *  org.apache.sling.commons.osgi.OsgiUtil
 *  org.slf4j.Logger
 *  org.slf4j.LoggerFactory
 */
package com.adobe.colorprofile;

import com.adobe.colorprofile.ColorProfileSvcMBean;
import com.adobe.service.ProcessFactoryManager;
import com.adobe.service.ResourceFactoryManager;
import com.adobe.service.ServiceAPI;
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;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

@Component(metatype=1, immediate=1, label="%colorProfile.bmc.name", description="%colorProfile.bmc.description", inherit=1)
@Service
public class ColorProfileSvc
extends com.adobe.service.Service
implements ColorProfileSvcMBean {
    private static final boolean DEFAULT_DEBUG = false;
    @Property(boolValue={0})
    private static final String PROP_DEBUG = "Debug";
    private static final int DEFAULT_MAX_REUSE_COUNT = 1000;
    @Property(intValue={1000})
    private static final String PROP_MAX_REUSE_COUNT = "MaxReuseCount";
    private static final String DEFAULT_ORB_PARAMS = "";
    @Property(value={""})
    private static final String PROP_ORB_PARAMS = "ORBParams";
    private static final long DEFAULT_GLOBAL_TIMEOUT = 300;
    @Property(longValue={300})
    private static final String PROP_GLOBAL_TIMEOUT = "GlobalTimeout";
    private static final String EXECUTABLE_NAME = "ColorProfileService.exe";
    private static final Logger logger = LoggerFactory.getLogger(ColorProfileSvc.class);
    private ProcessFactoryManager processFactoryManager;
    private long m_globalTimeout;

    public void onStartService(Map config) {
        logger.debug("ColorProfileService starting");
        boolean debug = OsgiUtil.toBoolean(config.get("Debug"), (boolean)false);
        int maxReuseCount = OsgiUtil.toInteger(config.get("MaxReuseCount"), (int)1000);
        String orbParams = OsgiUtil.toString(config.get("ORBParams"), (String)"");
        long globalTimeout = OsgiUtil.toLong(config.get("GlobalTimeout"), (long)300);
        this.processFactoryManager = new ProcessFactoryManager((ServiceAPI)this);
        this.processFactoryManager.setExecutableName("ColorProfileService.exe");
        this.processFactoryManager.setExecutableArguments("");
        this.setDebug(debug);
        this.setMaximumReUseCount(maxReuseCount);
        this.setORBParams(orbParams);
        this.setGlobalTimeout(globalTimeout);
        this.registerConnectionFactoryManager((ResourceFactoryManager)this.processFactoryManager);
    }

    public void onStopService() {
        logger.debug("ColorProfileService stopping");
    }

    public String about() {
        return "Adobe AEM Forms PDF Generator";
    }

    public long getTotalConversions() {
        return 0;
    }

    public long getGlobalTimeout() {
        return this.m_globalTimeout;
    }

    public void setGlobalTimeout(long timeout) {
        this.m_globalTimeout = timeout;
    }

    public boolean getDebug() {
        return this.processFactoryManager.getDebug();
    }

    public void setDebug(boolean debug) {
        this.processFactoryManager.setDebug(debug);
    }

    public int getMaximumReUseCount() {
        return this.processFactoryManager.getMaximumReUseCount();
    }

    public void setMaximumReUseCount(int count) {
        this.processFactoryManager.setMaximumReUseCount(count);
    }

    public void setORBParams(String params) {
        this.processFactoryManager.setORBParams(params);
    }

    public String getORBParams() {
        return this.processFactoryManager.getORBParams();
    }

    public void setNativeDependencies(String nativeDependencies) {
        this.processFactoryManager.setNativeDependencies(nativeDependencies);
    }

    public String getNativeDependencies() {
        return this.processFactoryManager.getNativeDependencies();
    }

    public String[] getSharedLibraryPaths() {
        return this.processFactoryManager.getSharedLibraryPaths();
    }

    public void setSharedLibraryPaths(String[] sharedLibraryPaths) {
        this.processFactoryManager.setSharedLibraryPaths(sharedLibraryPaths);
    }
}