hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. M. Karlsen" <>
Subject Re: [Newbie] Singletons starting twice
Date Wed, 25 May 2005 23:03:17 GMT
Geoff Hopson wrote:

>Thanks for the response.
>Not got the code in front of me, but I recall it is using
>createDefaultRegistry. I am attempting to get the registry started
>before I start the web server - I have a main method that attempts to
>start the registry, get my service started, then when everything is
>set up and ready, start the web server.
>On 5/25/05, Achim Huegen <> wrote:
>>How do you initialise the registry?
>>Are you using the HivemindFilter?
>>Am Wed, 25 May 2005 19:47:05 +0100 schrieb Geoff Hopson <>:
>>>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?
Maybe you could build the registry in the init() method of the servlet? 
That way you could init the services before the first request - and keep 
the registry within the web-module classloader if it has a separate one.

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

View raw message