public interface ILocalStrategyManager extends IStrategyManager<ILocalStrategyDescriptor,LocalStrategyListener>
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
compileStrategy(java.io.File srcFile)
Compiles a strategy .java source file to a .jfx file
|
java.util.List<IStrategyParameter> |
getDefaultParameters(java.io.File file)
Returns default strategy parameters
|
java.util.concurrent.Future<IStrategyResponse<java.util.UUID>> |
startStrategy(java.io.File strategyFile)
Starts a strategy with default parameters.
|
java.util.concurrent.Future<IStrategyResponse<java.util.UUID>> |
startStrategy(java.io.File strategyFile,
java.lang.Object[] params)
Starts a strategy with parameters.
|
addStrategyListener, getStartedStrategies, removeStrategyListener, stopStrategyjava.util.List<IStrategyParameter> getDefaultParameters(java.io.File file) throws java.io.IOException, JFException
file - a compiled strategy .jfx filejava.io.IOException - in case of file read/load errorJFException - if security-related exception occursjava.io.File compileStrategy(java.io.File srcFile)
srcFile - source filejava.util.concurrent.Future<IStrategyResponse<java.util.UUID>> startStrategy(java.io.File strategyFile) throws java.io.IOException
// start a strategy without fetching the id
strategyManager.startStrategy(jfxFile);
// start and fetch the id
IStrategyResponse <UUID> startResponse = strategyManager.startStrategy(jfxFile).get();
if (startResponse.isError()) {
System.err.println("Strategy failed to start: " + startResponse.getErrorMessage());
} else {
myStrategyId = startResponse.getResult();
System.out.println("Strategy successfully started: " + myStrategyId);
}
strategyFile - strategy jfx file to runFuture object for obtaining the server responsejava.io.IOException - in case of strategyFile read/load errorjava.util.concurrent.Future<IStrategyResponse<java.util.UUID>> startStrategy(java.io.File strategyFile, java.lang.Object[] params) throws java.io.IOException, JFException
Configurable field count, likewise the value types should match.
// start a strategy without fetching the id
strategyManager.startStrategy(jfxFile, new Object[]{"param value", 1, "another param value"});
// start and fetch the id
IStrategyResponse <UUID> startResponse = strategyManager.startStrategy(jfxFile, new Object[]{"param value", 1, "another param value"}).get();
if (startResponse.isError()) {
System.err.println("Strategy failed to start: " + startResponse.getErrorMessage());
} else {
myStrategyId = startResponse.getResult();
System.out.println("Strategy successfully started: " + myStrategyId);
}
strategyFile - strategy jfx file to runparams - strategy parametersFuture object for obtaining the server responsejava.io.IOException - in case of strategyFile read/load errorJFException - in case of parameter error, i.e., incorrect array size or wrong value type.Copyright © 2025. All rights reserved.