Examples of FrameworkAdapter


Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

    private void _run()
    {
        // Set up a custom FrameworkAdapter for this thread, so other orchestra code used by this
        // thread which expects one to exist will not throw NullPointerException.
        FrameworkAdapter fa = new LocalFrameworkAdapter();
        ConversationMessager conversationMessager = new LogConversationMessager();
        fa.setConversationMessager(conversationMessager);
        FrameworkAdapter.setCurrentInstance(fa);

        while (!isInterrupted())
        {
            ConversationManager[] managersArray;
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     * <p>
     * Normally, the returned object will be an instance of ConversationManagerFactoryImpl.
     */
    public static ConversationManagerFactory getConversationManagerFactory()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        ConversationManagerFactory factory = (ConversationManagerFactory) fa.getBean(
                CONVERSATION_MANAGER_FACTORY_KEY);

        if (factory == null)
        {
            factory = CONVERSATION_MANAGER_FACTORY_DFLT;
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     * However users can configure a bean in the DI framework to specify a different class - or to
     * return an instance of ConversationContextFactoryImpl with a custom timeout value configured.
     */
    public static ConversationContextFactory getConversationContextFactory()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        ConversationContextFactory factory = (ConversationContextFactory) fa.getBean(
                CONVERSATION_CONTEXT_FACTORY_KEY);

        if (factory == null)
        {
            factory = CONVERSATION_CONTEXT_FACTORY_DFLT;
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

    return sb.toString();
  }

  protected boolean isResponseIntercepted()
  {
    FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();

    return Boolean.TRUE.equals(fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED))
      || Boolean.TRUE.equals(fa.getRequestAttribute(RequestParameterServletFilter.REQUEST_PARAM_RESPONSE_WRAPPED));
  }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     * <p>
     * When create is false, null is returned if no instance yet exists for the current user session.
     */
    public static ConversationManager getInstance(boolean create)
    {
        FrameworkAdapter frameworkAdapter = FrameworkAdapter.getCurrentInstance();
        if (frameworkAdapter == null)
        {
            if (!create)
            {
                // if we don't have to create a conversation manager, then it doesn't
                // matter if there is no FrameworkAdapter available.
                return null;
            }
            else
            {
                throw new IllegalStateException("FrameworkAdapter not found");
            }
        }

        Object cmObj = frameworkAdapter.getSessionAttribute(CONVERSATION_MANAGER_KEY);
        // hack: see method readResolve
        if (DUMMY.equals(cmObj))
        {
            Log log = LogFactory.getLog(ConversationManager.class);
            if (log.isDebugEnabled())
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     * <p>
     * If there is no current conversationContext, then null is returned.
     */
    private Long findConversationContextId()
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
       
        // Has it been extracted from the req params and cached as a req attr?
        Long conversationContextId = (Long)fa.getRequestAttribute(CONVERSATION_CONTEXT_REQ);
        if (conversationContextId == null)
        {
            if (fa.containsRequestParameterAttribute(CONVERSATION_CONTEXT_PARAM))
            {
                String urlConversationContextId = fa.getRequestParameterAttribute(
                        CONVERSATION_CONTEXT_PARAM).toString();
                conversationContextId = new Long(
                        Long.parseLong(urlConversationContextId, Character.MAX_RADIX));
            }
        }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

    {
        Long conversationContextId = findConversationContextId();
        if (conversationContextId == null)
        {
            conversationContextId = createNextConversationContextId();
            FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
            fa.setRequestAttribute(CONVERSATION_CONTEXT_REQ, conversationContextId);
        }

        return conversationContextId;
    }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

     *
     * @since 1.2
     */
    public void activateConversationContext(ConversationContext ctx)
    {
        FrameworkAdapter fa = FrameworkAdapter.getCurrentInstance();
        fa.setRequestAttribute(CONVERSATION_CONTEXT_REQ, ctx.getIdAsLong());
    }
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

    private void _run()
    {
        // Set up a custom FrameworkAdapter for this thread, so other orchestra code used by this
        // thread which expects one to exist will not throw NullPointerException.
        FrameworkAdapter fa = new LocalFrameworkAdapter();
        ConversationMessager conversationMessager = new LogConversationMessager();
        fa.setConversationMessager(conversationMessager);
        FrameworkAdapter.setCurrentInstance(fa);

        while (!isInterrupted())
        {
            ConversationManager[] managersArray;
View Full Code Here

Examples of org.apache.myfaces.orchestra.frameworkAdapter.FrameworkAdapter

        // Note: When a session has timed out normally, then  currentFrameworkAdapter will
        // be null. But when a request calls session.invalidate directly, then this function
        // is called within the thread of the request, and so will have a FrameworkAdapter
        // in the current thread (which has been initialized with the http request object).

        FrameworkAdapter currentFrameworkAdapter = FrameworkAdapter.getCurrentInstance();
        try
        {
            // Always use a fresh FrameworkAdapter to avoid OrchestraException
            // "Cannot remove current context" when a request calls session.invalidate();
            // we want getRequestParameter and related functions to always return null..
            FrameworkAdapter fa = new LocalFrameworkAdapter();
            ConversationMessager conversationMessager = new LogConversationMessager();
            fa.setConversationMessager(conversationMessager);
            FrameworkAdapter.setCurrentInstance(fa);
   
            conversationWiperThread.removeConversationManager(cm);
            cm.removeAndInvalidateAllConversationContexts();
        }
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.