org.artofsolving.jodconverter.process.ProcessManager Java Examples

The following examples show how to use org.artofsolving.jodconverter.process.ProcessManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProcessPoolOfficeManager.java    From kkFileViewOfficeEdit with Apache License 2.0 6 votes vote down vote up
public ProcessPoolOfficeManager(File officeHome, UnoUrl[] unoUrls, String[] runAsArgs, File templateProfileDir, File workDir,
          long retryTimeout, long taskQueueTimeout, long taskExecutionTimeout, int maxTasksPerProcess,
          ProcessManager processManager) {
this.taskQueueTimeout = taskQueueTimeout;
      pool = new ArrayBlockingQueue<PooledOfficeManager>(unoUrls.length);
      pooledManagers = new PooledOfficeManager[unoUrls.length];
      for (int i = 0; i < unoUrls.length; i++) {
          PooledOfficeManagerSettings settings = new PooledOfficeManagerSettings(unoUrls[i]);
          settings.setRunAsArgs(runAsArgs);
          settings.setTemplateProfileDir(templateProfileDir);
          settings.setWorkDir(workDir);
          settings.setOfficeHome(officeHome);
          settings.setRetryTimeout(retryTimeout);
          settings.setTaskExecutionTimeout(taskExecutionTimeout);
          settings.setMaxTasksPerProcess(maxTasksPerProcess);
          settings.setProcessManager(processManager);
          pooledManagers[i] = new PooledOfficeManager(settings);
      }
      logger.info("ProcessManager implementation is " + processManager.getClass().getSimpleName());
  }
 
Example #2
Source File: ProcessPoolOfficeManager.java    From wenku with MIT License 6 votes vote down vote up
public ProcessPoolOfficeManager(File officeHome, UnoUrl[] unoUrls, String[] runAsArgs, File templateProfileDir, File workDir,
          long retryTimeout, long taskQueueTimeout, long taskExecutionTimeout, int maxTasksPerProcess,
          ProcessManager processManager) {
this.taskQueueTimeout = taskQueueTimeout;
      pool = new ArrayBlockingQueue<PooledOfficeManager>(unoUrls.length);
      pooledManagers = new PooledOfficeManager[unoUrls.length];
      for (int i = 0; i < unoUrls.length; i++) {
          PooledOfficeManagerSettings settings = new PooledOfficeManagerSettings(unoUrls[i]);
          settings.setRunAsArgs(runAsArgs);
          settings.setTemplateProfileDir(templateProfileDir);
          settings.setWorkDir(workDir);
          settings.setOfficeHome(officeHome);
          settings.setRetryTimeout(retryTimeout);
          settings.setTaskExecutionTimeout(taskExecutionTimeout);
          settings.setMaxTasksPerProcess(maxTasksPerProcess);
          settings.setProcessManager(processManager);
          pooledManagers[i] = new PooledOfficeManager(settings);
      }
      logger.info("ProcessManager implementation is " + processManager.getClass().getSimpleName());
  }
 
Example #3
Source File: ProcessPoolOfficeManager.java    From kkFileView with Apache License 2.0 6 votes vote down vote up
public ProcessPoolOfficeManager(File officeHome, UnoUrl[] unoUrls, String[] runAsArgs, File templateProfileDir, File workDir,
          long retryTimeout, long taskQueueTimeout, long taskExecutionTimeout, int maxTasksPerProcess,
          ProcessManager processManager) {
this.taskQueueTimeout = taskQueueTimeout;
      pool = new ArrayBlockingQueue<PooledOfficeManager>(unoUrls.length);
      pooledManagers = new PooledOfficeManager[unoUrls.length];
      for (int i = 0; i < unoUrls.length; i++) {
          PooledOfficeManagerSettings settings = new PooledOfficeManagerSettings(unoUrls[i]);
          settings.setRunAsArgs(runAsArgs);
          settings.setTemplateProfileDir(templateProfileDir);
          settings.setWorkDir(workDir);
          settings.setOfficeHome(officeHome);
          settings.setRetryTimeout(retryTimeout);
          settings.setTaskExecutionTimeout(taskExecutionTimeout);
          settings.setMaxTasksPerProcess(maxTasksPerProcess);
          settings.setProcessManager(processManager);
          pooledManagers[i] = new PooledOfficeManager(settings);
      }
      logger.info("ProcessManager implementation is " + processManager.getClass().getSimpleName());
  }
 
Example #4
Source File: DefaultOfficeManagerConfiguration.java    From kkFileViewOfficeEdit with Apache License 2.0 5 votes vote down vote up
private ProcessManager findBestProcessManager() {
    if (isSigarAvailable()) {
        return new SigarProcessManager();
    } else if (PlatformUtils.isLinux()) {
    	LinuxProcessManager processManager = new LinuxProcessManager();
    	if (runAsArgs != null) {
    		processManager.setRunAsArgs(runAsArgs);
    	}
    	return processManager;
    } else {
        // NOTE: UnixProcessManager can't be trusted to work on Solaris
        // because of the 80-char limit on ps output there  
        return new PureJavaProcessManager();
    }
}
 
Example #5
Source File: OfficeProcess.java    From wenku with MIT License 5 votes vote down vote up
public OfficeProcess(File officeHome, UnoUrl unoUrl, String[] runAsArgs, File templateProfileDir, File workDir, ProcessManager processManager) {
    this.officeHome = officeHome;
    this.unoUrl = unoUrl;
    this.runAsArgs = runAsArgs;
    this.templateProfileDir = templateProfileDir;
    this.instanceProfileDir = getInstanceProfileDir(workDir, unoUrl);
    this.processManager = processManager;
}
 
