|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.redis.inbound.RedisStoreMessageSource
public class RedisStoreMessageSource
Inbound channel adapter which returns a Message representing a view into
a Redis store. The type of store depends on the collectionType attribute.
Default is LIST. This adapter supports 5 types of collections identified by
RedisCollectionFactoryBean.CollectionType
| Field Summary |
|---|
| Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
RedisStoreMessageSource(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.expression.Expression keyExpression)
Creates this instance with provided RedisConnectionFactory and SpEL expression
which should resolve to a 'key' name of the collection to be used. |
|
RedisStoreMessageSource(org.springframework.data.redis.core.RedisTemplate<java.lang.String,?> redisTemplate,
org.springframework.expression.Expression keyExpression)
Creates this instance with provided RedisTemplate and SpEL expression
which should resolve to a 'key' name of the collection to be used. |
|
| Method Summary | |
|---|---|
void |
afterCommit(java.lang.Object object)
Invoked via TransactionSynchronization when the
transaction commits. |
void |
afterReceiveNoTx(org.springframework.data.redis.support.collections.RedisStore resource)
Called when there is no transaction and the receive() call completed. |
void |
afterRollback(java.lang.Object object)
Invoked via TransactionSynchronization when the
transaction rolls back. |
void |
afterSendNoTx(org.springframework.data.redis.support.collections.RedisStore resource)
Called when there is no transaction and after the message was sent to the channel. |
org.springframework.data.redis.support.collections.RedisStore |
getResource()
Obtain the resource on which appropriate action needs to be taken. |
protected void |
onInit()
Subclasses may implement this for initialization logic. |
Message<org.springframework.data.redis.support.collections.RedisStore> |
receive()
Returns a Message with the view into a RedisStore identified
by keyExpression |
void |
setCollectionType(org.springframework.data.redis.support.collections.RedisCollectionFactoryBean.CollectionType collectionType)
|
| Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
|---|
afterPropertiesSet, getBeanFactory, getComponentName, getComponentType, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RedisStoreMessageSource(org.springframework.data.redis.core.RedisTemplate<java.lang.String,?> redisTemplate,
org.springframework.expression.Expression keyExpression)
RedisTemplate and SpEL expression
which should resolve to a 'key' name of the collection to be used.
It assumes that RedisTemplate is fully initialized and ready to be used.
The 'keyExpression' will be evaluated on every call to the receive() method.
redisTemplate - keyExpression -
public RedisStoreMessageSource(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
org.springframework.expression.Expression keyExpression)
RedisConnectionFactory and SpEL expression
which should resolve to a 'key' name of the collection to be used.
It will create and initialize an instance of the RedisTemplate using
StringRedisSerializer as key serializer and JdkSerializationRedisSerializer for
value, hashKey and hashValue serializer.
The 'keyExpression' will be evaluated on every call to the receive() method.
connectionFactory - keyExpression - | Method Detail |
|---|
public void setCollectionType(org.springframework.data.redis.support.collections.RedisCollectionFactoryBean.CollectionType collectionType)
public Message<org.springframework.data.redis.support.collections.RedisStore> receive()
RedisStore identified
by keyExpression
receive in interface MessageSource<org.springframework.data.redis.support.collections.RedisStore>
protected void onInit()
throws java.lang.Exception
IntegrationObjectSupport
onInit in class IntegrationObjectSupportjava.lang.Exceptionpublic org.springframework.data.redis.support.collections.RedisStore getResource()
PseudoTransactionalMessageSource
getResource in interface PseudoTransactionalMessageSource<org.springframework.data.redis.support.collections.RedisStore,org.springframework.data.redis.support.collections.RedisStore>public void afterCommit(java.lang.Object object)
PseudoTransactionalMessageSourceTransactionSynchronization when the
transaction commits.
afterCommit in interface PseudoTransactionalMessageSource<org.springframework.data.redis.support.collections.RedisStore,org.springframework.data.redis.support.collections.RedisStore>object - The resource to be "committed"public void afterRollback(java.lang.Object object)
PseudoTransactionalMessageSourceTransactionSynchronization when the
transaction rolls back.
afterRollback in interface PseudoTransactionalMessageSource<org.springframework.data.redis.support.collections.RedisStore,org.springframework.data.redis.support.collections.RedisStore>public void afterReceiveNoTx(org.springframework.data.redis.support.collections.RedisStore resource)
PseudoTransactionalMessageSource
afterReceiveNoTx in interface PseudoTransactionalMessageSource<org.springframework.data.redis.support.collections.RedisStore,org.springframework.data.redis.support.collections.RedisStore>public void afterSendNoTx(org.springframework.data.redis.support.collections.RedisStore resource)
PseudoTransactionalMessageSource
afterSendNoTx in interface PseudoTransactionalMessageSource<org.springframework.data.redis.support.collections.RedisStore,org.springframework.data.redis.support.collections.RedisStore>
|
Spring Integration | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||