1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
<B><CODE><PRE>
import quickfix.*;
import java.io.FileInputStream;
public class MyClass {
static {
System.loadLibrary("quickfix_jni");
}
public static void main(String args[]) throws Exception {
if(args.length != 1) return;
String fileName = args[0];
Application application = new Application();
SessionSettings settings = new SessionSettings(new FileInputStream(fileName));
MessageStoreFactory storeFactory = new FileStoreFactory(settings);
LogFactory logFactory = new FileLogFactory(settings);
MessageFactory messageFactory = new DefaultMessageFactory();
Acceptor acceptor = new SocketAcceptor
(application, storeFactory, settings, logFactory, messageFactory);
acceptor.start();
// while( condition == true ) { do something; }
acceptor.stop();
}
}
</PRE></CODE></B>
|