public interface ILocalStrategyManager extends IStrategyManager<ILocalStrategyDescriptor,LocalStrategyListener>
Modifier and Type | Method and Description |
---|---|
File |
compileStrategy(File srcFile)
Compiles a strategy .java source file to a .jfx file
|
List<IStrategyParameter> |
getDefaultParameters(File file)
Returns default strategy parameters
|
Future<IStrategyResponse<UUID>> |
startStrategy(File strategyFile)
Starts a strategy with default parameters.
|
Future<IStrategyResponse<UUID>> |
startStrategy(File strategyFile,
Object[] params)
Starts a strategy with parameters.
|
addStrategyListener, getStartedStrategies, removeStrategyListener, stopStrategy
List<IStrategyParameter> getDefaultParameters(File file) throws IOException, JFException
file
- a compiled strategy .jfx fileJFException
IOException
File compileStrategy(File srcFile)
Future<IStrategyResponse<UUID>> startStrategy(File strategyFile) throws 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 responseIOException
- in case of strategyFile read/load errorFuture<IStrategyResponse<UUID>> startStrategy(File strategyFile, Object[] params) throws IOException, JFException
// 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 responseIOException
- in case of strategyFile read/load errorJFException
- in case of parameter error, i.e., incorrect array size or wrong value type.Copyright © 2016. All rights reserved.