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 MessageChannel
s 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 void
afterMessageHandled(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel, org.springframework.messaging.MessageHandler handler, java.lang.Exception ex)
protected org.springframework.security.core.Authentication
obtainPropagatingContext(org.springframework.messaging.Message<?> message, org.springframework.messaging.MessageChannel channel)
protected void
populatePropagatedContext(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:
afterMessageHandled
in interfaceorg.springframework.messaging.support.ExecutorChannelInterceptor
- Overrides:
afterMessageHandled
in 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:
obtainPropagatingContext
in 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:
populatePropagatedContext
in classorg.springframework.integration.channel.interceptor.ThreadStatePropagationChannelInterceptor<org.springframework.security.core.Authentication>
-