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


Java BundleException.printStackTrace方法代码示例

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


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

示例1: installBundle

import org.osgi.framework.BundleException; //导入方法依赖的package包/类
/**
 * Installs the specified jar bundle and adds the Bundle instance to the local bundle vector {@link #getBundleVector()}.
 * @param bundleJarFilePath the bundle jar file path
 */
public void installBundle(String bundleJarFilePath) {
	Bundle bundle = null;
	try {
		BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
		bundle = bundleContext.installBundle(bundleJarFilePath);
		if (this.debug) System.out.println("=> + " + bundle.getSymbolicName() + " installed.");
		
	} catch (BundleException bEx) {
		bEx.printStackTrace();
	}
	// --- Remind this bundle ---------------
	if (bundle!=null) this.getBundleVector().addElement(bundle);
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:18,代码来源:ProjectBundleLoader.java

示例2: stopAndUninstallBundles

import org.osgi.framework.BundleException; //导入方法依赖的package包/类
/**
 * Stops and un-installs the current bundle.
 */
public void stopAndUninstallBundles() {
	
	// --- Get a copy of loaded bundles -----
	Vector<Bundle> bundlesToRemove = new Vector<>(this.getBundleVector());
	for (Bundle bundle: bundlesToRemove) {
		try {
			// --- Remove, if active --------
			if (bundle.getState()==Bundle.ACTIVE) {
				bundle.stop();
				bundle.uninstall();
			}
			// --- Remove from vector -------
			this.getBundleVector().remove(bundle);
			if (this.debug) System.out.println("=> - " + bundle.getSymbolicName() + " stoped & uninstalled");
			
		} catch (BundleException bEx) {
			bEx.printStackTrace();
		}
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:24,代码来源:ProjectBundleLoader.java

示例3: installFromFile

import org.osgi.framework.BundleException; //导入方法依赖的package包/类
/**
 * installs a bundle from file
 */
void installFromFile(File file) {
	try {
		Bundle bundle = context.installBundle(file.toURI().toString());
		plugins.add(bundle);
		System.out.println ("Loading " + file.toURI());
		bundles.put (bundle, file.toURI().toString());
	}
	catch (BundleException e) 
	{
		if (e.getType() == BundleException.DUPLICATE_BUNDLE_ERROR)
		{
			// duplicate bundle is a warning, not an error
			System.out.println("WARNING " + file.getName() + "; " + e.getMessage());
		}
		else
		{
			System.out.println("Could not install bundle from file " + file.getName());
			e.printStackTrace();
		}
	}
}
 
开发者ID:PathVisio,项目名称:pathvisio,代码行数:25,代码来源:BundleLoader.java

示例4: startBundle

import org.osgi.framework.BundleException; //导入方法依赖的package包/类
/**
 * Starts the specified bundle and return true if successful.
 *
 * @param bundle the bundle
 * @return true, if successful
 */
public boolean startBundle(Bundle bundle) {
	boolean bundleStarted = false;
	try {
		bundle.start();
		bundleStarted = true;
		if (this.debug) System.out.println("=> ! " + bundle.getSymbolicName() + " started");
		
	} catch (BundleException bEx) {
		bEx.printStackTrace();
	}
	return bundleStarted;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:19,代码来源:ProjectBundleLoader.java

示例5: unloadBootstrapBundle

import org.osgi.framework.BundleException; //导入方法依赖的package包/类
public void unloadBootstrapBundle() {
	if (ybootstrapBundle != null) {
		try {
			ybootstrapBundle.uninstall();
			ybootstrapBundle = null;
		}
		catch (BundleException e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:SAP,项目名称:hybris-commerce-eclipse-plugin,代码行数:12,代码来源:Activator.java

示例6: destroy

import org.osgi.framework.BundleException; //导入方法依赖的package包/类
@Override
public void destroy() {
    log.finer("Destroying application loader.");
    watchdog.close();
    try {
        osgiFramework.stop();
    } catch (BundleException e) {
        e.printStackTrace();
    }
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:11,代码来源:ApplicationLoader.java


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