Example #6
Source File: DefaultOfficeManagerConfiguration.java    From wenku with MIT License 5 votes vote down vote up
private ProcessManager findBestProcessManager() {
    if (PlatformUtils.isLinux()) {
    	LinuxProcessManager processManager = new LinuxProcessManager();
    	if (runAsArgs != null) {
    		processManager.setRunAsArgs(runAsArgs);
    	}
    	return processManager;
    } else {
        // NOTE: UnixProcessManager can't be trusted to work on Solaris
        // because of the 80-char limit on ps output there  
        return new PureJavaProcessManager();
    }
}
 
Example #7
Source File: OfficeProcess.java    From kkFileView with Apache License 2.0 5 votes vote down vote up
public OfficeProcess(File officeHome, UnoUrl unoUrl, String[] runAsArgs, File templateProfileDir, File workDir, ProcessManager processManager) {
    this.officeHome = officeHome;
    this.unoUrl = unoUrl;
    this.runAsArgs = runAsArgs;
    this.templateProfileDir = templateProfileDir;
    this.instanceProfileDir = getInstanceProfileDir(workDir, unoUrl);
    this.processManager = processManager;
}
 
Example #8
Source File: DefaultOfficeManagerConfiguration.java    From kkFileView with Apache License 2.0 5 votes vote down vote up
private ProcessManager findBestProcessManager() {
    if (isSigarAvailable()) {
        return new SigarProcessManager();
    } else if (PlatformUtils.isLinux()) {
    	LinuxProcessManager processManager = new LinuxProcessManager();
    	if (runAsArgs != null) {
    		processManager.setRunAsArgs(runAsArgs);
    	}
    	return processManager;
    } else {
        // NOTE: UnixProcessManager can't be trusted to work on Solaris
        // because of the 80-char limit on ps output there  
        return new PureJavaProcessManager();
    }
}
 
Example #9
Source File: OfficeProcess.java    From kkFileViewOfficeEdit with Apache License 2.0 5 votes vote down vote up
public OfficeProcess(File officeHome, UnoUrl unoUrl, String[] runAsArgs, File templateProfileDir, File workDir, ProcessManager processManager) {
    this.officeHome = officeHome;
    this.unoUrl = unoUrl;
    this.runAsArgs = runAsArgs;
    this.templateProfileDir = templateProfileDir;
    this.instanceProfileDir = getInstanceProfileDir(workDir, unoUrl);
    this.processManager = processManager;
}
 
Example #10
Source File: ManagedOfficeProcessSettings.java    From kkFileView with Apache License 2.0 4 votes vote down vote up
public ProcessManager getProcessManager() {
    return processManager;
}
 
Example #11
Source File: ManagedOfficeProcessSettings.java    From kkFileView with Apache License 2.0 4 votes vote down vote up
public void setProcessManager(ProcessManager processManager) {
    this.processManager = processManager;
}
 
Example #12
Source File: ManagedOfficeProcessSettings.java    From kkFileViewOfficeEdit with Apache License 2.0 4 votes vote down vote up
public void setProcessManager(ProcessManager processManager) {
    this.processManager = processManager;
}
 
Example #13
Source File: ManagedOfficeProcessSettings.java    From kkFileViewOfficeEdit with Apache License 2.0 4 votes vote down vote up
public ProcessManager getProcessManager() {
    return processManager;
}
 
Example #14
Source File: ManagedOfficeProcessSettings.java    From wenku with MIT License 4 votes vote down vote up
public ProcessManager getProcessManager() {
    return processManager;
}
 
Example #15
Source File: ManagedOfficeProcessSettings.java    From wenku with MIT License 4 votes vote down vote up
public void setProcessManager(ProcessManager processManager) {
    this.processManager = processManager;
}
 
Example #16
Source File: DefaultOfficeManagerConfiguration.java    From kkFileView with Apache License 2.0 2 votes vote down vote up
/**
 * Provide a specific {@link ProcessManager} implementation
 * <p>
 * The default is to use {@link SigarProcessManager} if sigar.jar is
 * available in the classpath, otherwise {@link LinuxProcessManager}
 * on Linux and {@link PureJavaProcessManager} on other platforms.
 * 
 * @param processManager
 * @return
 * @throws NullPointerException
 */
public DefaultOfficeManagerConfiguration setProcessManager(ProcessManager processManager) throws NullPointerException {
    checkArgumentNotNull("processManager", processManager);
    this.processManager = processManager;
    return this;
}
 
Example #17
Source File: DefaultOfficeManagerConfiguration.java    From wenku with MIT License 2 votes vote down vote up
/**
 * Provide a specific {@link ProcessManager} implementation
 * <p>
 * The default is to use {@link SigarProcessManager} if sigar.jar is
 * available in the classpath, otherwise {@link LinuxProcessManager}
 * on Linux and {@link PureJavaProcessManager} on other platforms.
 * 
 * @param processManager
 * @return
 * @throws NullPointerException
 */
public DefaultOfficeManagerConfiguration setProcessManager(ProcessManager processManager) throws NullPointerException {
    checkArgumentNotNull("processManager", processManager);
    this.processManager = processManager;
    return this;
}
 
Example #18
Source File: DefaultOfficeManagerConfiguration.java    From kkFileViewOfficeEdit with Apache License 2.0 2 votes vote down vote up
/**
 * Provide a specific {@link ProcessManager} implementation
 * <p>
 * The default is to use {@link SigarProcessManager} if sigar.jar is
 * available in the classpath, otherwise {@link LinuxProcessManager}
 * on Linux and {@link PureJavaProcessManager} on other platforms.
 * 
 * @param processManager
 * @return
 * @throws NullPointerException
 */
public DefaultOfficeManagerConfiguration setProcessManager(ProcessManager processManager) throws NullPointerException {
    checkArgumentNotNull("processManager", processManager);
    this.processManager = processManager;
    return this;
}