Examples of OrchestraException


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

        ViewControllerManager viewControllerManager = getViewControllerManager();
        String viewId = FrameworkAdapter.getCurrentInstance().getCurrentViewId();
        String viewControllerName = viewControllerManager.getViewControllerName(viewId);
        if (viewControllerName == null)
        {
            throw new OrchestraException("no view controller name found for view " + viewId);
        }

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

        return conversationName;
    }
View Full Code Here

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

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

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

     */
    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

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

        Object o = childContexts.remove(context.getIdAsLong());
        if (o != context)
        {
            // Sanity check failed: o is null, or o is a different object.
            // In either case, something is very wrong.
            throw new OrchestraException("Invalid call of removeChild");
        }
    }
View Full Code Here

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

        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

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

     */
    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

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

     */
    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

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

        Object o = childContexts.remove(context.getIdAsLong());
        if (o != context)
        {
            // Sanity check failed: o is null, or o is a different object.
            // In either case, something is very wrong.
            throw new OrchestraException("Invalid call of removeChild");
        }
    }
View Full Code Here

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

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

        return true;
    }
View Full Code Here

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

            Object ret = CALC_CHAR_ENC_METHOD.invoke(original, new Object[] {context});
            return (String) ret;
        }
        catch(Exception e)
        {
            throw new OrchestraException("Unable to invoke calculateCharacterEncoding on wrapped ViewHandler");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.