Package org.springframework.data.redis.connection

Examples of org.springframework.data.redis.connection.RedisConnectionFactory


  @Test
  public void testSession() throws Exception {
    final RedisConnection conn = mock(RedisConnection.class);
    final StringRedisConnection stringConn = mock(StringRedisConnection.class);
    RedisConnectionFactory factory = mock(RedisConnectionFactory.class);
    final StringRedisTemplate template = spy(new StringRedisTemplate(factory));
    when(factory.getConnection()).thenReturn(conn);
    doReturn(stringConn).when(template).preProcessConnection(eq(conn), anyBoolean());

    template.execute(new SessionCallback<Object>() {
      @SuppressWarnings("rawtypes")
      public Object execute(RedisOperations operations) {
View Full Code Here


   */
  public <T> T execute(RedisCallback<T> action, boolean exposeConnection, boolean pipeline) {
    Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");
    Assert.notNull(action, "Callback object must not be null");

    RedisConnectionFactory factory = getConnectionFactory();
    RedisConnection conn = null;
    try {

      if (enableTransactionSupport) {
        // only bind resources in case of potential transaction synchronization
View Full Code Here

  public <T> T execute(SessionCallback<T> session) {
    Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");
    Assert.notNull(session, "Callback object must not be null");

    RedisConnectionFactory factory = getConnectionFactory();
    // bind connection
    RedisConnectionUtils.bindConnection(factory, enableTransactionSupport);
    try {
      return session.execute(this);
    } finally {
View Full Code Here

  public List<Object> executePipelined(final SessionCallback<?> session, final RedisSerializer<?> resultSerializer) {
    Assert.isTrue(initialized, "template not initialized; call afterPropertiesSet() before using it");
    Assert.notNull(session, "Callback object must not be null");

    RedisConnectionFactory factory = getConnectionFactory();
    // bind connection
    RedisConnectionUtils.bindConnection(factory, enableTransactionSupport);
    try {
      return execute(new RedisCallback<List<Object>>() {
        public List<Object> doInRedis(RedisConnection connection) throws DataAccessException {
View Full Code Here

TOP

Related Classes of org.springframework.data.redis.connection.RedisConnectionFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.