Affects Version/s: 3.2
Fix Version/s: 3.2
The thesis is to eliminate the Connector-specfic JavaBean which is currently the heart of the MDB/Connector model. The @ActivationConfigProperty is just a reflection of that Connector JavaBean.
There are several disadvantages to the JavaBean approach and current Connector style:
- Metadata is loosely typed in the bean code
- Only class-level metadata is allowed, not method-level
- Requiring an interface can limit API expressiveness
For those that aren't intimately familiar with the Connector and MDB relationship, see the blog post EJB.next Connector and Bean API for explanation and this github project, MDB Improvements: Telnet Connector for an actual functioning connector.
The short version of the proposal is as follows:
- Allow the ResourceAdapter to obtain the bean class through the ActivationSpec
- Allow the ResourceAdapter to obtain a no-interface view of the bean
This can be done with text and no new API classes or signatures are required. The contract would be simple.
- The Connector Provider can request the MDB implementation class (ejb class) via the ActivationSpec
- If the ActivationSpec has an 'ejbClass' property the MDB Container would be required to:
- set a reference to the ejb class of the MDB when creating the ActivationSpec instance
- return a no-interface view of the MDB from the MessageEndpointFactory.createEndpoint method
Of course the "no-interface" view would still implement MessageEndpoint and the message listener interface.
Instead of requiring Connectors to supply a regular interface such as 'public interface Foo' as the <messagelistener-type>, allow the Connector to supply a an annotation such as public @interface Foo as the message listener interface. The MDB use that on the bean class.
Some of the possibilities this would open up:
EmailAccountInfo, Header, Deliver, HeaderParam, and Body are all annotations supplied by the Connector demonstrating the "JAX-RS" like APIs that could be written and standardly used via custom connector. The APIs themselves could of course become standard, but that would not be necessary – the connector itself could be run in any compliant server.
Another example of an MDB that accepts commands issued in a telnet console: