Class StockTickPersister
- java.lang.Object
-
- org.drools.examples.broker.events.StockTickPersister
-
- All Implemented Interfaces:
EventSource
public class StockTickPersister extends Object implements EventSource
A helper to save and load StockTicks
-
-
Constructor Summary
Constructors Constructor Description StockTickPersister()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Event<StockTick>getNext()booleanhasNext()StockTickload()voidopenForRead(Reader reader, long baseTimestamp)voidopenForSave(Writer writer)voidsave(StockTick tick)
-
-
-
Method Detail
-
openForSave
public void openForSave(Writer writer) throws IOException
- Throws:
IOException
-
openForRead
public void openForRead(Reader reader, long baseTimestamp) throws FileNotFoundException
- Throws:
FileNotFoundException
-
save
public void save(StockTick tick) throws IOException
- Throws:
IOException
-
load
public StockTick load() throws ParseException, IOException
- Throws:
ParseExceptionIOException
-
close
public void close() throws IOException- Throws:
IOException
-
getNext
public Event<StockTick> getNext()
- Specified by:
getNextin interfaceEventSource
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceEventSource
-
-