public abstract class AbstractMessageHandler extends java.lang.Object implements IMessageHandler
Modifier and Type | Field and Description |
---|---|
protected IFilter<IMessageAdapter> |
filter
The filter.
|
protected boolean |
realtime
The realtime flag.
|
protected boolean |
remove
Flag if should be removed.
|
protected long |
timeout
The timeout.
|
Constructor and Description |
---|
AbstractMessageHandler()
Create a new message handler.
|
AbstractMessageHandler(IFilter<IMessageAdapter> filter,
long timeout,
boolean remove,
boolean realtime)
Create a new message handler.
|
Modifier and Type | Method and Description |
---|---|
IFilter<IMessageAdapter> |
getFilter()
Get the filter.
|
long |
getTimeout()
Get the timeout.
|
abstract void |
handleMessage(java.util.Map<java.lang.String,java.lang.Object> msg,
MessageType type)
Handle the message.
|
boolean |
isRealtime()
Test if handler should be real time.
|
boolean |
isRemove()
Test if handler should be removed.
|
void |
setFilter(IFilter<IMessageAdapter> filter)
Set the filter.
|
void |
setRealtime(boolean realtime)
Set the real time.
|
void |
setRemove(boolean remove)
Set the remove.
|
void |
setTimeout(long timeout)
Set the timeout.
|
void |
timeoutOccurred()
Timeout occurred.
|
protected IFilter<IMessageAdapter> filter
protected long timeout
protected boolean remove
protected boolean realtime
public AbstractMessageHandler()
public AbstractMessageHandler(IFilter<IMessageAdapter> filter, long timeout, boolean remove, boolean realtime)
public IFilter<IMessageAdapter> getFilter()
getFilter
in interface IMessageHandler
public void setFilter(IFilter<IMessageAdapter> filter)
filter
- The filter to set.public boolean isRemove()
isRemove
in interface IMessageHandler
public void setRemove(boolean remove)
remove
- The remove to set.public long getTimeout()
getTimeout
in interface IMessageHandler
public void setTimeout(long timeout)
timeout
- The timeout to set.public boolean isRealtime()
isRealtime
in interface IMessageHandler
public void setRealtime(boolean realtime)
realtime
- The real time flag to set.public void timeoutOccurred()
timeoutOccurred
in interface IMessageHandler
public abstract void handleMessage(java.util.Map<java.lang.String,java.lang.Object> msg, MessageType type)
handleMessage
in interface IMessageHandler
msg
- The message.type
- The message type.