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


Java URLConstants类代码示例

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


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

示例1: registerTomcatJNDIUrlService

import org.osgi.service.url.URLConstants; //导入依赖的package包/类
private ServiceRegistration registerTomcatJNDIUrlService() {
	Properties properties = new Properties();
	properties.put(URLConstants.URL_HANDLER_PROTOCOL, "jndi");
	final URLStreamHandler handler = new DirContextURLStreamHandler();

	return bundleContext.registerService(URLStreamHandlerService.class.getName(),
		new AbstractURLStreamHandlerService() {

			private final static String EMPTY_STRING = "";


			public URLConnection openConnection(URL u) throws IOException {
				return new URL(u, EMPTY_STRING, handler).openConnection();
			}
		}, properties);
}
 
开发者ID:BeamFoundry,项目名称:spring-osgi,代码行数:17,代码来源:Activator.java

示例2: start

import org.osgi.service.url.URLConstants; //导入依赖的package包/类
public void start( BundleContext bundleContext ) {
  this.urlTransformer = new UrlTransformer();
  this.urlTransformerRegistration = bundleContext.registerService( ArtifactUrlTransformer.class, this.urlTransformer, null );

  this.urlHandler = new UrlHandler();

  Dictionary<String, String> props = new Hashtable<>();
  props.put( URLConstants.URL_HANDLER_PROTOCOL, WebPackageURLConnection.URL_PROTOCOL );

  this.urlHandlerRegistration = bundleContext.registerService( URLStreamHandlerService.class, this.urlHandler, props );
}
 
开发者ID:pentaho,项目名称:pentaho-osgi-bundles,代码行数:12,代码来源:Activator.java

示例3: activate

import org.osgi.service.url.URLConstants; //导入依赖的package包/类
protected void activate(final ComponentContext context) {
    final Hashtable<String, String> dict = new Hashtable<String, String>();
    dict.put(URLConstants.URL_HANDLER_PROTOCOL, "httppgp");
    context.getBundleContext().registerService(
            URLStreamHandlerService.class.getName(), this, dict);
}
 
开发者ID:gvSIGAssociation,项目名称:gvnix1,代码行数:7,代码来源:HttpPgpUrlStreamHandlerServiceImpl.java


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