use of org.apereo.cas.CasEmbeddedValueResolver in project cas by apereo.
the class EnvironmentConversionServiceInitializer method initialize.
@Override
public void initialize(final ConfigurableApplicationContext ctx) {
final DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(true);
conversionService.setEmbeddedValueResolver(new CasEmbeddedValueResolver(ctx));
ctx.getEnvironment().setConversionService(conversionService);
}
use of org.apereo.cas.CasEmbeddedValueResolver in project cas by apereo.
the class CasWebApplicationContext method onRefresh.
/**
* {@inheritDoc}
* Reset the value resolver on the inner {@link ScheduledAnnotationBeanPostProcessor}
* so that we can parse durations. This is due to how {@link org.springframework.scheduling.annotation.SchedulingConfiguration}
* creates the processor and does not provide a way for one to inject a value resolver.
*/
@Override
protected void onRefresh() {
final ScheduledAnnotationBeanPostProcessor sch = (ScheduledAnnotationBeanPostProcessor) getBeanFactory().getBean(TaskManagementConfigUtils.SCHEDULED_ANNOTATION_PROCESSOR_BEAN_NAME, BeanPostProcessor.class);
sch.setEmbeddedValueResolver(new CasEmbeddedValueResolver(this));
super.onRefresh();
}
use of org.apereo.cas.CasEmbeddedValueResolver in project cas by apereo.
the class SchedulingUtils method prepScheduledAnnotationBeanPostProcessor.
/**
* Gets string value resolver.
*
* @param applicationContext the application context
* @return the string value resolver
*/
public static StringValueResolver prepScheduledAnnotationBeanPostProcessor(final ApplicationContext applicationContext) {
final StringValueResolver resolver = new CasEmbeddedValueResolver(applicationContext);
final ScheduledAnnotationBeanPostProcessor sch = applicationContext.getBean(ScheduledAnnotationBeanPostProcessor.class);
sch.setEmbeddedValueResolver(resolver);
return resolver;
}
use of org.apereo.cas.CasEmbeddedValueResolver in project cas by apereo.
the class CasCoreUtilConfiguration method init.
@PostConstruct
public void init() {
final ConfigurableApplicationContext ctx = applicationContextProvider().getConfigurableApplicationContext();
final DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(true);
conversionService.setEmbeddedValueResolver(new CasEmbeddedValueResolver(ctx));
ctx.getEnvironment().setConversionService(conversionService);
final ConfigurableEnvironment env = (ConfigurableEnvironment) ctx.getParent().getEnvironment();
env.setConversionService(conversionService);
final ConverterRegistry registry = (ConverterRegistry) DefaultConversionService.getSharedInstance();
registry.addConverter(zonedDateTimeToStringConverter());
}
Aggregations