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:
org.springframework.messaging.support.ChannelInterceptor,org.springframework.messaging.support.ExecutorChannelInterceptor
public class SecurityContextPropagationChannelInterceptor
extends org.springframework.integration.channel.interceptor.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
- See Also:
ThreadStatePropagationChannelInterceptor
-
Constructor Summary
Constructors Constructor Description SecurityContextPropagationChannelInterceptor() -
Method Summary
Modifier and Type Method Description voidafterMessageHandled(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel, org.springframework.messaging.MessageHandler handler, java.lang.Exception ex)protected org.springframework.security.core.AuthenticationobtainPropagatingContext(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)protected voidpopulatePropagatedContext(org.springframework.security.core.Authentication authentication, org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)Methods inherited from class org.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor
beforeHandle, postReceive, preSend
-
Constructor Details
-
SecurityContextPropagationChannelInterceptor
public SecurityContextPropagationChannelInterceptor()
-
-
Method Details
-
afterMessageHandled
public void afterMessageHandled(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel, org.springframework.messaging.MessageHandler handler, java.lang.Exception ex)- Specified by:
afterMessageHandledin interfaceorg.springframework.messaging.support.ExecutorChannelInterceptor- Overrides:
afterMessageHandledin classorg.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-
obtainPropagatingContext
protected org.springframework.security.core.Authentication obtainPropagatingContext(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)- Specified by:
obtainPropagatingContextin classorg.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-
populatePropagatedContext
protected void populatePropagatedContext(org.springframework.security.core.Authentication authentication, org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)- Specified by:
populatePropagatedContextin classorg.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-