use of uk.gov.justice.services.adapter.rest.processor.response.ResponseStrategy in project microservice_framework by CJSCommonPlatform.
the class ResponseStrategyCache method strategyFromContext.
private ResponseStrategy strategyFromContext(final String responseStrategyName) {
final Bean bean = beanManager.getBeans(responseStrategyName).stream().findFirst().orElseThrow(() -> new IllegalArgumentException(format("Response response not found: %s", responseStrategyName)));
final CreationalContext ctx = beanManager.createCreationalContext(bean);
return (ResponseStrategy) beanManager.getReference(bean, ResponseStrategy.class, ctx);
}
Aggregations