Package org.apache.myfaces.orchestra.lib

Examples of org.apache.myfaces.orchestra.lib.OrchestraException


        {
            INIT_VIEW_METHOD.invoke(original, new Object[] {context});
        }
        catch(Exception e)
        {
            throw new OrchestraException("Unable to invoke initView on wrapped ViewHandler");
        }
    }
View Full Code Here


        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        if (fa == null)
        {
            Log log = LogFactory.getLog(RequestParameterProviderManager.class);
            log.error("No framework adapter currently selected");
            throw new OrchestraException("No framework adapter currently selected");
        }
        RequestParameterProviderManager manager =
            (RequestParameterProviderManager) fa.getSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY);

        if (manager == null)
View Full Code Here

    protected FacesContext getFacesContext()
    {
        FacesContext fc = FacesContext.getCurrentInstance();
        if (fc == null)
        {
            throw new OrchestraException("Missing FacesContext");
        }
        return fc;
    }
View Full Code Here

        if (viewControllerName == null)
        {
            // The current view does not have any bean that is its "view controller", ie
            // which handles the lifecycle events for that view. Therefore we cannot
            // do anything more here...
            throw new OrchestraException(
                "Error while processing bean " + beanName
                + ": no view controller name found for view " + viewId);
        }

        // Look up the definition with the specified name.
        ConfigurableApplicationContext appContext = getApplicationContext();
        ConfigurableListableBeanFactory beanFactory = appContext.getBeanFactory();
        BeanDefinition beanDefinition = beanFactory.getBeanDefinition(viewControllerName);

        if (beanDefinition.getBeanClassName().equals(ScopedProxyFactoryBean.class.getName()))
        {
            // The BeanDefinition we found is one that contains a nested aop:scopedProxy tag.
            // In this case, Spring has actually renamed the original BeanDefinition which
            // contains the data we need. So here we need to look up the renamed definition.
            //
            // It would be nice if the fake definition that Spring creates had some way of
            // fetching the definition it wraps, but instead it appears that we need to
            // rely on the magic string prefix...
            beanDefinition = beanFactory.getBeanDefinition("scopedTarget." + viewControllerName);
        }

        String scopeName = beanDefinition.getScope();
       
        if (scopeName == null)
        {
            // should never happen
            throw new OrchestraException(
                "Error while processing bean " + beanName
                + ": view controller " + viewControllerName + " has no scope.");
        }

        Scope registeredScope = beanFactory.getRegisteredScope(scopeName);
        if (registeredScope == null)
        {
            throw new OrchestraException(
                "Error while processing bean " + beanName
                + ": view controller " + viewControllerName
                + " has unknown scope " + scopeName);
        }

        if (registeredScope instanceof AbstractSpringOrchestraScope)
        {
            return ((AbstractSpringOrchestraScope) registeredScope).getConversationNameForBean(viewControllerName);
        }

        throw new OrchestraException(
            "Error while processing bean " + beanName
            + ": the scope " + scopeName
            + " should be of type AbstractSpringOrchestraScope"
            + ", but is type " + registeredScope.getClass().getName());
    }
View Full Code Here

    {
      return false;
    }
    catch (IllegalAccessException e)
    {
      throw new OrchestraException(e);
    }
    catch (InvocationTargetException e)
    {
      throw new OrchestraException(e);
    }

    return true;
  }
View Full Code Here

    ViewControllerManager viewControllerManager = _ViewControllerUtils.getViewControllerManager(facesContext);
    String viewControllerName = viewControllerManager.getViewControllerName(facesContext.getViewRoot().getViewId());
    if (viewControllerName == null)
    {
      throw new OrchestraException("no view controller name found for view " + facesContext.getViewRoot().getViewId());
    }

    String conversationName = super.getConversationNameForBean(viewControllerName);
    if (conversationName == null)
    {
      throw new OrchestraException("no view controller definition found for view " + facesContext.getViewRoot().getViewId());
    }

    return conversationName;
  }
View Full Code Here

            {
                FrameworkAdapter.getCurrentInstance().redirect(conversationRequire.redirect());
            }
            catch (IOException e)
            {
                throw new OrchestraException(e);
            }
        }
        else if (!StringUtils.isEmpty(conversationRequire.navigationAction()))
        {
            try
            {
                String dst = conversationRequire.navigationAction();
                FrameworkAdapter.getCurrentInstance().invokeNavigation(dst);
            }
            catch (IOException e)
            {
                throw new OrchestraException(e);
            }
        }
    }
View Full Code Here

        {
            method.invoke(bean, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            throw new OrchestraException(e);
        }
        catch (InvocationTargetException e)
        {
            throw new OrchestraException(e);
        }
    }
View Full Code Here

     */
    public void removeAndInvalidateConversationContext(ConversationContext context)
    {
        if (context.hasChildren())
        {
            throw new OrchestraException("Cannot remove context with children");
        }

        if (context.getIdAsLong().equals(findConversationContextId()))
        {
            throw new OrchestraException("Cannot remove current context");
        }

        synchronized(conversationContexts)
        {
            conversationContexts.remove(context.getIdAsLong());
View Full Code Here

        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        if (fa == null)
        {
            Log log = LogFactory.getLog(RequestParameterProviderManager.class);
            log.error("No framework adapter currently selected");
            throw new OrchestraException("No framework adapter currently selected");
        }
        RequestParameterProviderManager manager =
            (RequestParameterProviderManager) fa.getSessionAttribute(PARAMETER_PROVIDER_MANAGER_KEY);

        if (manager == null)
View Full Code Here

TOP

Related Classes of org.apache.myfaces.orchestra.lib.OrchestraException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.