Package org.frankframework.http
Class PushingListenerAdapter
java.lang.Object
org.frankframework.http.PushingListenerAdapter
- All Implemented Interfaces:
FrankElement,HasApplicationContext,HasName,IConfigurable,IListener<Message>,IPushingListener<Message>,IScopeProvider,NameAware,RequestReplyListener,ServiceClient,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
ApiListener,CmisEventListener,RestListener,WebServiceListener
public class PushingListenerAdapter
extends Object
implements RequestReplyListener, IPushingListener<Message>, ServiceClient
Baseclass of a
IPushingListener that enables a Receiver
to receive messages from Servlets.- Since:
- 4.12
- Author:
- Gerrit van Brakel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.frankframework.core.RequestReplyListener
RequestReplyListener.ExceptionHandlingMethod -
Field Summary
Fields -
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.voidinitialize listener and registerthisto the JNDIextractMessage(RawMessageWrapper<Message> rawMessage, Map<String, Object> context) Extracts data from message obtained fromIPullingListener.getRawMessage(Map)orIPushingListener.wrapRawMessage(Object, PipeLineSession).processRequest(Message rawMessage, PipeLineSession session) Method to implement for processing a request.voidsetApplicationFaultsAsExceptions(boolean applicationFaultsAsExceptions) Deprecated.voidsetExceptionListener(IbisExceptionListener exceptionListener) Set a (single) listener that will be notified of any exceptions.voidsetHandler(IMessageHandler<Message> handler) Set the handler that will do the processing of the message.voidName of the listener as known to the adaptervoidsetRunning(boolean running) voidstart()Prepares the listener for receiving messages.voidstop()Close all resources used for listening.toString()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, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.core.RequestReplyListener
getOnException, setOnException
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
PushingListenerAdapter
public PushingListenerAdapter()
-
-
Method Details
-
configure
initialize listener and registerthisto the JNDI- Specified by:
configurein interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-
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. -
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
-
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.
-
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>
-
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:
rawMessage-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.
-
toString
-
setName
Name of the listener as known to the adapter -
setHandler
Description copied from interface:IPushingListenerSet the handler that will do the processing of the message. Each of the received messages must be pushed through handler.processMessage()- Specified by:
setHandlerin interfaceIPushingListener<Message>
-
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>
-
setApplicationFaultsAsExceptions
@Deprecated(since="9.2") @ConfigurationWarning("Replaced with \'exceptionHandlingMethod\'") public void setApplicationFaultsAsExceptions(boolean applicationFaultsAsExceptions) Deprecated. -
setRunning
-