Why don't you create an application-specific factory for your
application's Registry that can properly manage the lifecycle of the
Registry for your app.

In Vista, we created the registry and then stored it into local JNDI.

You could  get the same mileage out of a shared static variable.

On Tue, 20 Jul 2004 12:51:58 -0400, Steve Gibson <[EMAIL PROTECTED]> wrote:
> I have had a recurring issue migrating to HiveMind.
> Our old code made it simple to get a service instance by calling a
> static method on a particular class.
> 
> In HiveMind, this is not as easy, at least not with the constraint that
> our code should be deployable/runnable both inside and outside a servlet
> container.
> 
> My idea is that RegistryBuilder.constructDefaultRegistry could store the
> registry instance it creates, with subsequent calls returning the same
> instance. In fact, that's what I thought it did originally, and didn't
> find out until in my test case for my security service, a user would log
> in, but the log out test would fail, as a new registry was being
> created, resulting in a new singleton of my service.
> 
> This static method is supposed to be a convenience method, so I don't
> think this would reduce functionality. If you need to be able to build
> multiple registries, the extra work of grabbing the Locale shouldn't be
> a big deal.
> 
> Steve Gibson
> Software Engineer
> COWWW Software
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to