Handling several implementations of one Spring bean/interface in one class field
<p>Similar to this <a href="https://stackoverflow.com/questions/11777079/handling-several-implementations-of-one-spring-bean-interface">question</a>, but I have this situation. Suppose I have one <code>AccountService</code> interface and two implementations: <code>DefaultAccountServiceImpl</code> and <code>SpecializedAccountServiceImpl</code>, (the classes just like in the previous <a href="https://stackoverflow.com/questions/11777079/handling-several-implementations-of-one-spring-bean-interface">question</a>). The implementation is in one class, but has different bean implementation for different method. Say:</p>

<pre><code>@RestController
@RequestMapping("/account")
public class AccountManagerRestController {

    @Autowired
    private AccountService service;

    @RequestMapping(value = "/register", method = RequestMethod.POST)
    HttpEntity&lt;?&gt; registerAccount(@RequestBody AccountRegisterRequestBody input) {
        // here the `service` is DefaultAccountServiceImpl
        ...
    }


    @RequestMapping(value = "/register/specialized", method = RequestMethod.POST)
    HttpEntity&lt;?&gt; registerSpecializedAccount(@RequestBody AccountRegisterRequestBody input) {
        // here the `service` is SpecializedAccountServiceImpl
        ...
    }
}
</code></pre>