public abstract class PushingListenerAdapter extends Object implements IPushingListener<Message>, ServiceClient
IPushingListener
that enables a Receiver
to receive messages from Servlets.
Modifier and Type | Field and Description |
---|---|
protected org.apache.logging.log4j.Logger |
log |
Constructor and Description |
---|
PushingListenerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
afterMessageProcessed(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.
|
void |
close()
Close all resources used for listening.
|
void |
configure()
initialize listener and register
this to the JNDI |
Message |
extractMessage(RawMessageWrapper<Message> 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.
|
Message |
processRequest(Message rawMessage,
PipeLineSession session)
Method to implement for processing a request.
|
void |
setApplicationFaultsAsExceptions(boolean b) |
void |
setExceptionListener(IbisExceptionListener exceptionListener)
Set a (single) listener that will be notified of any exceptions.
|
void |
setHandler(IMessageHandler<Message> handler)
Set the handler that will do the processing of the message.
|
void |
setName(String name)
Name of the listener as known to the adapter
|
void |
setRunning(boolean running) |
String |
toString() |
RawMessageWrapper<Message> |
wrapRawMessage(Message rawMessage,
PipeLineSession session)
Wrap a raw message in a MessageWrapper.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
getApplicationContext, getName
getConfigurationClassLoader
public void configure() throws ConfigurationException
this
to the JNDIconfigure
in interface IConfigurable
configure
in interface IListener<Message>
ConfigurationException
public void open() throws ListenerException
IListener
open()
is called once each time the listener is started.open
in interface IListener<Message>
ListenerException
public void close()
IListener
public RawMessageWrapper<Message> wrapRawMessage(Message rawMessage, PipeLineSession session)
IPushingListener
PipeLineSession
with properties
from the message.wrapRawMessage
in interface IPushingListener<Message>
rawMessage
- The raw message data, unwrappedsession
- PipeLineSession
to populate with properties from the message.public Message extractMessage(@Nonnull RawMessageWrapper<Message> rawMessage, @Nonnull Map<String,Object> context)
IListener
IPullingListener.getRawMessage(Map)
or
IPushingListener.wrapRawMessage(Object, PipeLineSession)
. May also extract
other parameters from the message and put those into the context.extractMessage
in interface IListener<Message>
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.public void afterMessageProcessed(PipeLineResult processResult, RawMessageWrapper<Message> rawMessage, PipeLineSession pipeLineSession) throws ListenerException
IListener
afterMessageProcessed
in interface IListener<Message>
ListenerException
public Message processRequest(Message rawMessage, PipeLineSession session) throws ListenerException
ServiceClient
IListener
implementation.
processRequest
in interface ServiceClient
rawMessage
- Message
to processsession
- PipeLineSession
of the request. If the request has a correlation ID, it should be put into this session.Message
.ListenerException
- Thrown if an exception occurs.public void setName(String name)
setName
in interface INamedObject
public void setHandler(IMessageHandler<Message> handler)
IPushingListener
setHandler
in interface IPushingListener<Message>
public void setExceptionListener(IbisExceptionListener exceptionListener)
IPushingListener
setExceptionListener
in interface IPushingListener<Message>
public void setApplicationFaultsAsExceptions(boolean b)
@Protected public void setRunning(boolean running)
Copyright © 2023 Frank!Framework. All rights reserved.