ProcessFactoryManager.java 3.84 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  org.slf4j.Logger
 *  org.slf4j.LoggerFactory
 */
package com.adobe.service;

import com.adobe.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

public class ProcessFactoryManager
extends ConnectionFactoryManager
implements ProcessAttributes {
    private static final Logger logger = LoggerFactory.getLogger(ProcessFactoryManager.class);
    private String exeName = "";
    private String exeArgs = "";
    private String classPath = "";
    private String[] sharedLibraryPaths = new String[0];
    private String nativeDependencies = "";
    private String jvmArgs = "";
    private String orbParams = "";
    private boolean isDebug = false;
    private int maxReUseCount = 1000;
    private double maxReUseVariation = 0.1;

    public ProcessFactoryManager(ServiceAPI aService) {
        this(aService, "");
    }

    public ProcessFactoryManager(ServiceAPI aService, String exeName) {
        super(aService);
        this.setExecutableName(exeName);
        String nativeDependencies = System.getProperty("com.adobe.service" + aService.getName() + ".nativedeps");
        if (nativeDependencies != null && nativeDependencies.trim().length() > 0) {
            this.setNativeDependencies(nativeDependencies);
        }
    }

    ConnectionResource createConnectionResource() {
        try {
            return new ProcessResource(this.service, this);
        }
        catch (IOException ioe) {
            logger.warn("Error encountered creating new process-resource", (Throwable)ioe);
            return null;
        }
    }

    public void setExecutableName(String executableName) {
        if (this.exeName != null) {
            this.exeName = executableName;
        }
    }

    public String getExecutableName() {
        return this.exeName;
    }

    public void setJVMArgs(String jvmArgs) {
        if (jvmArgs != null) {
            this.jvmArgs = jvmArgs;
        }
    }

    public String getJVMArgs() {
        return this.jvmArgs;
    }

    public void setClassPath(String classPath) {
        if (classPath != null) {
            this.classPath = classPath;
        }
    }

    public String getClassPath() {
        return this.classPath;
    }

    public void setSharedLibraryPaths(String[] paths) {
        if (paths != null) {
            this.sharedLibraryPaths = new String[paths.length];
            for (int i = 0; i < paths.length; ++i) {
                this.sharedLibraryPaths[i] = paths[i];
            }
        }
    }

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

    public void setNativeDependencies(String nativeDependencies) {
        if (nativeDependencies != null) {
            this.nativeDependencies = nativeDependencies;
        }
    }

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

    public void setExecutableArguments(String args) {
        if (args != null) {
            this.exeArgs = args;
        }
    }

    public String getExecutableArguments() {
        return this.exeArgs;
    }

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

    public void setDebug(boolean inDebug) {
        this.isDebug = inDebug;
    }

    public void setORBParams(String params) {
        if (this.orbParams != null) {
            this.orbParams = params;
        }
    }

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

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

    public void setMaximumReUseCount(int inMaximumReUseCount) {
        this.maxReUseCount = inMaximumReUseCount;
    }

    public double getMaximumReUseVariation() {
        return this.maxReUseVariation;
    }

    public void setMaximumReUseVariation(int in) {
        this.maxReUseVariation = in;
    }
}