users@jms-spec.java.net

[jms-spec users] [jsr368-experts] Re: Re: Re: [jsr343-experts] Re: JMS_SPEC-89: Standard API to create and configure a ConnectionFactory

From: Werner Keil <werner.keil_at_gmail.com>
Date: Tue, 17 Mar 2015 15:55:20 +0100

As I understand it, the closest other examples would be BeanValidation's
static factory class:
http://docs.jboss.org/hibernate/beanvalidation/spec/1.1/api/javax/validation/Validation.html
or CDI:
http://docs.jboss.org/cdi/api/1.2/javax/enterprise/inject/spi/CDI.html

JSR 354 has several similar classes in the API which use the ServiceLoader
mechanism to retrieve and expose their return values.

Werner



On Tue, Mar 17, 2015 at 3:36 PM, Nigel Deakin <nigel.deakin_at_oracle.com>
wrote:

> On 17/03/2015 12:31, John D. Ament wrote:
>
>> I think using a service loader approach would be the best, and most
>> consistent option.
>>
>> ConnectionFactory cf = JMS.newConnectionFactory(map);
>>
>> or
>>
>> ConnectionFactory cf = JMS.newConnectionFactory();
>>
>> Where JMS is a new class added by the EG, similar to provider classes in
>> WebSocket, JPA, BeanValidation etc.
>>
>> John
>>
>
> Who implements the "JMS" class? Does each JMS provider have to supply its
> own implementation?
>
> If it is implemented by the JMS provider, how how does the application
> choose which whose implementation of the "JMS" class it wishes to use,
> bearing in mind that the same application must be able to use multiple JMS
> providers?
>
> If the same implementation is expected to work for each JMS provider, then
> how does the implementation know how to instantiate a given
> ConnectionFactory?
>
> Nigel
>