cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorg Heymans>
Subject Re: [flowscript] help w/ static initialization pb
Date Tue, 07 Jun 2005 09:10:37 GMT

Mark Lundquist wrote:

> This class exists only for static things.  I just figure out that in
> Java, the static initialization block doesn't run when the class is
> loaded, it gets run upon the first instantiation of the class, and I was
> never instantiating the class.
> When I added
>     new Foo();
> to my flowscript, it all started working.  I should probably implement a
> real Singleton pattern for this thing.

Static initializer blocks are run only once and that is when the class
is loaded for the first time. I don't know see how flowscript or Rhino
could possibly intercept this as it's a VM thing.

Put a system.out.println() at the top in the static block to verify
this. Maybe you have a silenced exception making you think the block
doesn't get run ?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message