You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Schulte Marcus <ma...@bmw.ch> on 2006/03/20 08:37:50 UTC

RE: Accessing registry from a servlet without recreating a new in stance

Tapestry builds the registry for you.
Instead of a Servlet-Filter you should use a Tapestry
WebRequestServicerFilter and let HiveMind inject the required service(s)
into it.

> -----Original Message-----
> From: Ovidiu Hurducas [mailto:ovidiu@artsoft-consult.ro]
> Sent: Monday, March 20, 2006 8:32 AM
> To: hivemind-user@jakarta.apache.org
> Subject: Accessing registry from a servlet without recreating a new
> instance
> 
> 
> Greetings,
> 
> I’m using Hivemind+Tapestry+Hibernate to build a site. I have a 
> javax.servlet.Filter object where I need to do some operations with a 
> Hivemind service that uses Hibernate.
> 
> To access the registry from the filter I’m using the example from the 
> Hivemind documentation:
> 
> Registry registry = RegistryBuilder.constructDefaultRegistry();
> 
> MyService service = (MyService) 
> registry.getService("com.mypackage.MyService", MyService.class);
> 
>  
> 
> However this is not good. The registry is recreated and the Hibernate 
> configuration is read again.
> 
> There is a way to access an existing registry that is already 
> initialized? I don’t want to recreate the registry twice.
> 
> Thank you,
> 
> Ovidiu
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: hivemind-user-help@jakarta.apache.org
> 

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