tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thiago H. de Paula Figueiredo" <thiag...@gmail.com>
Subject Re: Advising a Scope PerThread Services with Context
Date Fri, 04 Mar 2011 17:54:49 GMT
On Fri, 04 Mar 2011 14:40:54 -0300, rektide <rektide@voodoowarez.com>  
wrote:

> At present, I'm trying to build a MethodAdvice implementation that  
> modifies the behavior of a PerThread Scope'd service.

The fact that your service has perthread scope shouldn't change anything.

> The MethodAdvice needs access to the public members of the Service to  
> perform this advising.

What do you mean by public members? Fields? Methods in the service  
interface? Methods not in the service interface?
You shouldn't rely in anything outside methods defined in the service  
interface.

> The module that fires the MethodAdviceReceiver can be injected in to,  
> but this is a one time initialization action: it rebuild the  
> MethodAdvice per-request.  I've tried various
> injection annotations in the MethodAdvice itself, but havent had any  
> luck.  Is there some
> programatic means of requesting a Service that I can run inside the  
> MethodAdvice to pull out
> the current instance of my Service?

Any service, including per-threads one, is accessed through a proxy. The  
the service is per-thread, the proxy will delegate method calls to the  
appropriate instance.

Have you tried decoration instead of advising?

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


Mime
View raw message