|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Listens for log messages to process. This is the class that does the string searches to determine that a particular message of interest has been seen. When this happens the count of the associated instrument is incremented. The message can arrive from a variety of sources such as a live feed or a replay of an existing log file. The actual source does not matter to this class. A recent change to this class has been to replace the native java string search with an MIT based BoyerMoorHorspool string search that is up to 10x faster.
Field Summary | |
---|---|
int |
counterIndex
|
HashMap |
instrumentMessageMap
|
Logger |
log
|
Properties |
messages
|
Music |
music
|
BufferedReader |
reader
|
StringSearch |
searcher
|
Statistics |
statistics
|
HashMap |
stringSearchMap
|
Constructor Summary | |
MessageReceiver()
|
Method Summary | |
---|---|
Set |
getInstrumentList()
Let other classes, like the RhythmSoundBuilder get our list of instruments |
void |
initializeMessagemap(Properties messages)
|
void |
processAMessage(String searchMe)
this takes a line of text (from wherever) and sees if it matches any of our target string. |
void |
processAMessageFaster(String searchMe)
|
void |
run()
Build the music string to send to JFugue |
void |
setMessages(Properties messages)
Injected by Spring, after music is set. |
void |
setMusic(Music music)
Used by Spring DI to tell class what the main Music object is |
void |
setReader(Reader reader)
Used by Spring DI to tell class where to get the message Reader |
void |
setStatistics(Statistics statistics)
|
void |
swapCounters()
There are two message accumulators, one is being added to and the other is being played from. |
Constructor Detail |
---|
public MessageReceiver()
Method Detail |
---|
public Set getInstrumentList()
void initializeMessagemap(Properties messages)
void processAMessage(String searchMe)
void processAMessageFaster(String searchMe)
public void run()
public void setMessages(Properties messages)
public void setMusic(Music music)
public void setReader(Reader reader)
public void setStatistics(Statistics statistics)
public void swapCounters()