Java Code Examples for org.springframework.integration.expression.ExpressionUtils

The following examples show how to use org.springframework.integration.expression.ExpressionUtils. These examples are extracted from open source projects. 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
@SuppressWarnings("unchecked")
PartitionAwareFunctionWrapper(FunctionInvocationWrapper function, ConfigurableApplicationContext context, ProducerProperties producerProperties) {
	this.function = function;
	if (producerProperties != null && producerProperties.isPartitioned()) {
		StandardEvaluationContext evaluationContext = ExpressionUtils.createStandardEvaluationContext(context.getBeanFactory());
		PartitionHandler partitionHandler = new PartitionHandler(evaluationContext, producerProperties, context.getBeanFactory());

		this.outputMessageEnricher = outputMessage -> {
			int partitionId = partitionHandler.determinePartition(outputMessage);
			return MessageBuilder
				.fromMessage(outputMessage)
				.setHeader(BinderHeaders.PARTITION_HEADER, partitionId).build();
		};
	}
	else {
		this.outputMessageEnricher = null;
	}
}
 
Example 2
public MongodbProcessorConfiguration(
	MongodbProcessorProperties properties,
	ReactiveMongoOperations mongoTemplate,
	BeanFactory beanFactory
) {
	this.properties = properties;
	this.mongoTemplate = mongoTemplate;
	this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(beanFactory);
}
 
Example 3
PartitioningInterceptor(BindingProperties bindingProperties) {
	this.bindingProperties = bindingProperties;
	this.partitionHandler = new PartitionHandler(
			ExpressionUtils.createStandardEvaluationContext(
					MessageConverterConfigurer.this.beanFactory),
			this.bindingProperties.getProducer(), MessageConverterConfigurer.this.beanFactory);
}
 
Example 4
Source Project: spring-cloud-stream   Source File: AbstractBinder.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public final void afterPropertiesSet() throws Exception {
	Assert.notNull(this.applicationContext,
			"The 'applicationContext' property must not be null");
	if (this.evaluationContext == null) {
		this.evaluationContext = ExpressionUtils
				.createStandardEvaluationContext(getBeanFactory());
	}
	onInit();
}
 
Example 5
@Override
protected void onInit() throws Exception {
	super.onInit();
	this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
}
 
Example 6
Source Project: spring-cloud-gcp   Source File: PubSubMessageHandler.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected void onInit() {
	super.onInit();
	this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
}
 
Example 7
@Override
protected void doInit() {
	this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
}
 
Example 8
@PostConstruct
public void afterPropertiesSet() {
	this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(beanFactory);
}
 
Example 9
@Bean
public EvaluationContext evaluationContext() {
	return ExpressionUtils.createStandardEvaluationContext(this.beanFactory);
}
 
Example 10
@PostConstruct
public void setup() {
	this.evaluationContext = ExpressionUtils
			.createStandardEvaluationContext(this.beanFactory);
}