class ControllerExtension implements Extension {

    public <T> void processEmbeddedController(@WithAnnotations({EmbeddedController.class}) @Observes ProcessAnnotatedType<T> event) {
        LOGGER.info("Processing embedded controller class: {}", event.getAnnotatedType().getJavaClass());
        EmbeddedController a = event.getAnnotatedType().getJavaClass().getAnnotation(EmbeddedController.class);
        if (a != null) {
            if (ControllerUtils.useEmbeddedController()) {
                /**
                 * Select server template storage implementation for embedded controller
                 * based on system properties loaded by ControllerUtils
                 */
                if (ControllerUtils.isOpenShiftSupported()) {
                    if (ServerTemplateVFSStorage.class
                                                      .isAssignableFrom(event.getAnnotatedType().getJavaClass())) {
                        removeControllerClassFromCDIContext(event);
                    }
                } else {
                    if (ServerTemplateOCPStorage.class
                                                      .isAssignableFrom(event.getAnnotatedType().getJavaClass())) {
                        removeControllerClassFromCDIContext(event);
                    }
                }
            } else {
                removeControllerClassFromCDIContext(event);
            }
        }

    }

}