public abstract class AbstractBinder<T,C extends ConsumerProperties,P extends ProducerProperties> extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, Binder<T,C,P>
Binder implementations.| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractBinder.JavaClassMimeTypeConversion
Handles representing any java class as a
MimeType. |
| Modifier and Type | Field and Description |
|---|---|
protected StringConvertingContentTypeResolver |
contentTypeResolver |
protected org.apache.commons.logging.Log |
logger |
| Constructor and Description |
|---|
AbstractBinder() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
static String |
applyPrefix(String prefix,
String name)
For binder implementations that support a prefix, apply the prefix to the name.
|
Binding<T> |
bindConsumer(String name,
String group,
T target,
C properties)
Bind the target component as a message consumer to the logical entity identified by
the name.
|
Binding<T> |
bindProducer(String name,
T outboundBindTarget,
P properties)
Bind the target component as a message producer to the logical entity identified by
the name.
|
protected String |
buildPartitionRoutingExpression(String expressionRoot) |
org.springframework.retry.support.RetryTemplate |
buildRetryTemplate(ConsumerProperties properties)
Create and configure a retry template.
|
static String |
constructDLQName(String name)
For binder implementations that support dead lettering, construct the name of the
dead letter entity for the underlying pipe name.
|
protected MessageValues |
deserializePayloadIfNecessary(org.springframework.messaging.Message<?> message) |
protected MessageValues |
deserializePayloadIfNecessary(MessageValues messageValues) |
protected abstract Binding<T> |
doBindConsumer(String name,
String group,
T inputTarget,
C properties) |
protected abstract Binding<T> |
doBindProducer(String name,
T outboundBindTarget,
P properties) |
protected org.springframework.context.support.AbstractApplicationContext |
getApplicationContext() |
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory |
getBeanFactory() |
protected String |
groupedName(String name,
String group)
Construct a name comprised of the name and group.
|
protected void |
onInit()
Subclasses may implement this method to perform any necessary initialization.
|
protected MessageValues |
serializePayloadIfNecessary(org.springframework.messaging.Message<?> message) |
protected byte[] |
serializePayloadIfNecessary(Object originalPayload) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setCodec(org.springframework.integration.codec.Codec codec) |
void |
setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext) |
protected final org.apache.commons.logging.Log logger
protected final StringConvertingContentTypeResolver contentTypeResolver
public static String applyPrefix(String prefix, String name)
prefix - the prefix.name - the name.public static String constructDLQName(String name)
name - the name.protected org.springframework.context.support.AbstractApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionprotected org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
public void setCodec(org.springframework.integration.codec.Codec codec)
public void setIntegrationEvaluationContext(org.springframework.expression.EvaluationContext evaluationContext)
public final void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionprotected void onInit()
throws Exception
afterPropertiesSet() which is itself final.Exceptionpublic final Binding<T> bindConsumer(String name, String group, T target, C properties)
BinderbindConsumer in interface Binder<T,C extends ConsumerProperties,P extends ProducerProperties>name - the logical identity of the message sourcegroup - the consumer group to which this consumer belongs - subscriptions are
shared among consumers in the same group (a null or empty String, must
be treated as an anonymous group that doesn't share the subscription with any other
consumer)target - the app interface to be bound as a consumerproperties - the consumer propertiesprotected abstract Binding<T> doBindConsumer(String name, String group, T inputTarget, C properties)
public final Binding<T> bindProducer(String name, T outboundBindTarget, P properties)
BinderbindProducer in interface Binder<T,C extends ConsumerProperties,P extends ProducerProperties>name - the logical identity of the message targetoutboundBindTarget - the app interface to be bound as a producerproperties - the producer propertiesprotected abstract Binding<T> doBindProducer(String name, T outboundBindTarget, P properties)
protected final String groupedName(String name, String group)
name - the name.group - the group.protected final MessageValues serializePayloadIfNecessary(org.springframework.messaging.Message<?> message)
protected final byte[] serializePayloadIfNecessary(Object originalPayload)
protected final MessageValues deserializePayloadIfNecessary(org.springframework.messaging.Message<?> message)
protected final MessageValues deserializePayloadIfNecessary(MessageValues messageValues)
protected String buildPartitionRoutingExpression(String expressionRoot)
public org.springframework.retry.support.RetryTemplate buildRetryTemplate(ConsumerProperties properties)
properties - The properties.Copyright © 2017 Pivotal Software, Inc.. All rights reserved.