/** * Allows explicit configuration of the {@link RequestCache} to be used. Defaults to * try finding a {@link RequestCache} as a shared object. Then falls back to a * {@link HttpSessionRequestCache}. * * @param requestCache the explicit {@link RequestCache} to use * @return the {@link RequestCacheConfigurer} for further customization */ public RequestCacheConfigurer<H> requestCache(RequestCache requestCache) { getBuilder().setSharedObject(RequestCache.class, requestCache); return this; }
private <T> T getBeanOrNull(Class<T> type) { ApplicationContext context = getBuilder().getSharedObject(ApplicationContext.class); if (context == null) { return null; } try { return context.getBean(type); } catch (NoSuchBeanDefinitionException e) { return null; } } @SuppressWarnings("unchecked")
@Override public H disable() { getBuilder().setSharedObject(RequestCache.class, new NullRequestCache()); return super.disable(); }
private <T> T getBeanOrNull(Class<T> type) { ApplicationContext context = getBuilder().getSharedObject(ApplicationContext.class); if (context == null) { return null; } try { return context.getBean(type); } catch (NoSuchBeanDefinitionException e) { return null; } } @SuppressWarnings("unchecked")
/** * Allows explicit configuration of the {@link RequestCache} to be used. Defaults to * try finding a {@link RequestCache} as a shared object. Then falls back to a * {@link HttpSessionRequestCache}. * * @param requestCache the explicit {@link RequestCache} to use * @return the {@link RequestCacheConfigurer} for further customization */ public RequestCacheConfigurer<H> requestCache(RequestCache requestCache) { getBuilder().setSharedObject(RequestCache.class, requestCache); return this; }
@Override public H disable() { getBuilder().setSharedObject(RequestCache.class, new NullRequestCache()); return super.disable(); }
/** * Allows explicit configuration of the {@link RequestCache} to be used. Defaults to * try finding a {@link RequestCache} as a shared object. Then falls back to a * {@link HttpSessionRequestCache}. * * @param requestCache the explicit {@link RequestCache} to use * @return the {@link RequestCacheConfigurer} for further customization */ public RequestCacheConfigurer<H> requestCache(RequestCache requestCache) { getBuilder().setSharedObject(RequestCache.class, requestCache); return this; }
private <T> T getBeanOrNull(Class<T> type) { ApplicationContext context = getBuilder().getSharedObject(ApplicationContext.class); if (context == null) { return null; } try { return context.getBean(type); } catch (NoSuchBeanDefinitionException e) { return null; } } @SuppressWarnings("unchecked")
/** * Allows explicit configuration of the {@link RequestCache} to be used. Defaults to try finding a * {@link RequestCache} as a shared object. Then falls back to a {@link HttpSessionRequestCache}. * * @param requestCache the explicit {@link RequestCache} to use * @return the {@link RequestCacheConfigurer} for further customization */ public RequestCacheConfigurer<H> requestCache(RequestCache requestCache) { getBuilder().setSharedObject(RequestCache.class, requestCache); return this; }
@Override public H disable() { getBuilder().setSharedObject(RequestCache.class, new NullRequestCache()); return super.disable(); }