[proton-j] MessengerFactory

2013-02-15 Thread Rajith Attapattu
I was wondering what is the mechanism recommended for obtaining a
MessengerFactory instance (other than directly instantiating it).

IIRC people are planning to use the pure java and swig based impl side
by side especially for testing.
So this rules out the way we used for the old jms client (Where the
class name was specified as jvm arg and used reflecting to load it).

Rajith


Re: [proton-j] MessengerFactory

2013-02-15 Thread Keith W
Hi Rajith

 I was wondering what is the mechanism recommended for obtaining a
 MessengerFactory instance (other than directly instantiating it).

Take a look at ProtonFactoryLoader and the factories themselves:
EngineFactory, MessengerFactory, MessageFactory etc.
ProtonFactoryLoader is ServiceLoader based. It relies on configuration
files within the META-INF/services directory of each implementation
JARs.

 IIRC people are planning to use the pure java and swig based impl side
 by side especially for testing.

Yes, that's the plan as I understand it. The system tests will have
the ability to test two proton-j stacks together, two proton-jni
stacks, or proton-j vs proton-jni (to test the different
implementations together).  This is something Phil and myself are
currently working on.  ProtonFactoryLoader will need to change so that
the test can specify the 'type' implementation to be created.

HTH