[opencms-dev] Module Action class updateModule method
Mariano Barcia
opencms at colaborativa.net
Thu Nov 24 18:59:30 CET 2005
Achim,
You are welcome.
It seems that some kind of module class-loader is needed if we want to
load/unload classes selectively, as in the present case.
One nice feature of OpenCMS is that you can extend its functionality using
"modules". The concept of module is key to opencms and it's not crazy at all
to consider that it may need its own class loader, as all servlet containers
do for JSP/servlets
(http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html).
Simply put, a servlet container does class-loading of all its classes (i.e.
JSPs), and OpenCMS could build its own class loader in top of those to
complete the offer.
The approach currently being used is to copy the JSP files and classes to
the container's file system, and wait for the container to do the job. But
this sometimes forces opencms administrators to manage not only opencms, but
also the underlying container (manager webapp in the case of tomcat).
What do you think?
Regards,
--mariano
-----Mensaje original-----
De: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org]
En nombre de Achim Westermann
Enviado el: Thursday, November 24, 2005 1:52 PM
Para: The OpenCms mailing list
Asunto: Re: [opencms-dev] Module Action class updateModule method
Hi Mariano,
ok, I tested it by myself and should have known. Well, on the tomcat side I
still got potential to improve knowledge ;). Sounds odd what has to be done
to
support hot deployment.
For the dynamic module loading: Thanks for your helpful thoughts on the
requirements a Module Classloader had to fulfill in order to support hot
module
deployment. It is an advanced - but standard - Java task with average level
of investment as solutions, tutorials and examples are available in several
cafés
and saloons.
Once integrated it would be completely transparent to the user. Performance
would only possibly suffer without proper caching of unchanged classes in
combination with many modules that load too many classes themselves.
On the other hand this is very low level. When I was young, I believed that
*my Code* would run stable always. I do have seen unreproducable things and
sideeffects since then and OpenCms is way beyound a 50 Kb lib. Furthermore
we have to spend our time earning money. To sum it up: It's a decision
influenced by
stability, stability, stability and business plan and I would not touch the
judgement with a 40 ft pole ;)
kind regards,
Achim
--
Achim Westermann
-------------------
Alkacon Software
http://www.alkacon.com
Mariano Barcia wrote:
> Achim,
>
> Thank you for your quick response.
>
> I believe Tomcat is not enough because the context needs the "reloadable"
> attribute set to "true". In a production environment, that's not the case
> because it affects performance significantly.
>
> Moreover, Tomcat would restart the whole context, destroying all the
> sessions and interrupting service.
>
> In a website with static export enabled, reloadable=true and restarting
> automatically can be an option. But I'm afraid that option falls short
when
> considering sites where the offline and online versions are served from
> tomcat directly.
>
> I will re-evaluate this issue with my team and come up with more, kind
> regards
>
> --mariano
>
>
> PS: BTW, we had problems in Linux mainly with modules in opencms 5.
Despite
> the export point was set OK, the module would not copy the JARs to the lib
> directory in the tomcat file system. But I don't have a detailed report of
> the problem now.
>
>
> -----Mensaje original-----
> De: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org]
> En nombre de Achim Westermann
> Enviado el: Thursday, November 24, 2005 4:14 AM
> Para: The OpenCms mailing list
> Asunto: Re: [opencms-dev] Module Action class updateModule method
>
> Hi Mariano,
>
>
>>Our company is having a hard time due to the need to restart the context
>>every time a module is installed or re installed. Moreover, sometimes
>
> tomcat
>
>>does not seem to copy the JARs needed to the WEB-INF/lib folder.
>
>
> Copying the jar of the module is a matter of the export point
> WEB-INF/lib of the module's manifest.xml. I (seem to) do remember that
> the standard opencms modules have been refactored recently to import the
> jar files into the module (VFS) and then export it to WEB-INF/lib in the
> real file system.
> Custom modules have to be configured to do this too.
> Try configuring your module this way and install the module anew. Then
> try to trigger code-paths that use classes of your module lib without
> restart. According to Joachim tomcat already ships with a Classloader
> that supports hot deployment. I did not test this before and would be
> interested to hear, if that already does the trick.
>
> kind regards,
>
> Achim
>
>
>>Does a "module class loader" for opencms makes sense?
>>
>>Proposal:
>>
>>- Build a module class loader that adds functionality to the current
>
> opencms
>
>>modules core.
>>
>>- The module class loader, upon INSTALL, should look into the WEB-INF/lib
>
> of
>
>>the newly installed module for JARs, and load and register the classes
>>inside those JARs
>>
>>- The module class loader, upon UNINSTALL, should unload the classes
>>registered with the module
>>
>>- This module class loader should be transparent to the module developers.
>>
>>If it worked on Tomcat only, I think it would be a big hit.
>>I look forward to your comments, TIA
>>--mariano
>>
>>
>>-----Mensaje original-----
>>De: opencms-dev-bounces at opencms.org
>
> [mailto:opencms-dev-bounces at opencms.org]
>
>>En nombre de Joachim Arrasz
>>Enviado el: Tuesday, November 08, 2005 5:35 AM
>>Para: The OpenCms mailing list
>>Asunto: Re: [opencms-dev] Module Action class updateModule method
>>
>>Hi
>>
>>
>>
>>>the module handler class ships within your module, most often in a jar.
>>>Before an import it is not known to the JVM running.
>>
>>
>>right
>>
>>
>>
>>>It will be highly depnendant on the caching of the application server's
>>>current Classloader wether dynamic class loading
>>>(class.forName("name"))") will be successful or not. Only by
>>>implementing a non - caching CL for module initialization after import
>>>this could be possible - expensive though.
>>
>>
>>Well, most of todays popular servers like JBoss, Tomcat, We4bSphere ...
>>are able to check their lib folders at app's runtime. They updates the
>>cl's cache after you changed lib folders content. So it is not so
>>expensive. But you're right, not ALL servers can do this.
>>
>>And it is one more point of failure for users of opencms when they have
>>to configure this manually.
>>
>>Regards Achim
>>
>>
>>_______________________________________________
>>This mail is send to you from the opencms-dev mailing list
>>To change your list options, or to unsubscribe from the list, please visit
>>http://mail.opencms.org/mailman/listinfo/opencms-dev
>>
>
>
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
>
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 11/24/2005
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/181 - Release Date: 11/24/2005
More information about the opencms-dev
mailing list