org.frameworkset.runtime.CommonLauncher Java Examples

The following examples show how to use org.frameworkset.runtime.CommonLauncher. 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: PluginGenerator.java    From pinpoint-plugin-generate with Apache License 2.0 6 votes vote down vote up
protected void chmodx() throws IOException
{
	Process proc = !CommonLauncher.isOSX()?
			Runtime.getRuntime().exec("chmod +x -R "+
					this.pluginProjectDir
							.getCanonicalPath()):

			Runtime.getRuntime().exec("chmod -R +x "+
					this.pluginProjectDir
							.getCanonicalPath())			;
	StreamGobbler error = new StreamGobbler( proc.getErrorStream(),"ERROR",null);

	StreamGobbler normal = new StreamGobbler( proc.getInputStream(),"NORMAL",null);
	error.start();
	normal.start();

	try {
		int exitVal = proc.waitFor();
	} catch (InterruptedException e) {
		log.error("授予执行权限失败:",e);
	}
}
 
Example #2
Source File: UpdateSetting.java    From elasticsearch-gradle-example with Apache License 2.0 6 votes vote down vote up
public static void main(String[] args){
	ClientInterface clientInterface = ElasticSearchHelper.getRestClientUtil();
	int max_result_window = CommonLauncher.getIntProperty("max_result_window",15000);
	Map<String,Object> settings = new HashMap<String,Object>();
	settings.put("index.max_result_window",max_result_window);
	String result = clientInterface.updateAllIndicesSettings(settings);//修改所有索引的max_result_window设置

	System.out.println(result);

	result = clientInterface.updateIndiceSettings("dbdemo",settings) ;//修改索引dbdemo的max_result_window设置
	System.out.println(result);
	String setting = clientInterface.getClusterSettings();
	System.out.println(setting);


}
 
Example #3
Source File: PluginGenerator.java    From pinpoint-plugin-generate with Apache License 2.0 5 votes vote down vote up
private void archivePlugin(){
		try {
			Process proc = null;
			if (CommonLauncher.isWindows()) {

				proc = Runtime.getRuntime().exec(
						new File(this.pluginProjectDir, "/build.bat")
								.getCanonicalPath());
//					${dbinitpath}

			}
			else
			{
				chmodx();

				proc = Runtime.getRuntime().exec("sh "+
						new File(this.pluginProjectDir, "/build.sh")
								.getCanonicalPath());
			}
			StreamGobbler error = new StreamGobbler( proc.getErrorStream(),"INFO",null);

			StreamGobbler normal = new StreamGobbler( proc.getInputStream(),"NORMAL",null);
			error.start();
			normal.start();

			int exitVal = proc.waitFor();
			log.info("构建插件完毕! " );


		} catch (Throwable t) {
			log.error("构建插件失败:",t);
		}
		finally
		{

		}
	}