• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EclipseStarter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.core.runtime.adaptor.EclipseStarter的典型用法代码示例。如果您正苦于以下问题:Java EclipseStarter类的具体用法?Java EclipseStarter怎么用?Java EclipseStarter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EclipseStarter类属于org.eclipse.core.runtime.adaptor包,在下文中一共展示了EclipseStarter类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startPlatform

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
/**
 * {@link EclipseStarter#getSystemBundleContext}
 *
 * @throws Exception
 *             propagates exception from Equinox
 */
private static BundleContext startPlatform(String[] platformArgs, Path osgiConfigurationArea) throws Exception {
	Map<String, String> ip = new HashMap<>();
	ip.put("eclipse.ignoreApp", "true");
	ip.put("eclipse.consoleLog", "true");
	ip.put("eclipse.log.level", "ALL");

	/*
	 * http://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fruntime-
	 * options.html
	 */
	// ip.put("osgi.debug", "");
	// ip.put("osgi.debug.verbose", "true");

	ip.put("osgi.clean", "true");
	ip.put("osgi.framework.shape", "jar");
	ip.put("osgi.configuration.area", osgiConfigurationArea.toAbsolutePath().toString());
	ip.put("osgi.noShutdown", "false");
	EclipseStarter.setInitialProperties(ip);

	BundleContext context = EclipseStarter.startup(platformArgs, null);
	return context;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:29,代码来源:ProductLauncher.java


示例2: start

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
/**
 * This method starts OSGi container, and returns immediately
 * <p>
 * The method will actually fork a thread and run the started method from
 * inside the thread. If the framework fails the method checks
 * {@link #isExitOnError()} on how to proceed. If {@link #isExitOnError()}
 * returns <code>true</code> then the method will call
 * {@link System#exit(int)} with a negative return value (-1). Otherwise
 * only the thread starting the framework will shut down.
 * </p>
 * 
 * @param args
 *            arguments for the starter
 * @throws Exception
 *             if anything goes wrong
 */
public static void start ( final String[] args ) throws Exception
{
    final Thread runner = new Thread ( "EclipseStarter" ) { //$NON-NLS-1$
        @Override
        public void run ()
        {
            try
            {
                EclipseStarter.main ( args );
            }
            catch ( final Exception e )
            {
                if ( isExitOnError () )
                {
                    System.exit ( -1 );
                }
            }
        };
    };

    runner.start ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:39,代码来源:EclipseDaemon.java


示例3: start

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
public void start() throws Exception {

		if (context == null) {
			// copy configuration properties to sys properties
			System.getProperties().putAll(getConfigurationProperties());

			// Equinox 3.1.x returns void - use of reflection is required
			// use main since in 3.1.x it sets up some system properties
//			EclipseStarter.main(new String[0]);

//			final Field field = EclipseStarter.class.getDeclaredField("context");

//			AccessController.doPrivileged(new PrivilegedAction<Object>() {
//				public Object run() {
//					field.setAccessible(true);
//					return null;
//				}
//			});
//			context = (BundleContext) field.get(null);
            context = EclipseStarter.startup(new String[0], null);
		}
	}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:23,代码来源:EquinoxPlatform.java


示例4: defaultSystemProperties

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
private Map<String, String> defaultSystemProperties() {
	Map<String, String> map = new HashMap<>();
	map.put("osgi.framework.useSystemProperties", "false");
	map.put(EclipseStarter.PROP_INSTALL_AREA, installationRoot.getAbsolutePath());
	map.put(EclipseStarter.PROP_NOSHUTDOWN, "false");
	// enable 
	map.put("equinox.use.ds", "true");
	map.put(EclipseStarter.PROP_BUNDLES, Joiner.on(", ").join(
			// automatic bundle discovery and installation
			"[email protected]:start",
			"[email protected]:start",
			// support eclipse's -application argument
			"[email protected]:start",
			// declarative services
			"[email protected]:start"));
	map.put(EclipseStarter.PROP_FRAMEWORK, getPluginRequireSingle("org.eclipse.osgi").toURI().toString());
	return map;
}
 
开发者ID:diffplug,项目名称:goomph,代码行数:19,代码来源:EquinoxLauncher.java


示例5: start

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
public void start() throws Exception {

		if (context == null) {
			// copy configuration properties to sys properties
			System.getProperties().putAll(getConfigurationProperties());

			// Equinox 3.1.x returns void - use of reflection is required
			// use main since in 3.1.x it sets up some system properties
			EclipseStarter.main(new String[0]);

			final Field field = EclipseStarter.class.getDeclaredField("context");

			AccessController.doPrivileged(new PrivilegedAction() {

				public Object run() {
					field.setAccessible(true);
					return null;
				}
			});
			context = (BundleContext) field.get(null);
		}
	}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:23,代码来源:EquinoxPlatform.java


示例6: Running

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
private Running(Map<String, String> systemProps, List<String> args) throws Exception {
	Map<String, String> defaults = defaultSystemProperties();
	modifyDefaultBy(defaults, systemProps);
	EclipseStarter.setInitialProperties(defaults);
	bundleContext = EclipseStarter.startup(args.toArray(new String[0]), null);
	Objects.requireNonNull(bundleContext);
}
 
开发者ID:diffplug,项目名称:goomph,代码行数:8,代码来源:EquinoxLauncher.java


示例7: Running

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
private Running() throws Exception {
	Box.Nullable<BundleContext> context = Box.Nullable.ofNull();
	Main main = new Main() {
		@SuppressFBWarnings(value = "DMI_THREAD_PASSED_WHERE_RUNNABLE_EXPECTED", justification = "splashHandler is a thread rather than a runnable.  Almost definitely a small bug, " +
				"but there's a lot of small bugs in the copy-pasted launcher code.  It's battle-tested, FWIW.")
		@Override
		protected void invokeFramework(String[] passThruArgs, URL[] bootPath) throws Exception {
			context.set(EclipseStarter.startup(passThruArgs, splashHandler));
		}
	};
	main.basicRun(eclipseIni.getLinesAsArray());
	this.bundleContext = Objects.requireNonNull(context.get());
}
 
开发者ID:diffplug,项目名称:goomph,代码行数:14,代码来源:EclipseIniLauncher.java


示例8: shutdownPlatform

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
private static void shutdownPlatform() throws Exception {
	EclipseStarter.shutdown();
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:4,代码来源:ProductLauncher.java


示例9: stop

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
public void stop() throws Exception {
	if (context != null) {
		context = null;
		EclipseStarter.shutdown();
	}
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:7,代码来源:EquinoxPlatform.java


示例10: run

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
/** Runs an eclipse application, as specified by the `-application` argument. */
private void run() throws Exception {
	Object result = EclipseStarter.run(null);
	Preconditions.checkState(Integer.valueOf(0).equals(result), "Unexpected return=0, was: %s", result);
}
 
开发者ID:diffplug,项目名称:goomph,代码行数:6,代码来源:EquinoxLauncher.java


示例11: close

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
/** Shutsdown the eclipse instance. */
@Override
public void close() throws Exception {
	EclipseStarter.shutdown();
}
 
开发者ID:diffplug,项目名称:goomph,代码行数:6,代码来源:EquinoxLauncher.java


示例12: main

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
/**
 * This method starts OSGi container, but does not return as long as the
 * container is active
 * 
 * @param args
 *            arguments for the starter
 * @throws Exception
 *             if anything goes wrong
 */
public static void main ( final String[] args ) throws Exception
{
    EclipseStarter.main ( args );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:EclipseDaemon.java


示例13: stop

import org.eclipse.core.runtime.adaptor.EclipseStarter; //导入依赖的package包/类
/**
 * Stop the framework
 * 
 * @see #stop()
 * @param args
 * @throws Exception
 */

public static void stop ( final String[] args ) throws Exception
{
    EclipseStarter.shutdown ();
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:13,代码来源:EclipseDaemon.java



注:本文中的org.eclipse.core.runtime.adaptor.EclipseStarter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CloudDomain类代码示例发布时间:2022-05-23
下一篇:
Java Instruction类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap