What happens if its not a ConfigurableApplicationContext? probably better to take a class cast exception. It should never happen, but we don't want this to silently fail.