Search in sources :

Example 1 with IntegrationProperties

use of org.springframework.integration.context.IntegrationProperties in project spring-integration by spring-projects.

the class GlobalChannelInterceptorProcessor method afterSingletonsInstantiated.

@Override
public void afterSingletonsInstantiated() {
    Collection<GlobalChannelInterceptorWrapper> interceptors = this.beanFactory.getBeansOfType(GlobalChannelInterceptorWrapper.class).values();
    if (CollectionUtils.isEmpty(interceptors)) {
        logger.debug("No global channel interceptors.");
    } else {
        for (GlobalChannelInterceptorWrapper channelInterceptor : interceptors) {
            if (channelInterceptor.getOrder() >= 0) {
                this.positiveOrderInterceptors.add(channelInterceptor);
            } else {
                this.negativeOrderInterceptors.add(channelInterceptor);
            }
        }
        Map<String, ChannelInterceptorAware> channels = this.beanFactory.getBeansOfType(ChannelInterceptorAware.class);
        for (Entry<String, ChannelInterceptorAware> entry : channels.entrySet()) {
            addMatchingInterceptors(entry.getValue(), entry.getKey());
        }
    }
    // TODO Remove this logic in 5.1
    Properties integrationProperties = IntegrationContextUtils.getIntegrationProperties(this.beanFactory);
    this.singletonsInstantiated = Boolean.parseBoolean(integrationProperties.getProperty(IntegrationProperties.POST_PROCESS_DYNAMIC_BEANS));
}
Also used : GlobalChannelInterceptorWrapper(org.springframework.integration.channel.interceptor.GlobalChannelInterceptorWrapper) Properties(java.util.Properties) IntegrationProperties(org.springframework.integration.context.IntegrationProperties) ChannelInterceptorAware(org.springframework.integration.channel.ChannelInterceptorAware)

Example 2 with IntegrationProperties

use of org.springframework.integration.context.IntegrationProperties in project spring-integration by spring-projects.

the class MessagingTemplate method sendAndReceive.

@Override
public Message<?> sendAndReceive(MessageChannel destination, Message<?> requestMessage) {
    if (!this.throwExceptionOnLateReplySet) {
        synchronized (this) {
            if (!this.throwExceptionOnLateReplySet) {
                Properties integrationProperties = IntegrationContextUtils.getIntegrationProperties(this.beanFactory);
                Boolean throwExceptionOnLateReply = Boolean.valueOf(integrationProperties.getProperty(IntegrationProperties.THROW_EXCEPTION_ON_LATE_REPLY));
                super.setThrowExceptionOnLateReply(throwExceptionOnLateReply);
                this.throwExceptionOnLateReplySet = true;
            }
        }
    }
    return super.sendAndReceive(destination, requestMessage);
}
Also used : IntegrationProperties(org.springframework.integration.context.IntegrationProperties) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)2 IntegrationProperties (org.springframework.integration.context.IntegrationProperties)2 ChannelInterceptorAware (org.springframework.integration.channel.ChannelInterceptorAware)1 GlobalChannelInterceptorWrapper (org.springframework.integration.channel.interceptor.GlobalChannelInterceptorWrapper)1