[JMS_SPEC-147] Extend the @JMSConnectionFactory annotation to allow a resource reference to be defined Created: 17/Mar/14 Updated: 20/Mar/14
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
In JMS 2.0 the @Inject annotation may be used to inject a JMSContext into a Java EE application.
The @JMSConnectionFactory annotation may be used to specify the "the JNDI lookup name" of the connection factory which should be used. This is the only information about the connection factory that may be specified. The specification is unclear about what this lookup name represents.
Compare this with the @Resource annotation which may be used to inject a JMS connection factory. This allows the connection factory to be specified using the name, lookup, mappedName, authenticationType, description, shareable and type attributes.
The @JMSConnectionFactory annotation only allows a single attribute (value) to be specified. Since this is described as the "lookup name" we can assume it corresponds to the lookup attribute of the @Resource annotation, though this isn't stated explicitly.
The @JMSConnectionFactory annotation doesn't allow any of the other attributes to be specified. This means that some important characteristics of the connection factory cannot be specified when injecting a JMSContext.
Another consequence of this is that the @JMSConnectionFactory annotation doesn't allow a resource reference name to be defined. This prevents the deployer defining or overriding these values by creating a <resource-ref> element in the deployment descriptor.
The @JMSConnectionFactory annotation therefore needs to be clarified and extended to allow the same information to be specified as when using a @Resource annotation to inject a JMS connection factory. In addition the specification should state more clearly exactly what the existing value attribute specifies.
|Comment by reza_rahman [ 20/Mar/14 ]|
I honestly hope this one is prioritized via the EG/community. The problem is that things like @Resource name, mappedName, authenticationType, description, shareable and type are rarely used as far as I have seen personally over many years apart from perhaps the corner case of very, very large corporate environments (perhaps in the Fortune 10?). As a result, these features add to the impression of a complex and bloated API that isn't developer friendly. It was part of the reason we moved towards standard global JNDI names/scopes in the Java EE 6 EG (I was part of that discussion and still remember it clearly).
Please note that these are purely my personal views and certainly not of Oracle's as a company.