You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Christian Essl <ch...@yahoo.de> on 2003/08/20 00:09:29 UTC

[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.

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).

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.

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [hivemind] Getting Registry in Initilizable

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
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
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Christian Essl [mailto:christianessl@yahoo.de] 
> Sent: Tuesday, August 19, 2003 6:09 PM
> To: commons-dev@jakarta.apache.org
> 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 for
the service and have the hivemind.BuilderFactory assign the other service as a property of your
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
service).


> 
> 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
ServiceExtensionPoint).

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com