Package de.otto.synapse.journal
Class JournalingInterceptor
- java.lang.Object
-
- de.otto.synapse.journal.JournalingInterceptor
-
- All Implemented Interfaces:
MessageInterceptor
public class JournalingInterceptor extends java.lang.Object implements MessageInterceptor
-
-
Constructor Summary
Constructors Constructor Description JournalingInterceptor(java.lang.String channelName, Journal journal)Creates aJournalingInterceptorfor a channel, using the givenJournal.
-
Method Summary
Modifier and Type Method Description JournalgetJournal()TextMessageintercept(TextMessage message)Intercept a message and return the same message, a modified version of the incoming message, or null, if the message should be filtered out and dropped by theAbstractMessageEndpoint
-
-
-
Constructor Detail
-
JournalingInterceptor
public JournalingInterceptor(@Nonnull java.lang.String channelName, @Nonnull Journal journal)Creates aJournalingInterceptorfor a channel, using the givenJournal.- Parameters:
channelName- the name of the journaled channeljournal- the Journal used to record messages for the channel- Throws:
java.lang.IllegalStateException- if the Journal's MessageStore does not provide anIndex.JOURNAL_KEY
-
-
Method Detail
-
intercept
@Nonnull public TextMessage intercept(@Nonnull TextMessage message)
Description copied from interface:MessageInterceptorIntercept a message and return the same message, a modified version of the incoming message, or null, if the message should be filtered out and dropped by theAbstractMessageEndpoint- Specified by:
interceptin interfaceMessageInterceptor- Parameters:
message- the channel-layer message with payload-type beeing a String- Returns:
- intercepted version of the message, or null if the message should be dropped.
-
getJournal
public Journal getJournal()
-
-