Maybe we need a additionnal way to add strategy into JST. In addiction of adding
local strategy to a JST running by JWS, it would allow a user/developer to make
a checkout of the official SVN repository somewhere and a checkout of his
strategy from another SVN repository elsewhere.
Florent,
+ added following 4 lines to the beginning of MainFrame.getImageURL
method (below the URL imgURL line)
ClassLoader cl = getClass().getClassLoader();
if (cl.getClass().getSimpleName().equals("JNLPClassLoader")) {
imgURL = cl.getResource(imageFileName.replaceAll("\\\\", "/"));
}
+ added following 10 lines to the end of ClassFinder.getClasses method
(above the Collections.sort line)
ClassLoader cl = getClass().getClassLoader();
if (cl.getClass().getSimpleName().equals("JNLPClassLoader")) {
BufferedReader strategies = new BufferedReader(new
InputStreamReader(cl.getResourceAsStream("strategies.txt")));
for (String strategy; (strategy = strategies.readLine()) !=
null;) {
String className = packageName + "." +
strategy.substring(0, strategy.lastIndexOf("."));
Class<?> clazz = Class.forName(className);
classes.add(clazz);
}
strategies.close();
}
+ generate a listing of source\com\jsystemtrader\strategy folder to a
strategies.txt file with dir /a:-d /b source\com\jsystemtrader
\strategy
\*.class > strategies.txt
+ create jsystemtrader application jar file containing binary classes
+ resources folder + strategies.txt file
+ sign jsystemtrader application jar file and library jar files with a
test/fake certificate. see
http://java.sun.com/javase/6/docs/technotes/guides/javaws/developersguide/development.html#signing
+ write a jnlp file with security set to all-permissions for example
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="file:///c:/trader" href="trader.jnlp">
<information>
<title>Trader</title>
<vendor>Trader</vendor>
<homepage href="index.html" />
<description>Trader</description>
<offline-allowed />
</information>
<resources>
<jar href="trader.jar" main="true"/>
<jar href="liquidlnf.jar"/>
<jar href="commons-math-1.2.jar"/>
<jar href="API-9.4.jar"/>
<jar href="OTFeed.jar"/>
<jar href="jcalendar-1.3.2.jar"/>
<jar href="joda-time-1.5.jar"/>
<jar href="jfreechart-1.0.6.jar"/>
<jar href="mail.jar"/>
<jar href="jcommon-1.0.9.jar"/>
</resources>
<application-desc main-
class="com.jsystemtrader.platform.startup.JSystemTrader">
<argument>.</argument>
</application-desc>
<security>
<all-permissions/>
</security>
</jnlp>
Now I can run the application with the jnlp file and can do charts,
strategy run, optimizer like running on the desktop.