[ 
http://issues.apache.org/jira/browse/FELIX-78?page=comments#action_12415508 ] 

Richard S. Hall commented on FELIX-78:
--------------------------------------

Ok, I just committed some changes that should make it possible to remedy this 
situation in short order. I stole an idea from how mangen does its 
configuration properties (thanks Rob!) and use property substitution to achieve 
selection. I had to modify mangen's approach to work with nested property 
substitution, though, so this is a little more tricky and might contain some 
subtle bugs.

At any rate, I have now defined the system packages property like this in 
config.properties:

    org.osgi.framework.system.packages=org.osgi.framework; version=1.3.0, \
      org.osgi.service.packageadmin; version=1.2.0, \
      org.osgi.service.startlevel; version=1.0.0, \
      org.osgi.service.url; version=1.0.0, \
      ${jre-${java.specification.version}}

I have also defined properties called:

    jre-1.3=...list of packages...
    jre-1.4=...list of packages...
    jre-1.5=...list of packages...

Now when Main.java reads the config.properties file and performs variable 
substitution, it translates:

    ${jre-${java.specification.version}}

to (assuming we are running on JRE 1.4)

    ${jre-1.4}

Which then gets translated to the property value, which is the list of exported 
packages for JRE 1.4.

Currently, Marcel gave me a complete set of packages for JRE 1.5, but I still 
need sets of packages for 1.3 and 1.4, so if someone wants to attach them to 
this JIRA issue, I will finish this off.

> Modify framework to export proper JRE packages for the execution environment
> ----------------------------------------------------------------------------
>
>          Key: FELIX-78
>          URL: http://issues.apache.org/jira/browse/FELIX-78
>      Project: Felix
>         Type: Improvement

>   Components: Framework
>     Reporter: Richard S. Hall
>     Priority: Minor

>
> The OSGi specification requires that class path classes are hidden from 
> bundles. To expose classes on the class path, the system bundle can be made 
> to "export" them by adding the packages to the 
> org.osgi.framework.system.packages property in the config.properties file.
> The should create proper value definitions for this property for JDKs 1.3, 
> 1.4, and 1.5 and perhaps define some way in the config.properties file to 
> specify system property guards for enabling/disabling various properties, so 
> that we can add all three values to the config.properties file, but only 
> enable the value corresponding to the appropriate execution platform at run 
> time.
> Of course, this is just one possible suggestion for a solution. Perhaps there 
> is a better one.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to