cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: [flowscript] help w/ static initialization pb
Date Mon, 06 Jun 2005 20:20:48 GMT

On Jun 6, 2005, at 12:33 PM, Mark Lundquist wrote:

> Hi,
>
> I hope this isn't too lame of a question! :-)
>
> I have a Java class that's referenced from flowscript via 
> importClass().  The class contains a static initializer block, and 
> this static initializer block is not getting called.
>
> Any ideas why that would be?

Figured it out.  I'm a Java 'tard :-/

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.

—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message