public interface IRemoteStrategyManager extends IStrategyManager<IRemoteStrategyDescriptor,RemoteStrategyListener>
Modifier and Type | Method and Description |
---|---|
Future<IStrategyResponse<UUID>> |
startStrategy(File strategyFile,
boolean stopOnError)
Starts a strategy with default parameters.
|
Future<IStrategyResponse<UUID>> |
startStrategy(File strategyFile,
Object[] params,
boolean stopOnError)
Starts a strategy with parameters.
|
addStrategyListener, getStartedStrategies, removeStrategyListener, stopStrategy
Future<IStrategyResponse<UUID>> startStrategy(File strategyFile, boolean stopOnError) 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, boolean stopOnError) 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.