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

Reply via email to