public abstract class MarketLoader extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Object |
completeNotification |
protected static int |
END_ROW |
protected static FileHandler |
fh |
protected static String |
file_name |
static MarketLoader |
loader |
protected static Logger |
logger |
protected static long |
PURE_DELAY |
protected static int |
RATE_PER_SECOND |
protected static int |
START_ROW |
protected static int |
START_TICK_ID |
protected static int |
TOTAL_QUOTES |
| Constructor and Description |
|---|
MarketLoader() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
easyPumpMarketChanges()
this method uses the various arguments to the main method to pump trades
through the vendorPublishingAPI
trades are read from a file and then row by row fed through the vendorPublishingAPI |
static void |
main(String[] args)
This program must be started with the following System property:
-Dvendor.classname= it will instantiate the subclass supplied by the vendor using Class.forName(System.getProperty("vendor.classname")).newInstance(); this main method expects the following arguments: -startid the starting value for the market update tick ids -startrow the row of the file from which the loader instance starts submitting xml rows to the vendorPublishingAPI -endrow the row of the file at which the loader instance stops submitting xml rows to the vendorPublishingAPI The following settings: -startrow 100 -endrow 1000 result in the loader starting to submit data at row 100 and stopping the submission of data at row 1001 (row 1000 is submitted) -rate rate / second measured of passing xml rows to the vendorPublishingAPI filename the name of the file containing the xml data The first thing the main method does is call the vendorInit(Stringt [] args) method implemented by the vendor |
protected abstract void |
vendorInit(String[] args)
to be implemented by vendor:
an init method that allows the vendor to prepare whatever is necessary to satisfy the requirements when the vendorPublishingAPI method is called |
protected abstract void |
vendorPublishingAPI(String xml)
to be implemented by vendor:
This method accepts the xml row containing a single trade as a String and does what it needs to do to cache that trade in the vendor's cache |
protected void |
waitForNotification() |
public static MarketLoader loader
protected static int START_TICK_ID
protected static String file_name
protected static int RATE_PER_SECOND
protected static long PURE_DELAY
protected static int END_ROW
protected static int START_ROW
protected static int TOTAL_QUOTES
protected static Logger logger
protected static FileHandler fh
protected Object completeNotification
public static void main(String[] args)
protected abstract void vendorInit(String[] args) throws Throwable
Throwableprotected abstract void vendorPublishingAPI(String xml) throws Throwable
Throwableprotected void easyPumpMarketChanges()
protected void waitForNotification()
throws InterruptedException
InterruptedExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.