osgi

How to configure maven-bundle-plugin to exclude Import-Service and Export-Service?

夙愿已清 提交于 2019-11-29 23:20:30
问题 I use maven-bundle-plugin to create OSGi compliance jars. It generates expected OSGi MANIFEST, except Import-Service and Export-Service. According to http://wiki.osgi.org/wiki/Import-Service, using Import-Service is deprecated. No wonder I failed to start a consumer bundle in distributed fabric mode (cluster). The bundle's MANIFEST contains Import-Service entry which causes it to wait (grace period). It started perfectly as I remove that entry manually. So, how to configure maven-bundle

深入理解JVM,类加载器

老子叫甜甜 提交于 2019-11-29 21:40:35
本人免费整理了Java高级资料,一共30G,需要自己领取。 传送门: https://mp.weixin.qq.com/s/JzddfH-7yNudmkjT0IRL8Q 虚拟机设计团队把类加载阶段中的 “通过一个类的全限定名来获取描述此类的二进制字节流(即字节码)” 这个动作放到Java虚拟机外部去实现,以便让应用程序自己决定如何去获取所需要的类。实现这个动作的代码模块称为 “类加载器” 。 一般来说,Java 虚拟机使用 Java 类的方式如下: Java 源程序(.java 文件) 在经过 Java 编译器 编译 之后就被转换成 字节码(.class 文件) 。 类加载器负责读取 Java 字节代码,并转换成 java.lang.Class 类的一个实例。每个这样的实例用来表示一个 Java 类。通过此实例的 newInstance() 方法就可以创建出该类的一个对象。 实际的情况可能更加复杂,比如 Java 字节代码可能是通过工具动态生成的,也可能是通过网络下载的。更详细的内容可以参考上一篇文章中讲类加载过程中的加载阶段时介绍的几个例子(JAR包、Applet、动态代理、JSP等)。 类与类加载器 类加载器虽然只用于实现类的加载动作,但它在Java程序起到的作用却远大于类加载阶段。对于任意一个类,都需要由 加载它的类加载器和这个类本身 一同确立 其在Java虚拟机中的唯一性

为什么它有典型FaaS能力,却是非典型FaaS架构?

大憨熊 提交于 2019-11-29 20:55:11
阿里妹导读:FaaS—Function as a service,函数即服务。它是2014年由于亚马逊的AWS Lambda的兴起,而被大家广泛认知。FaaS能力是NBF中的一项非常重要的能力,NBF是一个非典型的FaaS架构,但是具备了典型的FaaS能力。文章将详细介绍NBF的FaaS容器架构、服务发布、服务路由和强大的Serverless能力以及NBF-FaaS在阿里大促期间的实践心得。 1.NBF NBF (New-Retail Business Framework) 是供应链中台基础技术团队研发的新零售服务开放框架,提供了标准化业务定义、快捷服务开发和生态开放的能力,旨在为生态伙伴提供一整套完整的新零售PaaS和SaaS的解决方案。 2.FaaS 2.1定义 FaaS是Serverless的一种典型形式,由 Serverless平台提供负载均衡、高可用、自动扩缩容、服务治理等最佳实践,将这些最佳实践对 Developer 透明化,进一步缩短 Developer 从想法到产品的时间,降低开发成本,同时保障 Developer 开发的服务的可靠性。通过事件驱动的方式,开发者的Function通过Event有效触发,比如 HTTP 请求、消息事件等。 2.2典型架构 Event Sources Function 事件驱动的集合; Function Instances

A cycle was detected in the build path of project xxx - Build Path Problem

做~自己de王妃 提交于 2019-11-29 20:45:29
I'm in the process of converting my projects to OSGI bundles using maven and eclipse. Maven builds the stuff just fine, only I get the above error now within Eclipse. How can I find out which project causes this? Is there a special view or something? How can this happen, I would expect that maven can detect cyclic dependencies as well? Update Ok, I found something here and here Could this be caused by the felix maven-bundle-plugin which does for each export also an import? user2582855 Mark circular dependencies as "Warning" in Eclipse tool to avoid "A CYCLE WAS DETECTED IN THE BUILD PATH"

