public class ListenerMessageHandler<M> extends Object implements IMessageHandler<M>
Constructor and Description |
---|
ListenerMessageHandler() |
Modifier and Type | Method and Description |
---|---|
Message |
formatException(String origin,
String arg1,
Message arg2,
Throwable arg3)
Formats any exception thrown by any of the above methods to a message that can be returned.
|
ListenerMessage |
getRequestMessage()
Attempt to retrieve a
ListenerMessage . |
ListenerMessage |
getRequestMessage(long timeout)
Attempt to retrieve a
ListenerMessage with timeout in ms. |
ListenerMessage |
getResponseMessage()
Attempt to retrieve a
ListenerMessage . |
ListenerMessage |
getResponseMessage(long timeout)
Attempt to retrieve a
ListenerMessage with timeout in ms. |
void |
processRawMessage(IListener<M> origin,
M rawMessage)
Same as
IMessageHandler.processRawMessage(IListener,Object,PipeLineSession, boolean) , but now without context, for convenience |
void |
processRawMessage(IListener<M> origin,
M rawMessage,
PipeLineSession threadContext,
boolean duplicatesAlreadyChecked)
Will use listener to perform getIdFromRawMessage(), getStringFromRawMessage and afterMessageProcessed
|
void |
processRawMessage(IListener<M> origin,
M rawMessage,
PipeLineSession threadContext,
long waitingTime,
boolean duplicatesAlreadyChecked)
Same as
IMessageHandler.processRawMessage(IListener,Object,PipeLineSession, boolean) , but now updates IdleStatistics too |
Message |
processRequest(IListener<M> origin,
M rawMessage,
Message message,
PipeLineSession session)
Alternative to functions above, will NOT use getIdFromRawMessage() and getStringFromRawMessage().
|
void |
putResponseMessage(ListenerMessage listenerMessage) |
void |
setRequestTimeOut(int timeout) |
void |
setResponseTimeOut(int timeout) |
void |
setTimeout(long defaultTimeout) |
public Message processRequest(IListener<M> origin, M rawMessage, Message message, PipeLineSession session) throws ListenerException
IMessageHandler
processRequest
in interface IMessageHandler<M>
ListenerException
public ListenerMessage getRequestMessage()
ListenerMessage
. Returns NULL if none is presentpublic ListenerMessage getRequestMessage(long timeout) throws TimeoutException
ListenerMessage
with timeout in ms. Returns TimeOutException if non is presentTimeoutException
public ListenerMessage getResponseMessage()
ListenerMessage
. Returns NULL if none is presentpublic ListenerMessage getResponseMessage(long timeout) throws TimeoutException
ListenerMessage
with timeout in ms. Returns TimeOutException if non is presentTimeoutException
public void putResponseMessage(ListenerMessage listenerMessage)
public void setTimeout(long defaultTimeout)
public void setRequestTimeOut(int timeout)
public void setResponseTimeOut(int timeout)
public void processRawMessage(IListener<M> origin, M rawMessage) throws ListenerException
IMessageHandler
IMessageHandler.processRawMessage(IListener,Object,PipeLineSession, boolean)
, but now without context, for convenienceprocessRawMessage
in interface IMessageHandler<M>
ListenerException
public void processRawMessage(IListener<M> origin, M rawMessage, PipeLineSession threadContext, boolean duplicatesAlreadyChecked) throws ListenerException
IMessageHandler
processRawMessage
in interface IMessageHandler<M>
ListenerException
public void processRawMessage(IListener<M> origin, M rawMessage, PipeLineSession threadContext, long waitingTime, boolean duplicatesAlreadyChecked) throws ListenerException
IMessageHandler
IMessageHandler.processRawMessage(IListener,Object,PipeLineSession, boolean)
, but now updates IdleStatistics tooprocessRawMessage
in interface IMessageHandler<M>
ListenerException
public Message formatException(String origin, String arg1, Message arg2, Throwable arg3)
IMessageHandler
formatException
in interface IMessageHandler<M>
Copyright © 2023 Frank!Framework. All rights reserved.