hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Mittendorf <>
Subject Re: How to access the Hivemind Registry ?
Date Thu, 09 Feb 2006 15:46:05 GMT
Am 09.02.2006 um 15:23 schrieb Christian Mittendorf:

> I'm already inside a service, but inside this Service a Factory is  
> used for returning objects that are necessary for initializing  
> beans. Each of these might require access to different services,  
> therefore a reference to the Registry will help. And I don't want  
> to inject every service available ;-)

Ok, we've solved the problem by injecting ApplicationGlobals into the  
Service and getting the Registry from the ServletContext:

     <implementation service-id="InitService">
             <construct class="hivemind.impl.InitServiceImpl">
                 <set-service property="applicationGlobals" service- 

	private static final String REGISTRY_KEY_PREFIX =  

	private Registry registry = null;
	public void setApplicationGlobals(ApplicationGlobals globals)
		ApplicationSpecification spec = (ApplicationSpecification)  
		String key = BeanInitServiceImpl.REGISTRY_KEY_PREFIX + spec.getName();
		ServletContext context = globals.getServletContext();
		this.registry = (Registry) context.getAttribute(key);

Are there any points speaking against this solution?


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

View raw message