I want to define an injection, so only if the injected interface has an EJB will it be injected. It is used as a plugin for core EJB. How to do it? Is there any annotation for this?
I can use @PostConstruct to "inject" the variable manually. But then I have to handle the dependencies myself. How can I handle dependencies knowing that one of them is optional? How to handle the deployment order of various dependent modules.
Update:
I see that google has an append annotation with a parameter optional:
import com.google.inject.Inject;
@Inject(optional = true)
Update 2:
JBoss has something that might be what I'm looking for:
import org.jboss.annotation.IgnoreDependency;
@IgnoreDependency @EJB OtherBean otherBean;
source
share