當前位置: 首頁>>代碼示例>>Java>>正文


Java BundleContext.getProperty方法代碼示例

本文整理匯總了Java中org.osgi.framework.BundleContext.getProperty方法的典型用法代碼示例。如果您正苦於以下問題:Java BundleContext.getProperty方法的具體用法?Java BundleContext.getProperty怎麽用?Java BundleContext.getProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.osgi.framework.BundleContext的用法示例。


在下文中一共展示了BundleContext.getProperty方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: determinePlatform

import org.osgi.framework.BundleContext; //導入方法依賴的package包/類
private static boolean determinePlatform(BundleContext context, String[] labels) {
	Assert.notNull(context);
	Assert.notNull(labels);

	String vendorProperty = context.getProperty(Constants.FRAMEWORK_VENDOR);
	if (vendorProperty == null) {
		return false; // might be running outside of container
	} else {
		// code defensively here to allow for variation in vendor name over
		// time
		if (containsAnyOf(vendorProperty, labels)) {
			return true;
		}
	}
	return false;
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:17,代碼來源:OsgiPlatformDetector.java

示例2: getPlatformName

import org.osgi.framework.BundleContext; //導入方法依賴的package包/類
public static String getPlatformName(BundleContext bundleContext) {
	String vendorProperty = bundleContext.getProperty(Constants.FRAMEWORK_VENDOR);
	String frameworkVersion = bundleContext.getProperty(Constants.FRAMEWORK_VERSION);

	// get system bundle
	Bundle bundle = bundleContext.getBundle(0);
	String name = (String) bundle.getHeaders().get(Constants.BUNDLE_NAME);
	String version = (String) bundle.getHeaders().get(Constants.BUNDLE_VERSION);
	String symName = bundle.getSymbolicName();

	StringBuilder buf = new StringBuilder();
	buf.append(name);
	buf.append(" ");
	buf.append(symName);
	buf.append("|");
	buf.append(version);
	buf.append("{");
	buf.append(frameworkVersion);
	buf.append(" ");
	buf.append(vendorProperty);
	buf.append("}");

	return buf.toString();
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:25,代碼來源:OsgiUtils.java

示例3: start

import org.osgi.framework.BundleContext; //導入方法依賴的package包/類
public @Override void start(final BundleContext context) throws Exception {
        if (System.getProperty("netbeans.home") != null) {
            throw new IllegalStateException("Should not be run from inside regular NetBeans module system");
        }
        String storage = context.getProperty(Constants.FRAMEWORK_STORAGE);
        if (storage != null) {
            System.setProperty("netbeans.user", storage);
        }
        System.setProperty("TopSecurityManager.disable", "true");
        NbBundle.setBranding(System.getProperty("branding.token"));
        OSGiMainLookup.initialize(context);
        queue = new DependencyQueue<String,Bundle>();
        this.context = context;
        framework = ((Framework) context.getBundle(0));
        if (framework.getState() == Bundle.STARTING) {
            LOG.fine("framework still starting");
            final AtomicReference<FrameworkListener> frameworkListener = new AtomicReference<FrameworkListener>();
            frameworkListener.set(new FrameworkListener() {
                public @Override void frameworkEvent(FrameworkEvent event) {
                    if (event.getType() == FrameworkEvent.STARTED) {
//                        System.err.println("framework started");
                        context.removeFrameworkListener(frameworkListener.get());
                        context.addBundleListener(Activator.this);
                        processLoadedBundles();
                    }
                }
            });
            context.addFrameworkListener(frameworkListener.get());
        } else {
            LOG.fine("framework already started");
            context.addBundleListener(this);
            processLoadedBundles();
        }
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:35,代碼來源:Activator.java

示例4: IndexingJob

import org.osgi.framework.BundleContext; //導入方法依賴的package包/類
public IndexingJob(OntoNetHubSiteManager siteManager, String ontologyName, String ontologyDescription, String baseURI, Model data, BundleContext ctx, TcManager tcManager, File ontologiesFolder) {
	this.siteManager = siteManager;
	this.ontologyName = ontologyName;
	this.ontologyDescription = ontologyDescription;
	this.baseURI = baseURI;
	this.data = data;
	this.ctx = ctx;
	this.stanbolHome = ctx.getProperty("stanbol.home");
	this.tcManager = tcManager;
	this.ontologiesFolder = ontologiesFolder;
	
}
 
開發者ID:teamdigitale,項目名稱:ontonethub,代碼行數:13,代碼來源:IndexingJob.java

示例5: RDFIndexingJob

import org.osgi.framework.BundleContext; //導入方法依賴的package包/類
public RDFIndexingJob(String ontologyName, String ontologyDescription, String baseURI, Model data, BundleContext ctx, TcManager tcManager, File ontologiesFolder) {
	this.ontologyName = ontologyName;
	this.ontologyDescription = ontologyDescription;
	this.baseURI = baseURI;
	this.data = data;
	this.ctx = ctx;
	this.stanbolHome = ctx.getProperty("stanbol.home");
	this.tcManager = tcManager;
	this.ontologiesFolder = ontologiesFolder;
	
}
 
開發者ID:teamdigitale,項目名稱:ontonethub,代碼行數:12,代碼來源:RDFIndexingJob.java

示例6: isPlatformVendorMatch

import org.osgi.framework.BundleContext; //導入方法依賴的package包/類
private static boolean isPlatformVendorMatch(BundleContext bundleContext, String vendorString) {
	String vendor = bundleContext.getProperty(Constants.FRAMEWORK_VENDOR);
	if (vendor != null)
		return vendor.indexOf(vendorString) >= -1;
	return false;
}
 
開發者ID:eclipse,項目名稱:gemini.blueprint,代碼行數:7,代碼來源:OsgiUtils.java


注:本文中的org.osgi.framework.BundleContext.getProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。