Yeah, that makes sense, thanks :-)

 

 

Regards

Fei

________________________________

From: BJ Hargrave [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2008 8:56 PM
To: [EMAIL PROTECTED]; OSGi Developer Mail List
Subject: RE: [osgi-dev] The Import-package/Export-package syntax

 


By syntactic sugar, Peter meant that 


Export-Package: foo; bar;version=1.0.0 

is equivalent to 

Export-Package: foor;version=1.0.0, bar;version=1.0.0 

The attributes and directives apply to all the package names separated by the 
semicolon. You can also repeat them if you separate the package names with a 
comma. 
-- 

BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance <http://www.osgi.org/> 
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  


office: +1 386 848 1781
mobile: +1 386 848 3788







From: 

"Fei Wang" <[EMAIL PROTECTED]> 

To: 

"Peter Kriens" <[EMAIL PROTECTED]>, "OSGi Developer Mail List" 
<[email protected]> 

Date: 

2008/08/13 06:56 AM 

Subject: 

RE: [osgi-dev] The Import-package/Export-package syntax

 

________________________________




Thanks Peter! 
But what did you mean when you said “The shortcut to specify multiple 
definitions with the same set of attributes is just syntactic sugar”? 
The spec says ” Multiple export definitions for the same package are allowed 
for example, when different attributes are needed for different importers”, but 
I think if I want to specify different attributes for different importers, one 
export is sufficient: 
Export-Package: foo; attr4importer1=val1; attr4importer2=val2; 
attr4importer3=val3 
Only if I want to specify multiple definitions with the same attribute(s), this 
multi-export feature is useful, like this: 
Export-Package: weblogic.util;provider=oracle;version=11.0.0, 
weblogic.util;provider=bea;version=10.3.0 
That is to say, the multiple-export-definitions provides a bundle the ability 
to specify multiple values to a single attribute. 
Am I missing something? 
  
Best Regards 
Fei 
  

 

________________________________


From: Peter Kriens [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] 
Sent: Wednesday, August 13, 2008 5:40 PM
To: [EMAIL PROTECTED]; OSGi Developer Mail List
Subject: Re: [osgi-dev] The Import-package/Export-package syntax 
  
In case 1 you have 2 export definitions and in case 2 there are 3. The spec 
says that an export definition describes an export for a SINGLE package. The 
shortcut to specify multiple definitions with the same set of attributes is 
just syntactic sugar ... 
  
So you were right :-) 
  
Kind regards, 
  
       Peter Kriens 
  
On 13 aug 2008, at 09:51, Fei Wang wrote: 


Hi, I’m confused by the R4 core spec. section 3.5.5, Export-Package Header (and 
also the import-package header), it says: 
Export-Package ::= export ( ’,’ export )* 
export ::= package-names ( ’;’ parameter )* 
package-names ::= package-name // See 1.4.2 
( ';' package-name )* 
  
The header allows many packages to be exported. An export definition is the 
description of a single package export for a bundle. Multiple export 
definitions for the same package are allowed for example, when different 
attributes are needed for different importers. 
  
So what does an ”export definition”  really mean? 
According to the syntax, I can write this: 
1) Export-Package: foo, bar;version=1.0.0 
and 
2) Export-Package: foo; bar;version=1.0.0, bar;version=1.0.1 
As we know in case 1 the version attribute is only applied to package bar, and 
in case 2, it applied to both foo and bar, right? 
OK, the question is: how many export definitions are there in case 1 and 2? 
My thought is that in case 1, there are two export definitions: foo with 
default version 0.0.0 and bar with version 1.0.0; in case 2, there are three 
export definitions, foo with version1.0.0, bar with version 1.0.0, and bar with 
version 1.0.1. 
Am I right? 
  
Thanks! 
Fei 
_______________________________________________
OSGi Developer Mail List
[email protected] <mailto:[email protected]> 
https://mail.osgi.org/mailman/listinfo/osgi-dev 
<https://mail.osgi.org/mailman/listinfo/osgi-dev>  
 _______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev 
<https://mail.osgi.org/mailman/listinfo/osgi-dev>  

_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to