felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <akaras...@apache.org>
Subject Re: Setting system properties for FelixConstants.FRAMEWORK_SYSTEMPACKAGES_EXTRA
Date Thu, 24 Feb 2011 15:28:27 GMT
Hi Richard,

On Thu, Feb 24, 2011 at 4:30 PM, Richard S. Hall <heavy@ungoverned.org> wrote:
> I am not sure how the instance of the framework is being created, but if you
> are creating it directly then it won't see configuration properties that are
> set as system properties. However, if the launcher is used to start the
> framework, then the launcher automatically copies any configuration
> properties from the system properties.

I am manually passing in the configuration property for the extra
system packages before initializing Felix. Right now I just statically
pass in the comma delimited set of fixed packages and it works like a

The problem is when the host application uses exported interfaces in
the plugin bundles. In dynamic environments where users drop in plugin
bundles that I do not know of in advance I have to dynamically build
the set of system packages.

I was thinking of this possible solution:

(1) scan manifests of jars on the classpath
(2) if the jar is a bundle, add that bundle's Import-Package elements
to the system package extras configuration setting value

This works for at initialization time which is sufficient for my
needs. Wondering if there's an easier way to do this without writing
rot code like this.


> On 02/24/2011 01:14 AM, Alex Karasulu wrote:
>> Hi all,
>> I have a situation where I would like to set the
>> FelixConstants.FRAMEWORK_SYSTEMPACKAGES_EXTRA property in my pom for
>> use with surefire. I would like to supply all the packages that would
>> be on the Import-Packages attribute if the manifest is generated for
>> everything on the "test" classpath.
>> I have a class that embeds Felix for plugins in one module. Then
>> another integration test module tests that Felix embedding class. The
>> problem is I get CCE exceptions if I access plugin interfaces to test
>> the plugin so I would like to have the build construct the list of
>> extra system packages so I don't have to manually update these values
>> in the code.
>> Is there a hack anyone uses for this?
>> Thanks in advance,
>> Alex

View raw message