operation.execute(input);
ConfigurableApplicationContext context = SpringModuleUtils.getRootSpringContext(facade.getModuleStateHolder());
if (context == null) {
throw new InvalidStateException("Root application context is null");
}
if (!(context instanceof WebApplicationContext)) {
throw new InvalidStateException("Application context " + context + " has class "
+ context.getClass().getName() + " which is not an instance of "
+ WebApplicationContext.class.getName());
}
return (WebApplicationContext) context;