|Manipulating MANIFEST headers while deploying bundles through a PLAN file [message #642613]
||Thu, 02 December 2010 01:01
| Amit Kumar
Registered: December 2010
Use Case :|
Add a custom Tomcat Valve implementation in tomcat-server.xml. The valve can function as the user-principal initializer if there is a given request header set (OAM cookie) or can provide any other custom implementation.
I have a bundle library created for implementing the required feature. The implemented Valve depends on Tomcat APIs (Catalina libraries). I have copied my JAR under $SERVER_HOME/repository/ext.
Now, when I try to configure this valve in $SERVER_HOME/config/tomcat-server.xml, the DM server fails to start due to missing classes (My Valve in this case).
So, I needed to tell Spring DM extender to somehow load my classes when loading bundle com.springsource.osgi.webcontainer.tomcat, it should also load my bundle. In dependencies terms, it simply means, I have to modify the MANIFEST of bundle com.springsource.osgi.webcontainer.tomcat and add my JAR/Package to 'Import-Bundle' or 'Import-Package' header.
Fortunately, com.springsource.osgi.webcontainer.tomcat bundle is deployed using the PLAN file under repository/ext,
named com.springsource.server.web-2.0.0.RELEASE.plan, and I can manipulate the bundle manifest headers using following syntax in the PLAN -
<artifact type="bundle" name="com.springsource.osgi.webcontainer.tomcat" version="[1, 2)">
<property name="header:Import-Bundle" value="oam.plugins.tomcat;version=1.0.0"/>
Things work perfectly for me at this point without touching the com.springsource.osgi.webcontainer.tomcat bundle. However, this overwrites the existing Import-Bundle headers in com.springsource.osgi.webcontainer.tomcat if any during deploy.
Is there a way I can append my bundle to the 'Import-Bundle' header through similar configuration. I wish there was a feature to support this 'concatination' behavior for Manifest headers through the <property> attribute in the PLAN. I am not aware if there is already a feature currently supported for this.
I would appreciate any comments with respect to this.
[Updated on: Thu, 02 December 2010 01:40]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.03561 seconds