Class ApplicationBeans
java.lang.Object
de.hybris.platform.integrationservices.util.ApplicationBeans
A utility for retrieving Spring beans defined in the application context.
-
Method Summary
-
Method Details
-
getBean
Retrieves a bean defined in the application context- Type Parameters:
T- expected type of Spring bean in the application context- Parameters:
id- ID or name of the Spring in the application contexttype- expected type of Spring bean in the application context- Returns:
- bean instance defined in the Spring application context.
- Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException- if the bean of the specified type and ID does not exist.
-
getFreshBean
Retrieves a session bean defined in the application context. If retrieved bean is not the expected type and an exception is thrown, destroys scoped bean and tries to regenerate and retrieve it again.- Type Parameters:
T- expected type of Spring bean in the application context- Parameters:
id- ID or name of the Spring bean in the application contexttype- expected type of Spring bean in the application context- Returns:
- bean instance defined in the Spring application context.
-