当前位置: 首页>>代码示例>>Java>>正文


Java DefaultOfficeManagerConfiguration.setPortNumbers方法代码示例

本文整理汇总了Java中org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration.setPortNumbers方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultOfficeManagerConfiguration.setPortNumbers方法的具体用法?Java DefaultOfficeManagerConfiguration.setPortNumbers怎么用?Java DefaultOfficeManagerConfiguration.setPortNumbers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration的用法示例。


在下文中一共展示了DefaultOfficeManagerConfiguration.setPortNumbers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: startOpenOfficService

import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; //导入方法依赖的package包/类
/**
 * 启动转换服务
 */
public void startOpenOfficService() {

	DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();

	try {
		LOGGER.info("==========>>> 开始启动 open office service 服务...");

		configuration.setOfficeHome(openofficeHome);//设置OpenOffice.org安装目录
		configuration.setPortNumbers(openofficePort); //设置转换端口,默认为8100
		configuration.setTaskExecutionTimeout(1000 * 60 * 30L);//设置任务执行超时为5分钟
		configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);//设置任务队列超时为24小时

		officeManager = configuration.buildOfficeManager();
		officeManager.start(); //启动服务
		converter = new OfficeDocumentConverter(officeManager);

		LOGGER.info("=========>>> open office service 服务已启动.");
		startup = true;

	} catch (Exception ce) {
		ce.printStackTrace();
		LOGGER.info("open office service 服务已启动失败!详细信息:" + ce);
		stopOpenOfficService();
	}
}
 
开发者ID:pecker,项目名称:kony-converter,代码行数:29,代码来源:OpenofficeConverterExecutor.java

示例2: startService

import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; //导入方法依赖的package包/类
private void startService() {
  DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
  try {
    LOG.info("start service....");
    configuration.setOfficeHome(OFFICE_HOME);// 设置OpenOffice.org安装目录
    configuration.setPortNumbers(port); // 设置转换端口,默认为8100
    configuration.setTaskExecutionTimeout(1000 * 60 * 5L);// 设置任务执行超时为5分钟
    configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);// 设置任务队列超时为24小时

    officeManager = configuration.buildOfficeManager();
    officeManager.start(); // 启动服务
    LOG.info("office converting service start successfully");
  } catch (Exception e) {
    LOG.error("fail to start converting service", e);
  }
}
 
开发者ID:hivsuper,项目名称:document-converter,代码行数:17,代码来源:JodPDFconverter.java

示例3: buildJODConfiguration

import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; //导入方法依赖的package包/类
private static void buildJODConfiguration() {
	configuration = new DefaultOfficeManagerConfiguration();
	int[] officePortParam = Config.getIntArray("jod.port");
	if (officePortParam != null) {
		configuration.setPortNumbers(officePortParam);
	}
	String officeHomeParam = Config.getString("jod.home");
	if (officeHomeParam != null) {
		configuration.setOfficeHome(new File(officeHomeParam));
	}
	String officeProfileParam = Config.getString("jod.profile");
	if (officeProfileParam != null) {
		configuration.setTemplateProfileDir(new File(officeProfileParam));
	}
	Long timeoutParam = Config.getLong("jod.timeoutMillis");
	if (timeoutParam != null) {
		configuration.setTaskExecutionTimeout(timeoutParam);
	}
	//TODO - test!
	configuration.setMaxTasksPerProcess(1);
}
 
开发者ID:LeoFCardoso,项目名称:tudoToPDF,代码行数:22,代码来源:AppContext.java

示例4: WebappContext

import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; //导入方法依赖的package包/类
public WebappContext(ServletContext servletContext, OpenOffice openOffice) {
	DiskFileItemFactory fileItemFactory = new DiskFileItemFactory();
	fileUpload = new ServletFileUpload(fileItemFactory);
	if (openOffice.getFileSizeMax() != null) {
		fileUpload.setFileSizeMax(Integer.parseInt(openOffice.getFileSizeMax()));
		logger.info("max file upload size set to " + openOffice.getFileSizeMax());
	} else {
		logger.warn("max file upload size not set");
	}
	
	DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
	if (openOffice.getPort() != null) {
		String ports = openOffice.getPort();
		String[] portArr = ports.split(",");
		int[] portArrInt = new int[portArr.length];
		int i = 0;
		for (String port : portArr){
			portArrInt[i++] = Integer.parseInt(port);
		}
	    configuration.setPortNumbers(portArrInt);
	}
	if (openOffice.getHome() != null) {
	    configuration.setOfficeHome(new File(openOffice.getHome()));
	}
	if (StringUtils.isNotBlank(openOffice.getProfile())) {
	    configuration.setTemplateProfileDir(new File(openOffice.getProfile()));
	}

	officeManager = configuration.buildOfficeManager();
	documentConverter = new OfficeDocumentConverter(officeManager);
}
 
开发者ID:ekoz,项目名称:kbase-doc,代码行数:32,代码来源:WebappContext.java

示例5: newOfficeManager

import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; //导入方法依赖的package包/类
public synchronized OfficeManager newOfficeManager() {
	String officehome=ServletActionContext.getServletContext().getInitParameter("officehome");
	int portnumbers=Integer.parseInt(ServletActionContext.getServletContext().getInitParameter("portnumbers"));

	DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
	configuration.setOfficeHome(officehome);//设置OpenOffice.org安装目录
	configuration.setPortNumbers(portnumbers); //设置转换端口,默认为8100
	configuration.setTaskExecutionTimeout(1000 * 60 * 10L);//设置任务执行超时为5分钟
	configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);//设置任务队列超时为24小时
	
	return configuration.buildOfficeManager();
}
 
开发者ID:binghuo365,项目名称:csustRepo,代码行数:13,代码来源:ViewOfficeTools.java

示例6: initViewOfficeTools

import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration; //导入方法依赖的package包/类
private void initViewOfficeTools(ServletContextEvent sce){

		String officehome=sce.getServletContext().getInitParameter("officehome");
		int portnumbers=Integer.parseInt(sce.getServletContext().getInitParameter("portnumbers"));

		DefaultOfficeManagerConfiguration configuration = new DefaultOfficeManagerConfiguration();
		configuration.setOfficeHome(officehome);//设置OpenOffice.org安装目录
		configuration.setPortNumbers(portnumbers); //设置转换端口,默认为8100
		configuration.setTaskExecutionTimeout(1000 * 60 * 10L);//设置任务执行超时为5分钟
		configuration.setTaskQueueTimeout(1000 * 60 * 60 * 24L);//设置任务队列超时为24小时

		OfficeManager officeManager=configuration.buildOfficeManager();
		officeManager.start();
		ViewOfficeTools.newInstance().setOfficeManager(officeManager);
	}
 
开发者ID:binghuo365,项目名称:csustRepo,代码行数:16,代码来源:ContextListener.java


注:本文中的org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration.setPortNumbers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。