[geotk] Can I prevent Geotoolkit from spawning new threads?

Jon Blower j.d.blower at reading.ac.uk
Wed Oct 14 05:38:56 EDT 2009

Hi Martin,

> 1) Disable the call to ShutdownHook.INSTANCE.register(...) in
>   org.geotoolkit.factory.FactoryFinder line 198.
>   Consequence: no cleanup on shutdown, but may not be a big deal if
>   no database connection were fetched and no temporary file created.

In Google App Engine applications cannot write to the local disk
anyway - they must use Google's I/O abstractions to write to their
distributed file store.  Files can only be read from the local
filesystem from inside the application's WAR file.  So I was thinking
of packaging epsg.properties in the application's WAR and reading CRSs
from there.  Presumably somewhere in the GeoTk code there is a method
for parsing WKT that is not dependent on factories (even if it's
buried somewhere in a private method)?

> 2) Replace usage of Cache / WeakHashMap / WeakHashSet (all those
>   classes are in the org.geotoolkit.util.collection package) by
>   plain HashMap. It may force us to define a couple of new
>   interfaces replacing the direct usage of WeakHashSet / Cache
>   implementations.

I'm not sure why Geotk needs a WeakHashMap implementation, since there
is one in the JDK.  I'm also not sure why weak collections need
background cleanup threads; entries will automatically disappear from
WeakHashMaps when the keys are garbage-collected.  (The JDK doesn't
have a WeakHashSet or Cache implementation AFAIK.)  I guess there must
be a reason though?

> The whole java.awt.geom package is excluded from this white list.

Oh dear.  :-(  This looks like the biggest problem.  I wonder if it's
possible to provide awt.geom as a separate JAR in user space?  I shall
investigate on the GAE forums and see if I can find a reason why it's

Cheers, Jon

Dr Jon Blower
Technical Director, Reading e-Science Centre
Environmental Systems Science Centre
University of Reading
Harry Pitt Building, 3 Earley Gate
Reading RG6 6AL. UK
Tel: +44 (0)118 378 5213
Fax: +44 (0)118 378 6413
j.d.blower at reading.ac.uk

More information about the Geotoolkit mailing list