Logging in Eclipse/OSGi plugins

Deadly 提交于 2019-11-29 20:43:13
I am starting to develop an Eclipse plugin (technically, an OSGi plugin) and one of the first problems I've run into is that I can't seem to control the commons-logging output as I normally would. I've included the commons-logging package in the plugin dependencies, and indeed, when I log something (at INFO or higher severity) it is logged to the console. However, I can't seem to log at any lower level (such as DEBUG or TRACE). I have specified a log4j.properties file, and it is on the classpath (for the runtime, just as the commons-logging package is) but none of the settings in that

What is the difference between OSGi Components and Services

混江龙づ霸主 提交于 2019-11-29 20:26:44
Under OSGi, what are the main differences between Components vs Services? As I understand it, all Services must be Components, but not all Components must be services. What are the benefits of using one over the other with sample use cases? "Components" are less formally defined than services. A service is any object that is registered in the OSGi Service Registry and can be looked up using its interface name(s). The only prerequisite is that a service should implement some interface... any interface. For example I could register a runnable object under the java.lang.Runnable interface, and

Why can't JAXB find my jaxb.index when running inside Apache Felix?

爱⌒轻易说出口 提交于 2019-11-29 19:57:32
It's right there, in the package that it should be indexing. Still, when I call JAXBContext jc = JAXBContext.newInstance("my.package.name"); I get a JAXBException saying that "my.package.name" doesnt contain ObjectFactory.class or jaxb.index although it does contain both. What does work, but isn't quite what I want, is JAXBContext jc = JAXBContext.newInstance(my.package.name.SomeClass.class); This question from various other people appears on quite some mailing lists and forums but seemingly doesn't get answers. I'm running this on OpenJDK 6, so I got the source packages and stepped my

How to modularize a JSF/Facelets/Spring application with OSGi?

纵饮孤独 提交于 2019-11-29 19:38:55
I'm working with very large JSF/Facelets applications which use Spring for DI/bean management. My applications have modular structure and I'm currently looking for approaches to standardize the modularization. My goal is to compose a web application from a number of modules (possibly depending on each other). Each module may contain the following: Classes; Static resources (images, CSS, scripts); Facelet templates; Managed beans - Spring application contexts, with request, session and application-scoped beans (alternative is JSF managed beans); Servlet API stuff - servlets, filters, listeners

What's the best way to get started with OSGI? [closed]

会有一股神秘感。 提交于 2019-11-29 19:00:09
What makes a module/service/bit of application functionality a particularly good candidate for an OSGi module? I'm interested in using OSGi in my applications. We're a Java shop and we use Spring pretty extensively, so I'm leaning toward using Spring Dynamic Modules for OSGi(tm) Service Platforms . I'm looking for a good way to incorporate a little bit of OSGi into an application as a trial. Has anyone here used this or a similar OSGi technology? Are there any pitfalls? @Nicolas - Thanks, I've seen that one. It's a good tutorial, but I'm looking more for ideas on how to do my first "real" OSGi

OSGi: What are the differences between Apache Felix and Apache Karaf?

前提是你 提交于 2019-11-29 18:55:45
Apache Karaf is a sub project of Apache Felix . It is defined as "a lightweight OSGi container". I don't understand when should I use the heavyweight and when to use the lightweight. Their site doesn't explain this too much. The 'lightweight OSGi container' label is contrasting Karaf with more feature rich OSGi containers, not with Felix . To quote Guillaume Nodet (Karaf's author) from here : Felix is just the OSGi core runtime. Karaf provides a "distribution" based on Felix by adding other features such as a console, an SSH remoting mechanism, a file deployer and more. In this diagram of the