public interface IRemoteStrategyManager extends IStrategyManager<IRemoteStrategyDescriptor,RemoteStrategyListener>
Modifier and Type | Method and Description |
---|---|
java.util.concurrent.Future<IStrategyResponse<java.util.UUID>> |
startStrategy(java.io.File strategyFile,
boolean stopOnError)
Starts a strategy with default parameters.
|
java.util.concurrent.Future<IStrategyResponse<java.util.UUID>> |
startStrategy(java.io.File strategyFile,
java.lang.Object[] params,
boolean stopOnError)
Starts a strategy with parameters.
|
addStrategyListener, getStartedStrategies, removeStrategyListener, stopStrategy
java.util.concurrent.Future<IStrategyResponse<java.util.UUID>> startStrategy(java.io.File strategyFile, boolean stopOnError) 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 runstopOnError
- stop strategy on errorFuture
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, boolean stopOnError) 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 parametersstopOnError
- stop strategy on errorFuture
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 © 2024. All rights reserved.