Package org.frankframework.core
Interface IListener<M>
- Type Parameters:
M
- the raw message type
- All Superinterfaces:
org.springframework.context.ApplicationContextAware
,org.springframework.beans.factory.Aware
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
- All Known Subinterfaces:
ICorrelatedPullingListener<M>
,IKnowsDeliveryCount<M>
,IPeekableListener<M>
,IPortConnectedListener<M>
,IPostboxListener<M>
,IPullingListener<M>
,IPushingListener<M>
,IRedeliveringListener<M>
,ReceiverAware<M>
- All Known Implementing Classes:
AbstractJmsListener
,ApiListener
,FrankListener
,HttpListener
,JavaListener
,JdbcListener
,JdbcQueryListener
,JdbcTableListener
,JmsListener
,MessageStoreListener
,PullingJmsListener
,PushingJmsListener
,PushingListenerAdapter
,RestListener
,SimpleJdbcListener
,WebServiceListener
@FrankDocGroup(LISTENER)
@EnterpriseIntegrationPattern(LISTENER)
public interface IListener<M>
extends IConfigurable
Base-interface for IPullingListener and IPushingListener.
- Since:
- 4.2
- Author:
- Gerrit van Brakel
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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
configure()
is called once at startup of the framework in theconfigure()
method of the owner of this listener.extractMessage
(RawMessageWrapper<M> rawMessage, Map<String, Object> context) Extracts data from message obtained fromIPullingListener.getRawMessage(Map)
orIPushingListener.wrapRawMessage(Object, PipeLineSession)
.void
start()
Prepares the listener for receiving messages.void
stop()
Close all resources used for listening.Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
-
Method Details
-
configure
configure()
is called once at startup of the framework in theconfigure()
method of the owner of this listener. Purpose of this method is to reduce creating connections to databases etc. in theIPullingListener.getRawMessage(Map)
method. As much as possible class-instantiating should take place in theconfigure()
orstart()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Throws:
ConfigurationException
-
start
void start()Prepares the listener for receiving messages.open()
is called once each time the listener is started. -
stop
void stop()Close all resources used for listening. Called once each time the listener is stopped. -
extractMessage
Message extractMessage(@Nonnull RawMessageWrapper<M> rawMessage, @Nonnull Map<String, Object> context) throws ListenerExceptionExtracts data from message obtained fromIPullingListener.getRawMessage(Map)
orIPushingListener.wrapRawMessage(Object, PipeLineSession)
. May also extract other parameters from the message and put those into the context.- Parameters:
rawMessage
- TheRawMessageWrapper
from which to extract theMessage
.context
- Context to populate. Either aPipeLineSession
or aMap
threadContext depending on caller.- Returns:
- input
Message
for adapter. - Throws:
ListenerException
-
afterMessageProcessed
void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<M> rawMessage, PipeLineSession pipeLineSession) throws ListenerException Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.- Throws:
ListenerException
-