commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Howard M. Lewis Ship" <>
Subject RE: [hivemind] Getting Registry in Initilizable
Date Thu, 04 Sep 2003 19:12:21 GMT
Sorry for delay in responding; it's hard to pick out the HiveMind stuff in this list; I need
to add
a filter.

Howard M. Lewis Ship
Creator, Tapestry: Java Web Components

> -----Original Message-----
> From: Christian Essl [] 
> Sent: Tuesday, August 19, 2003 6:09 PM
> To:
> Subject: [hivemind] Getting Registry in Initilizable
> First I want to congratulate and thank you for hivemind. It 
> brings 80 % of 
> what you need from a container for 20 % of the overhead in 
> one and only one 
> implementation. The eclipse style plugin style has proved to be very 
> useful.

And it's only getting better, with the new service models.

> However as I see a CoreService can get the Registry only from 
> the static 
> HiveMind.getDefault() method in an implementation independent 
> way. I think 
> this could lead to problems in enviroments where different 
> registries are 
> used in the same classloader or classloader-hierarchy. I.E. 
> HiveMind is 
> used by the ServletContainer and in the Webapps or different 
> Frameworks 
> within the same WebApp use their own Registry with their own 
> modules.xml 
> files (stored in separate directories).

It is possible to get to the registry indirectly, by implementing Initializable.  The
ServiceExtensionPoint includes a module property, which includes a registry property, from
which you
can get anything.

However, that's not the ideal way; if you need (or may need) another service, create a property
the service and have the hivemind.BuilderFactory assign the other service as a property of
implementation. The latest releases of HiveMind will create a deferred proxy to the service
(so that
you don't incur the overhead of constructing the service until you actually invoke a method
on the

> Therefore I want to suggest that from the 
> Initilizable.initializeService() 
> parameters there would be a way to get the Registry instance 
> which acutally 
> manages the Service. For example the ServiceExtensionPoint 
> interface could 
> have a method getModule() from which you could get the 
> Registry or the 
> Registry would be passed directly as a parameter to the 
> initilizeService() 
> method.

Yep, getModule() is already in there, in GenericExtensionPoint (super-interface of

Howard M. Lewis Ship
Creator, Tapestry: Java Web Components

View raw message