apache-felix

Using android API in APK Bundle gives: “Could not find class 'android.content.Context', referenced from method com.example.patient.Activator.start”

吃可爱长大的小学妹 提交于 2019-12-11 18:13:02
问题 I am embedding OSGI framework into Android application. Beside my android application, I have an APK bundle that I create using the following steps: Create a regular APK, for example by creating Eclipse Android Project. Make your bundle use the same OSGI framework library used by your application by: Build Path->Configure Build Path->Projects, and then add your application project that will load the bundle. Your application project should contain the OSGI framework jar file in its build path,

OSGI: how to export system packages on felix during runtime

拈花ヽ惹草 提交于 2019-12-11 12:34:18
问题 When I need to export some system packages I do: final Map configMap = new HashMap(); configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN, "onFirstInit"); configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA,"my packageshere"); felix = new Felix(configMap); But how can I export some packages during runtime? For example, on working osgi framework I want to install some bundle which requires some system packages which I didn't export when I start felix. 回答1: There is no way to do this dynamically

Optional bundle resolution

天涯浪子 提交于 2019-12-11 12:18:11
问题 I'm new in OSGi. I wrote JIRA plugin which is Apache Felix Bundle. My bundle uses Sprring Framework RestTemplate and Jackson XML for a simple REST API call. So I use other bundle (available on OSGi containter) : Apache ServiceMix :: Bundles :: spring-web which has <Import-Package> set to com.fasterxml.jackson.*; version="[2,3)";resolution:="optional" I installed jackson-databind, jackson-core and jackson-annotations (all in version 2.6.5) on OSGi container to provide missing, optional

Felix How to get list of all dependent bundles from the updated bundle [duplicate]

我是研究僧i 提交于 2019-12-11 11:41:23
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Find the dependent bundles in Eclipse at runtime How to get list of all dependent bundles from the updated bundle? For example, situation when some application loaded same bundles. In one time I will update one bundle. How can I get all bundles which depend on the updated bundle? This is necessary in order to restart all bundles which depend on the updated bundle, so they can see a new object of the updated

setting startlevel for OSGI bundle

让人想犯罪 __ 提交于 2019-12-11 10:47:20
问题 (I use glassfish 3.1, felix) I have a log bundle that needs to be started before other bundles in my glassfish server. Is there a way to configure startlevel for a single OSGI bundle? Any of the following ways will be fine: configuring a properties file, solution on java side, header in bundle manifest. thanks. 回答1: In Felix, you can change the launcher properties (for instance, conf/config.properties ) to start bundles with different start levels. You can use the felix.auto.deploy.install.<n

usecase of metatype attribute in felix scr annotations

点点圈 提交于 2019-12-11 10:08:23
问题 I am using scr annotations in my project. Can anybody explain the usecase of metatype attribute in @Component annotation? import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.ReferenceCardinality; import org.apache.felix.scr.annotations.ReferencePolicy; import org.apache.felix.scr.annotations.Service; @Component (name = "SampleComponent", label =

Mock private field being initialized by OSGI Felix container

独自空忆成欢 提交于 2019-12-11 09:48:26
问题 I'm trying to mock a private field in my class which is being initialized by OSGI container in which my app is running. I'm putting a sample code for reference, any clue on this please: import org.apache.felix.scr.annotations.* @Component (name = "MyServiceImpl ", ds = true, immediate = true) @Service public class MyServiceImpl extends MyBasee implements MyService { @Reference (name = "MyOtherService", bind = "bind", unbind = "unbind", policy = ReferencePolicy.STATIC) private MyOtherService

Felix OSGI Embedded application issue

泄露秘密 提交于 2019-12-11 08:18:16
问题 I was using Felix as a embedded application as explained in, How to start and use Apache Felix from code?. What I want to do is dynamically load jar files from my host application via OSGi and invoke methods of implementation classes. So I have following three maven projects 1) A maven project which has an interface. And the package of this interface is exported. ---> ProjA . 2) A implementation project --> ProjB, another maven project which import ProjA as a maven dependency and implement

OSGI bundle exception, maven dependency issue

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:09:07
问题 I'm pretty new to the OSGI, Felix and Maven stuffs, just started with it. I'm deploying the java build through jenkins and I get the below dependency issue. Below is the pom file contents which includes the dependency, I'm not sure whether it is correct, but it still complains about it. It is looking for "javax.jws" and the version is between 2.0 and 3.0 javax.jws;version>="2.0.0",!javax.jws;version>="3.0.0" Below is the pom contents. <Import-Package>!sun.misc,!org.apache.avalon.framework

How to embed external jars dependency in OSGI bundles?

大城市里の小女人 提交于 2019-12-11 02:14:33
问题 I am trying to convert my project into an OSGI application. I have few doubts. Suppose ModuleA in my application is dependent on external jars jarA and jarB. Now to make ModeuleA run, I am embedding both the jars using embed-dependency property of maven-bundle-plugin. Now suppose I have another module ModuleB which is also dependent on jarA. So this module also embeds the jarA. My project ends up having jarA being embedded 2 times which will unnecessarily bloat the size of project. Is there