org.springframework.integration.redis.inbound
Class RedisStoreMessageSource

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.redis.inbound.RedisStoreMessageSource
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.integration.context.NamedComponent, org.springframework.integration.core.MessageSource<org.springframework.data.redis.support.collections.RedisStore>

public class RedisStoreMessageSource
extends org.springframework.integration.context.IntegrationObjectSupport
implements org.springframework.integration.core.MessageSource<org.springframework.data.redis.support.collections.RedisStore>

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

Since:
2.2

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 an instance with the 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 an instance with the 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)
           
 void afterRollback(java.lang.Object object)
           
 org.springframework.data.redis.support.collections.RedisStore getResource()
           
protected  void onInit()
           
 org.springframework.integration.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

RedisStoreMessageSource

public RedisStoreMessageSource(org.springframework.data.redis.core.RedisTemplate<java.lang.String,?> redisTemplate,
                               org.springframework.expression.Expression keyExpression)
Creates an instance with the provided 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.

Parameters:
redisTemplate -
keyExpression -

RedisStoreMessageSource

public RedisStoreMessageSource(org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory,
                               org.springframework.expression.Expression keyExpression)
Creates an instance with the provided 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 StringRedisTemplate that uses StringRedisSerializer for all serialization. The 'keyExpression' will be evaluated on every call to the receive() method.

Parameters:
connectionFactory -
keyExpression -
Method Detail

setCollectionType

public void setCollectionType(org.springframework.data.redis.support.collections.RedisCollectionFactoryBean.CollectionType collectionType)

receive

public org.springframework.integration.Message<org.springframework.data.redis.support.collections.RedisStore> receive()
Returns a Message with the view into a RedisStore identified by keyExpression

Specified by:
receive in interface org.springframework.integration.core.MessageSource<org.springframework.data.redis.support.collections.RedisStore>

onInit

protected void onInit()
               throws java.lang.Exception
Overrides:
onInit in class org.springframework.integration.context.IntegrationObjectSupport
Throws:
java.lang.Exception

getResource

public org.springframework.data.redis.support.collections.RedisStore getResource()

afterCommit

public void afterCommit(java.lang.Object object)

afterRollback

public void afterRollback(java.lang.Object object)