How to implement a new guice scope that caches and

2019-07-22 17:01发布

I want to be able to connect to various back-ends by changing a custom header of my HTTP requests. Therefore I want that my request is served with a controller instance that is specific to the selected back-end. The controllers that serve the requests are created using Guice and have many dependencies. I want to cache these controller instances. So for each (SomeController.class, backend) pair there would be a cached instance.

How to implement such a Guice scope? I am using Play Framework 2.1.

0条回答
登录 后发表回答