You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Edoardo Campagnano <ed...@dappolonia.it> on 2006/10/10 12:04:11 UTC

Accessing HiveMind Registry

Hi to all,

I've got a small prioblem with HiveMind. I wrote a small Service but I must
use from a class taht is outside a Tapestry component and can't be declared
abstract. I need something like in the HiveMind manual:

 

(from the HiveMind home page)
.
Registry registry = RegistryBuilder.constructDefaultRegistry();
MyService service = (MyService)
registry.getService("com.mypackage.MyService", MyService.class);

.

 

The key is access the Registry but in this way it throws an exception. I'
don't know how but I'm sure it is possible

 

Edoardo 

 


Re: Accessing HiveMind Registry

Posted by Ron Piterman <rp...@gmx.net>.
One way would be to create a factory for instances of this class in
hivemind, and inject any services you need to it.

Another way would be to get the registry instance tapestry uses, which
is stored as a context attribute. see the ApplicationServlet code.
Cheers,
Ron


Edoardo Campagnano wrote:
> Hi to all,
> 
> I've got a small prioblem with HiveMind. I wrote a small Service but I must
> use from a class taht is outside a Tapestry component and can't be declared
> abstract. I need something like in the HiveMind manual:
> 
>  
> 
> (from the HiveMind home page)
> .
> Registry registry = RegistryBuilder.constructDefaultRegistry();
> MyService service = (MyService)
> registry.getService("com.mypackage.MyService", MyService.class);
> 
> .
> 
>  
> 
> The key is access the Registry but in this way it throws an exception. I'
> don't know how but I'm sure it is possible
> 
>  
> 
> Edoardo 
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org