Fight the Future

Java言語とJVM、そしてJavaエコシステム全般にまつわること

TeedaがPageのメソッドを呼び出してる部分

HtmlComponentInvokerImpl

    public String invoke(final FacesContext context,
            final String componentName, final String methodName) {
        AssertionUtil.assertNotNull("context", context);
        AssertionUtil.assertNotNull("methodName", methodName);
        if (INITIALIZE.equals(methodName)) {
            setInitialized(context, componentName, true);
        }
        if (componentName == null) {
            return null;
        }
        String next = null;
        String fromAction = MethodBindingUtil.getFromAction(componentName,
                methodName);
        String pageSuffix = namingConvention.getPageSuffix();
        if (!DIContainerUtil.hasComponent(componentName)) {
            return null;
        }
        Object component = DIContainerUtil.getComponent(componentName);
        Class componentClass = component.getClass();
        BeanDesc beanDesc = BeanDescFactory.getBeanDesc(componentClass);
        Object ret = null;
        try {
            ret = beanDesc.invoke(component, methodName, null);
            ScopeValueHelper.removeIfDoFinish(methodName, context);
            if (ret instanceof Class) {
                Class retClass = (Class) ret;
                if (retClass != null &&
                        !retClass.getName().endsWith(pageSuffix)) {
                    throw new IllegalPageTransitionException(retClass);
                }
                next = getNextPageTransition(retClass);
            } else {
                next = (String) ret;
            }
            setRedirectDesc(context, methodName);
            NavigationHandlerUtil.handleNavigation(context, fromAction, next);
        } catch (Throwable e) {
            try {
                if (e instanceof InvocationTargetRuntimeException) {
                    e = e.getCause();
                }
                ExternalContext extContext = context.getExternalContext();
                if (errorPageManager.handleException(e, context, extContext)) {
                    context.responseComplete();
                } else {
                    throw new EvaluationException(e);
                }
            } catch (IOException ioe) {
                logger.log(ioe);
                throw new EvaluationException(e);
            }
        }

        return next;
    }

読んで楽しかった。それだけ。