I have an EagerLoad service that uses a PerThread service.  I expected the
EagerLoad service to hold a reference to a proxy to the PerThread service so
that the actual instance of the PerThread service that is used depends upon
the thread calling the EagerLoad service.  Instead, the EagerLoad service is
getting a reference to an actual instance of the PerThread service, not to a
proxy, so the same instance of the PerThread service is getting used by all
threads that call the EagerLoad service.  This surely can't be right. 
Here's a very simplified example:

public class AppModule {
    public static void bind(ServiceBinder binder) {
        binder.bind(EagerLoadService.class);
        binder.bind(PerThreadService.class);
    }
}

@EagerLoad
public class EagerLoadService {
    public EagerLoadService(PerThreadService perThreadService) {
        // prints "class PerThreadService", not a proxy class!
        System.out.println(perThreadService.getClass());
    }
}

@Scope(PERTHREAD_SCOPE)
public class PerThreadService {
}

Is this a bug?  Am I confused about how this should work?  All help
appreciated.

-- 
View this message in context: 
http://www.nabble.com/EagerLoad-service-doesn%27t-use-PerThread-service-correctly-tp18637337p18637337.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to