當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。