cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <>
Subject Re: ReloadingClassloader events
Date Mon, 21 Feb 2005 20:56:54 GMT
> Sounds like an Observer pattern is needed so that whichever code needs
> the info can subscribe to "class XY was reloaded" events.

Exactly ...but one thing I am still thinking of:
How do I get hold of that instance of the classloader
so I can you can subscribe to the events?

One idea...

  class ReloadingHelper {
    public void static addListener(ReloadingListener object) {
      ClassLoader cl = object.getClass().getClassLoader();
      if (cl instanceof ReloadingClassLoader) {

So after every object creation (that need to
be aware of reloading) you would need to do:

   MyObject a = new MyObject();

As for having a classloader per sitemap ...I am not
quite sure if this is feasible. I mean: usually you
don't want to have a class repository (aka eclipse
project) per sitemap!

Let's say class org.apache.Bla is being changed do we know what sitemap is using it? We
would also need to somehow use the observer pattern
for that. ...I am not sure if this really simplifies

Although... maybe we need this for the kernel
anyway. (Pier?)


View raw message