Class SecurityContextPropagationChannelInterceptor
java.lang.Object
org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
org.springframework.integration.security.channel.SecurityContextPropagationChannelInterceptor
- All Implemented Interfaces:
ChannelInterceptor,ExecutorChannelInterceptor
public class SecurityContextPropagationChannelInterceptor extends ThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
The
ExecutorChannelInterceptor
implementation responsible for
the SecurityContext propagation from one message flow's thread to another
through the MessageChannels involved in the flow.
In addition this interceptor cleans up (restores) the SecurityContext
in the containers Threads for channels like
ExecutorChannel
and QueueChannel.
- Since:
- 4.2
- Author:
- Artem Bilan, Gary Russell
- See Also:
ThreadStatePropagationChannelInterceptor
-
Constructor Summary
Constructors Constructor Description SecurityContextPropagationChannelInterceptor() -
Method Summary
Modifier and Type Method Description voidafterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex)protected org.springframework.security.core.AuthenticationobtainPropagatingContext(Message<?> message, MessageChannel channel)protected voidpopulatePropagatedContext(org.springframework.security.core.Authentication authentication, Message<?> message, MessageChannel channel)Methods inherited from class org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor
beforeHandle, postReceive, preSendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.messaging.support.ChannelInterceptor
afterReceiveCompletion, afterSendCompletion, postSend, preReceive
-
Constructor Details
-
SecurityContextPropagationChannelInterceptor
public SecurityContextPropagationChannelInterceptor()
-
-
Method Details
-
afterMessageHandled
public void afterMessageHandled(Message<?> message, MessageChannel channel, MessageHandler handler, Exception ex)- Specified by:
afterMessageHandledin interfaceExecutorChannelInterceptor- Overrides:
afterMessageHandledin classThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-
obtainPropagatingContext
protected org.springframework.security.core.Authentication obtainPropagatingContext(Message<?> message, MessageChannel channel)- Specified by:
obtainPropagatingContextin classThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-
populatePropagatedContext
protected void populatePropagatedContext(org.springframework.security.core.Authentication authentication, Message<?> message, MessageChannel channel)- Specified by:
populatePropagatedContextin classThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-