]
Ron Šmeral updated JBIDE-18039:
-------------------------------
Issue Type: Bug (was: Feature Request)
I just found JBIDE-13419, therefore changing this from RFE to Bug.
Support DeltaSpike's PartialBean dynamically implemented
interfaces and Data repositories
-----------------------------------------------------------------------------------------
Key: JBIDE-18039
URL:
https://issues.jboss.org/browse/JBIDE-18039
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: cdi-extensions
Environment: JBDS 8.0.0.Beta3
Reporter: Ron Šmeral
JBDS currently shows _No bean is eligible for injection to the injection point_ for
injection points which are implemented using DeltaSpike's PartialBean extension. This
also affects DeltaSpike's Data module, which is based on PartialBean.
This can be seen e.g. in the deltaspike-partialbean-advanced quickstart:
https://github.com/jboss-developer/jboss-wfk-quickstarts/tree/2.7.x-devel...
The injection point:
{code:java|title=QueryServiceTest.java}
@Inject
private PersonQueryService personQueryService;
{code}
The injected interface:
{code:java|title=PersonQueryService.java}
@RequestScoped
@QueryServiceBinding
public interface PersonQueryService {
...
{code}
A partial bean binding annotation:
{code:java|title=QueryServiceBinding.java}
@PartialBeanBinding
@Target(TYPE)
@Retention(RUNTIME)
public @interface QueryServiceBinding {
}
{code}
The handler:
{code:java|title=QueryServicePartialBean.java}
@RequestScoped
@QueryServiceBinding
public class QueryServicePartialBean implements InvocationHandler {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
...
{code}
There's no implementing class directly in the project, and that's what JBDS is
complaining about. The interface is implemented dynamically, using an extension which
looks for:
* interfaces and abstract classes annotated with a partial bean binding
* invocation handlers which handle calls to methods of those interfaces
and then adds beans for those interfaces in the ABD phase.
The same goes for DS Data module's {{@Repository}} ( = a partial bean binding)
beans.
JBDS should not show the no-bean-eligible warning for dynamically implemented interfaces
or for DS Data repositories and should instead point to the invocation handler associated
with those interfaces through the partial bean binding.