Modifier and Type | Field and Description |
---|---|
private ErrorHandler |
errorHandler
The listener that will be collecting error notifications.
|
private static Logger |
logger
Our class logger.
|
private MessageEventHandler |
messageEventHandler
The listener that will be retrieving MessageEvents
|
private BlockingQueue<RawMessage> |
messageQueue
The queue where we store incoming messages until they are collected.
|
private NetAccessManager |
netAccessManager
The NetAccessManager which has created this instance and which
is its owner.
|
private boolean |
running
The flag that indicates whether we are still running.
|
private Thread |
runningThread
A reference to the thread that we use to execute ourselves.
|
Constructor and Description |
---|
MessageProcessor(NetAccessManager netAccessManager)
Creates a Message processor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
isRunning()
Determines whether the processor is still running;
|
void |
run()
Does the message parsing.
|
(package private) void |
start()
Start the message processing thread.
|
(package private) void |
stop()
Shut down the message processor.
|
private static final Logger logger
private final ErrorHandler errorHandler
private final BlockingQueue<RawMessage> messageQueue
private final MessageEventHandler messageEventHandler
private final NetAccessManager netAccessManager
private boolean running
private Thread runningThread
MessageProcessor(NetAccessManager netAccessManager) throws IllegalArgumentException
netAccessManager
- the NetAccessManager which is creating
the new instance, is going to be its owner, specifies the
BlockingQueue which is to store incoming messages, specifies the
MessageEventHandler and represents the ErrorHandler to
handle exceptions in the new instanceIllegalArgumentException
- if any of the mentioned properties of
netAccessManager are nullCopyright © 2018. All rights reserved.