cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <alexander.klimetsc...@mindquarry.com>
Subject Shielded class loading between blocks
Date Mon, 20 Nov 2006 11:11:50 GMT
Let's discuss the topic of shielded class loading between blocks as 
started in the thread about moving the shielded class loading stuff into 
the maven-war-plugin 
(http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=116401943430213&w=2).

There is the patch that will eventually move out the shielded 
classloading stuff from cocoon-bootstrap and cocoon-deployer-plugin into 
  the maven-war-plugin: http://jira.codehaus.org/browse/MWAR-84. 
Conflicting with that is my simple patch for shielding between blocks at 
  http://issues.apache.org/jira/browse/COCOON-1955.

The optimal solution would be the OSGi support (!?), but this is too 
much work and won't be part of cocoon 2.2. My patch is a lot simpler, 
just fixing the BootstrapClassLoaderManager and the blocks-fw (where I 
just implemented the not-yet implemented methods of those servlet 
interfaces). Then it is just a simple configuration of the block servlet 
using the ShieldingServlet. Here is the xml snippet, the full config can 
be found in the jira issue:


<bean id="my-block"
   class="org.apache.cocoon.blocks.BlockServlet">
   <property name="mountPath" value="/my-block" />

   <property name="servletClass"
     value="org.apache.cocoon.bootstrap.servlet.ShieldingServlet" />

   <property name="blockContextURL"
     value="blockcontext:/mindquarry-solr-block/" />

   <property name="properties">
     <map>
       <entry key="servlet-class"
         value="org.apache.cocoon.sitemap.SitemapServlet" />
       <entry key="bootstrap-classpath-file"
         value="/paranoid-classpath.txt" />
       <entry key="bootstrap-classloader-debug" value="true" />
       <entry key="bootstrap-classloader-factory"
       value="org.apache.cocoon.classloader.DefaultClassLoaderFactory" />
     </map>
   </property>
</bean>


So can this made be simpler? Having standard paths in the block 
directory for the shielded libs and some config option to enable 
shielding, which could be integrated directly in the BlockServlet?

Alex

-- 
Alexander Klimetschek
http://www.mindquarry.com


Mime
View raw message