org.springframework.messaging.support.AbstractMessageChannel Java Examples

The following examples show how to use org.springframework.messaging.support.AbstractMessageChannel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StompSubProtocolHandler.java    From spring-analysis-note with MIT License 6 votes vote down vote up
private boolean detectImmutableMessageInterceptor(MessageChannel channel) {
	if (this.immutableMessageInterceptorPresent != null) {
		return this.immutableMessageInterceptorPresent;
	}

	if (channel instanceof AbstractMessageChannel) {
		for (ChannelInterceptor interceptor : ((AbstractMessageChannel) channel).getInterceptors()) {
			if (interceptor instanceof ImmutableMessageChannelInterceptor) {
				this.immutableMessageInterceptorPresent = true;
				return true;
			}
		}
	}
	this.immutableMessageInterceptorPresent = false;
	return false;
}
 
Example #2
Source File: StompSubProtocolHandler.java    From java-technology-stack with MIT License 6 votes vote down vote up
private boolean detectImmutableMessageInterceptor(MessageChannel channel) {
	if (this.immutableMessageInterceptorPresent != null) {
		return this.immutableMessageInterceptorPresent;
	}

	if (channel instanceof AbstractMessageChannel) {
		for (ChannelInterceptor interceptor : ((AbstractMessageChannel) channel).getInterceptors()) {
			if (interceptor instanceof ImmutableMessageChannelInterceptor) {
				this.immutableMessageInterceptorPresent = true;
				return true;
			}
		}
	}
	this.immutableMessageInterceptorPresent = false;
	return false;
}
 
Example #3
Source File: SpringWebSocketAgentIntercept.java    From java-specialagent with Apache License 2.0 6 votes vote down vote up
public static void messageChannelSend(final Object thiz) {
  final AbstractMessageChannel channel = (AbstractMessageChannel)thiz;
  for (final ChannelInterceptor interceptor : channel.getInterceptors())
    if (interceptor instanceof TracingChannelInterceptor)
      return;

  final TracingChannelInterceptor tracingChannelInterceptor;
  if (channel.getBeanName().equals("clientOutboundChannel"))
    tracingChannelInterceptor = new TracingChannelInterceptor(GlobalTracer.get(), Tags.SPAN_KIND_CLIENT);
  else if (channel.getBeanName().equals("clientInboundChannel"))
    tracingChannelInterceptor = new TracingChannelInterceptor(GlobalTracer.get(), Tags.SPAN_KIND_SERVER);
  else
    return;

  channel.addInterceptor(tracingChannelInterceptor);
}
 
Example #4
Source File: StompSubProtocolHandler.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
private boolean detectImmutableMessageInterceptor(MessageChannel channel) {
	if (this.immutableMessageInterceptorPresent != null) {
		return this.immutableMessageInterceptorPresent;
	}

	if (channel instanceof AbstractMessageChannel) {
		for (ChannelInterceptor interceptor : ((AbstractMessageChannel) channel).getInterceptors()) {
			if (interceptor instanceof ImmutableMessageChannelInterceptor) {
				this.immutableMessageInterceptorPresent = true;
				return true;
			}
		}
	}
	this.immutableMessageInterceptorPresent = false;
	return false;
}