Examples of RequestCache


Examples of org.enhydra.jdbc.util.RequestCache

    }
  }

        public void close() throws SQLException {
         if (statement != null) {
              RequestCache uc = RequestCache.getInstance();
        if (! uc.isInCache(theQuery)) {
      statement.close();
        }
    }
  }
View Full Code Here

Examples of org.enhydra.jdbc.util.RequestCache

    try {

        // si dans le cache, on renvoie le resultset
        //        log.debug("CoreStatement:executeQuery");
        // sinon on cree le statement
        RequestCache uc = RequestCache.getInstance();
        ResultSet rset = null;
        theQuery = s;
        if (uc.isInCache(s)) {
      rset = (ResultSet) (uc.getResult(s));
      rset.beforeFirst();
      inCache = true;
        } else {
      String rsql = uc.getSqlPattern(s);
      rset = statement.executeQuery(s);
         
      if (rsql != null) {
          // we need to cache the ResultSet object
          uc.setResult(rsql, rset);
          uc.setLink(s, rsql);
          inCache = true;
      } else {
          // sql request is not a cacheable request :-(
          uc.setLink(s, "null");
      }
        }
       
        return rset;
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

                }
                http.setSharedObject(SecurityContextRepository.class, httpSecurityRepository);
            }
        }

        RequestCache requestCache = http.getSharedObject(RequestCache.class);
        if(requestCache == null) {
            if(stateless) {
                http.setSharedObject(RequestCache.class, new NullRequestCache());
            }
        }
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

        http.setSharedObject(RequestCache.class, getRequestCache(http));
    }

    @Override
    public void configure(H http) throws Exception {
        RequestCache requestCache = getRequestCache(http);
        RequestCacheAwareFilter requestCacheFilter = new RequestCacheAwareFilter(requestCache);
        requestCacheFilter = postProcess(requestCacheFilter);
        http.addFilter(requestCacheFilter);
    }
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        HttpSessionRequestCache defaultCache = new HttpSessionRequestCache();
        defaultCache.setRequestMatcher(createDefaultSavedRequestMatcher(http));
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

    @Test
    public void onAuthenticationSuccessHasSavedRequest() throws Exception {
        String redirectUrl = "http://localhost/appcontext/page";
        RedirectStrategy redirectStrategy = mock(RedirectStrategy.class);
        RequestCache requestCache = mock(RequestCache.class);
        SavedRequest savedRequest = mock(SavedRequest.class);
        MockHttpServletRequest request = new MockHttpServletRequest();
        MockHttpServletResponse response = new MockHttpServletResponse();
        when(savedRequest.getRedirectUrl()).thenReturn(redirectUrl);
        when(requestCache.getRequest(request, response)).thenReturn(savedRequest);

        SavedRequestAwareAuthenticationSuccessHandler handler = new SavedRequestAwareAuthenticationSuccessHandler();
        handler.setRequestCache(requestCache);
        handler.setRedirectStrategy(redirectStrategy);
        handler.onAuthenticationSuccess(request, response, mock(Authentication.class));
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

                httpSecurityRepository.setAllowSessionCreation(isAllowSessionCreation());
                builder.setSharedObject(SecurityContextRepository.class, httpSecurityRepository);
            }
        }

        RequestCache requestCache = builder.getSharedObject(RequestCache.class);
        if(requestCache == null) {
            if(stateless) {
                builder.setSharedObject(RequestCache.class, new NullRequestCache());
            }
        }
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

        return this;
    }

    @Override
    public void configure(H http) throws Exception {
        RequestCache requestCache = getRequestCache(http);
        RequestCacheAwareFilter requestCacheFilter = new RequestCacheAwareFilter(requestCache);
        requestCacheFilter = postProcess(requestCacheFilter);
        http.addFilter(requestCacheFilter);
    }
View Full Code Here

Examples of org.springframework.security.web.savedrequest.RequestCache

     *
     * @param http the {@link HttpSecurity} to attempt to fined the shared object
     * @return the {@link RequestCache} to use
     */
    private RequestCache getRequestCache(H http) {
        RequestCache result = http.getSharedObject(RequestCache.class);
        if(result != null) {
            return result;
        }
        return new HttpSessionRequestCache();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.