Re: [Quickfix-developers] Dynamic loading of cfg files
Brought to you by:
orenmnero
From: Scott H. <sco...@fo...> - 2004-06-09 16:59:11
|
At first glance you just need to construct an in-memory .cfg file in a String or StringBuffer, wrap that in a ByteArrayInputStream, and pass that to the SessionSettings constructor. HOWEVER, my experience with the Initiator under JNI is that you're limited to a single lifecycle per JVM, due to some tricky interactions of the destructors in Initiator.cpp as it's currently written. This means that you're stuck with the [SESSION]s defined in your initial .cfg file. I too would like to see this addressed in a future release. Your idea of using an empty default constructor for SessionSettings and then calling the various setString(), setLong() methods would be nice, but also will not work with the current code. For now, think of SessionSettings.java s simply a view of an already-parsed .cfg file. The interface would need to be extended (and the internal Dictionary objects passed around by reference instead of by value) for the Java SessionSettings to be "writable". On Wed, 9 Jun 2004, Shamanth wrote: > Hi > > I have a requirement, where we want to change or add new sessions or > providers dynamically. Or I would like to change the port for a given > provider. We are going to do this using an MBean. Basically we will have > an MBean which will read the SESSION and DEFAULT properties from a > custom property file. > > Problem: We want to create a new SocketInitiator for each provider. > Since a SocketInitiator expects a SessionSettings object we would > ideally like to create a new SessionSettings object dynamically. But as > the constructors of a SessionSettings object expects a inputstream, I > don't see how we could do this. > > I would like a empty default constructor for SessionSettings and then we > use the set methods to set any perticular property. Do you have any > plans to incorporate this in your future releases. > > Or is there an alternate way of acheiving the same result. > > I am using Java version of quickFix. > > thanks > R Shamanth |