Quantcast
Channel: Ignite Realtime: Message List
Viewing all articles
Browse latest Browse all 11412

Re: Problems with manifest files in 4.0.0-rc2

$
0
0

I can only test your changes on Monday, because my local development environment here is not properly configured. Have a look to the class FileUtils, the classloader provided in the signature is never used. Can you please fix this?

 

Ok, than another approach. The thing you are looking for has already been implemented and specified by the OSGi Alliance. It is called "Declarative Services", especially since version 1.2 a very powerful extension. It works as follows: You do not have to implement specific OSGi interfaces, the only thing that is required is an xml file located in the folder "OSGI-INF" in the bundle jar. This allows you to declare dependencies and offered services. At the moment we only need at startup that OSGi or more specific the "Service Component Runtime" (SCR) instantiates the class "ExtensionsInitializer" and calls "initialize()". No problem. The file must look as follows:

 

<scr:component enabled="true" immediate="true" name="org.jivesoftware.smack.initializer.extensions.ExtensionsInitializer" activate="initialize">

<implementation class="org.jivesoftware.smack.initializer.extensions.ExtensionsInitializer"/>

</scr:component>

 

What's pretty cool, is that the file can be hardcoded or automatically generated. In Maven, there is the "Apache Felix Maven SCR Plugin". It uses annotations that only exist at compile time. Declare a component and annotate the method “initialize” with @Activate. The xml file is generated and put to the jar. As I told you, I am not familiar with gradle, but I found this: https://github.com/janvolck/gradle-scr-plugin. Is it possible to integrate and test it? Have a look here: http://stackoverflow.com/questions/12642706/how-to-use-org-apache-felix-scr-anno tations-for-a-bundle-from-scratch. It is a simple example showing how the annotation based approach works.


Viewing all articles
Browse latest Browse all 11412

Trending Articles