Perhaps Tapestry should throw an exception when one tries to do this instead of failing silently? :)

-Filip

On 2009-02-08 18:03, Howard Lewis Ship wrote:
You need to define an interface for the service; only services with
interfaces can be proxied, and only proxied interfaces can have
non-default scope.

On Sun, Feb 8, 2009 at 4:48 AM, Jack Nuzbit <fnuz...@googlemail.com> wrote:
I'm trying to use the tapestry IoC to inject a per thread service into my
other services.

@Scope(ScopeConstants.PERTHREAD)
public class PerThreadService {
   private MyObject myObject;
   public PerThreadService(Cookies cookies) {
       myObject = new MyObject(cookies.readCookieValue("userData")))
       System.out.println("Constructing new per thread service.");
   }
}

I want this PerThreadService to get constructed at least once per request
but I can see it gets created the first time it's required and then the
constructor never gets called again.
Does anyone know I can do this?

Thanks

Jack





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

Reply via email to