private ContextControllerFactoryService getContextControllerFactoryService(Annotation[] annotations) {
try {
ContextStateCache replacementCache = (ContextStateCache) JavaClassHelper.getAnnotationHook(annotations, HookType.CONTEXT_STATE_CACHE, ContextStateCache.class, null);
if (replacementCache != null) {
return new ContextControllerFactoryServiceImpl(replacementCache);
}
}
catch (ExprValidationException e) {
throw new EPException("Failed to obtain hook for " + HookType.CONTEXT_STATE_CACHE);
}