M
- the raw message type@FrankDocGroup(order=30, name="Listeners") public interface IListener<M> extends IConfigurable
Modifier and Type | Method and Description |
---|---|
void |
afterMessageProcessed(PipeLineResult processResult,
RawMessageWrapper<M> rawMessage,
PipeLineSession pipeLineSession)
Called to perform actions (like committing or sending a reply) after a message has been processed by the
Pipeline.
|
void |
close()
Close all resources used for listening.
|
void |
configure()
configure() is called once at startup of the framework in the configure() method
of the owner of this listener. |
Message |
extractMessage(RawMessageWrapper<M> rawMessage,
Map<String,Object> context)
Extracts data from message obtained from
IPullingListener.getRawMessage(Map) or
IPushingListener.wrapRawMessage(Object, PipeLineSession) . |
void |
open()
Prepares the listener for receiving messages.
|
getName, setName
getApplicationContext, getName
getConfigurationClassLoader
void configure() throws ConfigurationException
configure()
is called once at startup of the framework in the configure()
method
of the owner of this listener.
Purpose of this method is to reduce creating connections to databases etc. in the IPullingListener.getRawMessage(Map)
method.
As much as possible class-instantiating should take place in the
configure()
or open()
method, to improve performance.configure
in interface IConfigurable
ConfigurationException
void open() throws ListenerException
open()
is called once each time the listener is started.ListenerException
void close() throws ListenerException
ListenerException
Message extractMessage(@Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Map<String,Object> context) throws ListenerException
IPullingListener.getRawMessage(Map)
or
IPushingListener.wrapRawMessage(Object, PipeLineSession)
. May also extract
other parameters from the message and put those into the context.rawMessage
- The RawMessageWrapper
from which to extract the Message
.context
- Context to populate. Either a PipeLineSession
or a Map
threadContext depending on caller.Message
for adapter.ListenerException
void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<M> rawMessage, PipeLineSession pipeLineSession) throws ListenerException
ListenerException
Copyright © 2023 Frank!Framework. All rights reserved.