本文整理汇总了Java中org.springframework.integration.channel.AbstractMessageChannel类的典型用法代码示例。如果您正苦于以下问题:Java AbstractMessageChannel类的具体用法?Java AbstractMessageChannel怎么用?Java AbstractMessageChannel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractMessageChannel类属于org.springframework.integration.channel包,在下文中一共展示了AbstractMessageChannel类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getChannelName
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
String getChannelName(MessageChannel channel) {
String name = null;
if (ClassUtils.isPresent(
"org.springframework.integration.context.IntegrationObjectSupport",
null)) {
if (channel instanceof IntegrationObjectSupport) {
name = ((IntegrationObjectSupport) channel).getComponentName();
}
if (name == null && channel instanceof AbstractMessageChannel) {
name = ((AbstractMessageChannel) channel).getFullChannelName();
}
}
if (name == null) {
name = channel.toString();
}
return name;
}
开发者ID:reshmik,项目名称:Zipkin,代码行数:18,代码来源:AbstractTraceChannelInterceptor.java
示例2: configureMessageChannel
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
/**
* Setup data-type and message converters for the given message channel.
*
* @param channel message channel to set the data-type and message converters
* @param channelName the channel name
* @param inbound inbound (i.e., "input") or outbound channel
*/
private void configureMessageChannel(MessageChannel channel, String channelName, boolean inbound) {
Assert.isAssignable(AbstractMessageChannel.class, channel.getClass());
AbstractMessageChannel messageChannel = (AbstractMessageChannel) channel;
BindingProperties bindingProperties = this.bindingServiceProperties.getBindingProperties(channelName);
String contentType = bindingProperties.getContentType();
ProducerProperties producerProperties = bindingProperties.getProducer();
if (!inbound && producerProperties != null && producerProperties.isPartitioned()) {
messageChannel.addInterceptor(new PartitioningInterceptor(bindingProperties,
getPartitionKeyExtractorStrategy(producerProperties),
getPartitionSelectorStrategy(producerProperties)));
}
ConsumerProperties consumerProperties = bindingProperties.getConsumer();
if (this.isNativeEncodingNotSet(producerProperties, consumerProperties, inbound)) {
if (inbound) {
messageChannel.addInterceptor(new InboundContentTypeConvertingInterceptor(contentType, this.compositeMessageConverterFactory));
}
else {
messageChannel.addInterceptor(new OutboundContentTypeConvertingInterceptor(contentType, this.compositeMessageConverterFactory
.getMessageConverterForAllRegistered()));
}
}
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:31,代码来源:MessageConverterConfigurer.java
示例3: postProcessOutputChannel
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Override
protected void postProcessOutputChannel(MessageChannel outputChannel,
ExtendedProducerProperties<RabbitProducerProperties> producerProperties) {
RabbitProducerProperties extendedProperties = producerProperties.getExtension();
if (expressionInterceptorNeeded(extendedProperties)) {
((AbstractMessageChannel) outputChannel).addInterceptor(0,
new RabbitExpressionEvaluatingInterceptor(extendedProperties.getRoutingKeyExpression(),
extendedProperties.getDelayExpression(), getEvaluationContext()));
}
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream-binder-rabbit,代码行数:11,代码来源:RabbitMessageChannelBinder.java
示例4: provisionDestination
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
private SubscribableChannel provisionDestination(String name, boolean pubSub) {
String destinationName = name + ".destination";
SubscribableChannel destination = this.provisionedDestinations.get(destinationName);
if (destination == null) {
destination = pubSub ? new PublishSubscribeChannel() : new DirectChannel();
((AbstractMessageChannel)destination).setBeanName(destinationName);
((AbstractMessageChannel)destination).setComponentName(destinationName);
this.provisionedDestinations.put(destinationName, destination);
}
return destination;
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:12,代码来源:SpringIntegrationProvisioner.java
示例5: register
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
private BlockingQueue<Message<?>> register(MessageChannel channel, boolean useNativeEncoding) {
// we need to add this interceptor to ensure MessageCollector's compatibility with
// previous versions of SCSt when native encoding is disabled.
if (!useNativeEncoding) {
((AbstractMessageChannel) channel).addInterceptor(new InboundMessageConvertingInterceptor());
}
LinkedBlockingDeque<Message<?>> result = new LinkedBlockingDeque<>();
Assert.isTrue(!results.containsKey(channel), "Channel [" + channel + "] was already bound");
results.put(channel, result);
return result;
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:12,代码来源:TestSupportBinder.java
示例6: enhanceMessageChannel
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
private void enhanceMessageChannel(MessageChannel inputChannel) {
((AbstractMessageChannel) inputChannel).addInterceptor(0, this.embeddedHeadersChannelInterceptor);
}
开发者ID:spring-cloud,项目名称:spring-cloud-stream,代码行数:4,代码来源:AbstractMessageChannelBinder.java
示例7: testSqsInboundChannelAdapterParser
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Test
public void testSqsInboundChannelAdapterParser() throws Exception {
setUp("SqsInboundChannelAdapterParserTests.xml", getClass(),
"sqsInboundChannelAdapter");
final AbstractMessageChannel outputChannel = TestUtils
.getPropertyValue(this.consumer, "outputChannel",
AbstractMessageChannel.class);
assertEquals("out", outputChannel.getComponentName());
final SqsExecutor sqsExecutor = TestUtils.getPropertyValue(
this.consumer, "sqsExecutor", SqsExecutor.class);
assertNotNull(sqsExecutor);
final String queueNameProperty = TestUtils.getPropertyValue(
sqsExecutor, "queueName", String.class);
assertEquals("testQueue", queueNameProperty);
}
开发者ID:3pillarlabs,项目名称:spring-integration-aws,代码行数:24,代码来源:SqsInboundChannelAdapterParserTests.java
示例8: testSqsMessageHandlerParser
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Test
public void testSqsMessageHandlerParser() throws Exception {
setUp("SqsMessageHandlerParserTests.xml", getClass());
final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(
this.consumer, "inputChannel", AbstractMessageChannel.class);
assertEquals("target", inputChannel.getComponentName());
final SqsExecutor sqsExecutor = TestUtils.getPropertyValue(
this.consumer, "handler.sqsExecutor", SqsExecutor.class);
assertNotNull(sqsExecutor);
final String queueNameProperty = TestUtils.getPropertyValue(
sqsExecutor, "queueName", String.class);
assertEquals("testQueue", queueNameProperty);
}
开发者ID:3pillarlabs,项目名称:spring-integration-aws,代码行数:21,代码来源:SqsMessageHandlerParserTests.java
示例9: testSnsMessageHandlerParser
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Test
public void testSnsMessageHandlerParser() throws Exception {
context = new ClassPathXmlApplicationContext(
"SnsMessageHandlerParserTests.xml", getClass());
EventDrivenConsumer consumer = context.getBean(
"snsOutboundChannelAdapter", EventDrivenConsumer.class);
final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(
consumer, "inputChannel", AbstractMessageChannel.class);
assertEquals("target", inputChannel.getComponentName());
final SnsExecutor snsExecutor = TestUtils.getPropertyValue(consumer,
"handler.snsExecutor", SnsExecutor.class);
assertNotNull(snsExecutor);
final String topicNameProperty = TestUtils.getPropertyValue(
snsExecutor, "topicName", String.class);
assertEquals("testTopic", topicNameProperty);
}
开发者ID:3pillarlabs,项目名称:spring-integration-aws,代码行数:25,代码来源:SnsMessageHandlerParserTests.java
示例10: testSnsInboundChannelAdapterParser
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Test
public void testSnsInboundChannelAdapterParser() throws Exception {
setUp("SnsInboundChannelAdapterParserTests.xml", getClass(),
"snsInboundChannelAdapter");
final AbstractMessageChannel outputChannel = TestUtils
.getPropertyValue(this.producer, "outputChannel",
AbstractMessageChannel.class);
assertEquals("out", outputChannel.getComponentName());
final SnsExecutor snsExecutor = TestUtils.getPropertyValue(
this.producer, "snsExecutor", SnsExecutor.class);
assertNotNull(snsExecutor);
final String topicNameProperty = TestUtils.getPropertyValue(
snsExecutor, "topicName", String.class);
assertEquals("testTopic", topicNameProperty);
}
开发者ID:3pillarlabs,项目名称:spring-integration-aws,代码行数:24,代码来源:SnsInboundChannelAdapterParserTests.java
示例11: testRetrievingSqsOutboundGatewayParser
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Test
public void testRetrievingSqsOutboundGatewayParser() throws Exception {
setUp("SqsOutboundGatewayParserTests.xml", getClass(),
"sqsOutboundGateway");
final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(
this.consumer, "inputChannel", AbstractMessageChannel.class);
assertEquals("in", inputChannel.getComponentName());
final SqsOutboundGateway sqsOutboundGateway = TestUtils
.getPropertyValue(this.consumer, "handler",
SqsOutboundGateway.class);
long sendTimeout = TestUtils.getPropertyValue(sqsOutboundGateway,
"messagingTemplate.sendTimeout", Long.class);
assertEquals(100, sendTimeout);
final SqsExecutor sqsExecutor = TestUtils.getPropertyValue(
this.consumer, "handler.sqsExecutor", SqsExecutor.class);
assertNotNull(sqsExecutor);
final String queueNameProperty = TestUtils.getPropertyValue(
sqsExecutor, "queueName", String.class);
assertEquals("testQueue", queueNameProperty);
}
开发者ID:3pillarlabs,项目名称:spring-integration-aws,代码行数:31,代码来源:SqsOutboundGatewayParserTests.java
示例12: testSnsOutboundGatewayParser
import org.springframework.integration.channel.AbstractMessageChannel; //导入依赖的package包/类
@Test
public void testSnsOutboundGatewayParser() throws Exception {
setUp("SnsOutboundGatewayParserTests.xml", getClass(),
"snsOutboundGateway");
final AbstractMessageChannel inputChannel = TestUtils.getPropertyValue(
this.consumer, "inputChannel", AbstractMessageChannel.class);
assertEquals("in", inputChannel.getComponentName());
final SnsOutboundGateway snsOutboundGateway = TestUtils
.getPropertyValue(this.consumer, "handler",
SnsOutboundGateway.class);
long sendTimeout = TestUtils.getPropertyValue(snsOutboundGateway,
"messagingTemplate.sendTimeout", Long.class);
assertEquals(100, sendTimeout);
final SnsExecutor snsExecutor = TestUtils.getPropertyValue(
this.consumer, "handler.snsExecutor", SnsExecutor.class);
assertNotNull(snsExecutor);
final String topicNameProperty = TestUtils.getPropertyValue(
snsExecutor, "topicName", String.class);
assertEquals("testTopic", topicNameProperty);
}
开发者ID:3pillarlabs,项目名称:spring-integration-aws,代码行数:31,代码来源:SnsOutboundGatewayParserTests.java
注:本文中的org.springframework.integration.channel.AbstractMessageChannel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论