users@hk2.java.net

[Asking]About HK2 Construtor Injection

From: Tang Yong <tangyong_at_cn.fujitsu.com>
Date: Wed, 27 Feb 2013 22:32:03 +0900

Hi Jwells, Team

I have another question about HK2 Construtor Injection.

Currently, because of a fact that org.jvnet.hk2.annotations.Inject has
been changed into javax.inject.Inject(JSR330 spec), the following
Construtor Injection seemed to have problem,

public LocalServerPoolFactory(@Inject TemplateRepository
                                      templateRepository,
                              @Inject Domain domain,
                              @Inject ServerContext environment) {
        this.templateRepository = templateRepository;
        this.domain = domain;
        this.environment = environment;
}

In constructor, @Inject seemed to be not allowed there.

So, I want to know whether there are something with me?

Thanks
--Tang