Package org.frankframework.receivers
Class FrankListener
java.lang.Object
org.frankframework.receivers.FrankListener
- All Implemented Interfaces:
ConfigurationAware,FrankElement,HasApplicationContext,HasName,HasPhysicalDestination,IConfigurable,IListener<Message>,IPushingListener<Message>,IScopeProvider,NameAware,RequestReplyListener,ServiceClient,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@DestinationType(ADAPTER)
@Category(BASIC)
public class FrankListener
extends Object
implements RequestReplyListener, IPushingListener<Message>, HasPhysicalDestination, ServiceClient, ConfigurationAware
Listener to receive messages sent by the
See the
FrankSender, for situations where
calling an Adapter directly is not desired. This could be because message / error logging is required for messages
sent to the subadapter.
See the
FrankSender documentation for more information.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.frankframework.core.RequestReplyListener
RequestReplyListener.ExceptionHandlingMethod -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<Message> rawMessage, PipeLineSession pipeLineSession) Called to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.voidConfigure this component.extractMessage(RawMessageWrapper<Message> rawMessage, Map<String, Object> context) Extracts data from message obtained fromIPullingListener.getRawMessage(Map)orIPushingListener.wrapRawMessage(Object, PipeLineSession).static FrankListenergetListener(String name) processRequest(Message message, PipeLineSession session) Method to implement for processing a request.voidsetExceptionListener(IbisExceptionListener listener) Set a (single) listener that will be notified of any exceptions.voidName of the listener by which it can be found by theFrankSender.voidstart()Prepares the listener for receiving messages.voidstop()Close all resources used for listening.wrapRawMessage(Message rawMessage, PipeLineSession session) Wrap a raw message in a MessageWrapper.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.configuration.ConfigurationAware
setConfigurationMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.IPushingListener
setHandlerMethods inherited from interface org.frankframework.core.RequestReplyListener
getOnException, setOnException
-
Constructor Details
-
FrankListener
public FrankListener()
-
-
Method Details
-
getListener
-
getPhysicalDestinationName
- Specified by:
getPhysicalDestinationNamein interfaceHasPhysicalDestination
-
setExceptionListener
Description copied from interface:IPushingListenerSet a (single) listener that will be notified of any exceptions. The listener should use this listener to notify the receiver of any exception that occurs outside the processing of a message.- Specified by:
setExceptionListenerin interfaceIPushingListener<Message>
-
wrapRawMessage
Description copied from interface:IPushingListenerWrap a raw message in a MessageWrapper. PopulatePipeLineSessionwith properties from the message.- Specified by:
wrapRawMessagein interfaceIPushingListener<Message>- Parameters:
rawMessage- The raw message data, unwrappedsession-PipeLineSessionto populate with properties from the message.- Returns:
- Wrapped raw message
-
configure
public void configure()Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable
-
start
public void start()Description copied from interface:IListenerPrepares the listener for receiving messages.start()is called once each time the listener is started. -
stop
public void stop()Description copied from interface:IListenerClose all resources used for listening. Called once each time the listener is stopped. -
afterMessageProcessed
public void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<Message> rawMessage, PipeLineSession pipeLineSession) Description copied from interface:IListenerCalled to perform actions (like committing or sending a reply) after a message has been processed by the Pipeline.- Specified by:
afterMessageProcessedin interfaceIListener<Message>
-
extractMessage
public Message extractMessage(@Nonnull RawMessageWrapper<Message> rawMessage, @Nonnull Map<String, Object> context) Description copied from interface:IListenerExtracts 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.- Specified by:
extractMessagein interfaceIListener<Message>- Parameters:
rawMessage- TheRawMessageWrapperfrom which to extract theMessage.context- Context to populate. Either aPipeLineSessionor aMapthreadContext depending on caller.- Returns:
- input
Messagefor adapter.
-
setName
Name of the listener by which it can be found by theFrankSender. If this is not configured, the name will default to the name of theAdapter. The name of theFrankListenermust be unique across the configuration. -
processRequest
Description copied from interface:ServiceClientMethod to implement for processing a request. This will usually delegate to aIListenerimplementation.
TODO: We may want to add the correlationId parameter back to this method, for cleaner calling and cleaner implementation.- Specified by:
processRequestin interfaceServiceClient- Parameters:
message-Messageto processsession-PipeLineSessionof the request. If the request has a correlation ID, it should be put into this session.- Returns:
- Resulting
Message. - Throws:
ListenerException- Thrown if an exception occurs.
-