com.shimari.fxbot
Class TickerService

java.lang.Object
  extended bycom.shimari.fxbot.TickerService
All Implemented Interfaces:
Component, CronTask

public class TickerService
extends java.lang.Object
implements CronTask, Component

Provide notifications of ticker events


Constructor Summary
TickerService(Config config)
           
 
Method Summary
 void addListener(TickerListener l)
           
 void cron()
          This will be executed by a Cron thread, and it should be written such that it does not hang.
 long cronInterval()
          Will be called after execution, no matter whether execution terminated by exception or normal return.
 java.util.List getTicker(java.lang.Integer uid, java.lang.String symbol, int days)
           
 void init(Registry registry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TickerService

public TickerService(Config config)
              throws ConfigException
Method Detail

init

public void init(Registry registry)
          throws ConfigException
Specified by:
init in interface Component
Throws:
ConfigException

addListener

public void addListener(TickerListener l)

cron

public void cron()
          throws FXTP_Exception,
                 java.lang.InterruptedException
Description copied from interface: CronTask
This will be executed by a Cron thread, and it should be written such that it does not hang. There are only a limited number of threads available to execute tasks.

Specified by:
cron in interface CronTask
Throws:
FXTP_Exception
java.lang.InterruptedException

cronInterval

public long cronInterval()
Description copied from interface: CronTask
Will be called after execution, no matter whether execution terminated by exception or normal return. Indicates the length of time until the next execution. A return value of 0 or less means do not reschedule; a return value of 1-99 will be rewritten as 100; otherwise the task will run again in approximately that many milliseconds.

Specified by:
cronInterval in interface CronTask

getTicker

public java.util.List getTicker(java.lang.Integer uid,
                                java.lang.String symbol,
                                int days)