List of usage examples for org.springframework.core.task SimpleAsyncTaskExecutor execute
@Override public void execute(Runnable task)
From source file:to.sparks.mtgox.example.TradingBot.java
public TradingBot(SimpleAsyncTaskExecutor taskExecutor, MtGoxHTTPClient mtgoxAPI) throws Exception { this.mtgoxAPI = mtgoxAPI; this.taskExecutor = taskExecutor; AccountInfo info = mtgoxAPI.getAccountInfo(); logger.log(Level.INFO, "Logged into account: {0}", info.getLogin()); baseCurrency = mtgoxAPI.getCurrencyInfo(mtgoxAPI.getBaseCurrency()); String currencyCode = baseCurrency.getCurrency().getCurrencyCode(); logger.log(Level.INFO, "Configured base currency: {0}", currencyCode); lastTicker = mtgoxAPI.getTicker();//from www . j av a 2 s . c o m taskExecutor.execute(new Logic()); logger.info("Waiting for trade events to trigger bot activity..."); }