Class SpringHelper
- java.lang.Object
-
- de.hybris.platform.acceleratorservices.util.SpringHelper
-
public final class SpringHelper extends java.lang.ObjectStatic class used to lookup a spring bean by name and type.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetSpringBean(javax.servlet.ServletRequest request, java.lang.String beanName, java.lang.Class<T> beanClass, boolean cacheInRequest)Returns the Spring bean with namebeanNameand of typebeanClass.static <T> java.util.Collection<T>getSpringBeans(javax.servlet.ServletRequest request, java.lang.Class<T> beanClass, boolean cacheInRequest)protected static <T> java.util.Collection<T>getSpringBeans(javax.servlet.ServletRequest request, java.lang.Class<T> beanClass, boolean cacheInRequest, java.util.function.Function<org.springframework.web.context.WebApplicationContext,java.util.Collection<T>> provider)static <T> java.util.Collection<T>getSpringBeansIncludingAncestors(javax.servlet.ServletRequest request, java.lang.Class<T> beanClass, boolean cacheInRequest)protected static voidlogDebugInfo(java.lang.Exception ex, java.lang.String message)
-
-
-
Method Detail
-
getSpringBean
public static <T> T getSpringBean(javax.servlet.ServletRequest request, java.lang.String beanName, java.lang.Class<T> beanClass, boolean cacheInRequest)Returns the Spring bean with namebeanNameand of typebeanClass. If the cacheInRequest flag is set to true then the bean is cached in the request attributes.- Type Parameters:
T- type of the bean- Parameters:
request- the http requestbeanName- name of the beanbeanClass- expected type of the beancacheInRequest- flag, set to true to use the request attributes to cache the spring bean- Returns:
- the bean matching the given arguments or
nullif no bean could be resolved
-
logDebugInfo
protected static void logDebugInfo(java.lang.Exception ex, java.lang.String message)
-
getSpringBeans
public static <T> java.util.Collection<T> getSpringBeans(javax.servlet.ServletRequest request, java.lang.Class<T> beanClass, boolean cacheInRequest)
-
getSpringBeansIncludingAncestors
public static <T> java.util.Collection<T> getSpringBeansIncludingAncestors(javax.servlet.ServletRequest request, java.lang.Class<T> beanClass, boolean cacheInRequest)
-
getSpringBeans
protected static <T> java.util.Collection<T> getSpringBeans(javax.servlet.ServletRequest request, java.lang.Class<T> beanClass, boolean cacheInRequest, java.util.function.Function<org.springframework.web.context.WebApplicationContext,java.util.Collection<T>> provider)
-
-