hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Hopson <>
Subject [Newbie] Singletons starting twice
Date Wed, 25 May 2005 18:47:05 GMT

Probably a FAQ or I´ve done something dumb....

I have an application that starts an embedded Jetty server. However, I
need a service to be started up and initialised before the web server
starts up and is able to receive web service calls - lots of database
initialisation, pre-fetching etc. I cannot do this on receipt of the
first web service call, unfortunately.

So, I saw eagerLoad and tried that. Nice. I can get my service set up
and initialized before the web server starts.

But, when the first request arrives, the service is initialised again!

The first time, the service is initialised through the ´Main´ thread.
When Jetty starts up, the first request initializes my service from
the ´Listener-X´ thread (whichever one responds). Once that
initialisation is done, no more occur (which is what I expect from the
default singleton model).

I guess I am loading the registry twice, but I have no idea why/how.

Any clues? Any other techniques for pre-loading services other than
eagerLoad? What do folks do with embedding Jetty and HiveMind in the
same application?

Thanks for any insights,

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

View raw message