Package org.apache.beehive.netui.pageflow.interceptor.action

Examples of org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext


                                                  Action action, ActionForm form, ActionMapping mapping )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        String actionName = InternalUtils.getActionName( mapping );
        ActionInterceptorContext context = null;
        List/*< Interceptor >*/ interceptors = null;
       
        if ( action instanceof FlowControllerAction )
        {
            FlowController fc = ( ( FlowControllerAction ) action ).getFlowController();
           
            if ( fc instanceof PageFlowController )
            {
                PageFlowController pfc = ( PageFlowController ) fc;
                context = new ActionInterceptorContext( request, response, servletContext, pfc, null, actionName );
                interceptors = context.getActionInterceptors();
            }
        }
       
        if ( interceptors != null && interceptors.size() == 0 ) interceptors = null;
       
        try
        {
            //
            // Run any before-action interceptors.
            //
            if ( interceptors != null && ! PageFlowRequestWrapper.get( request ).isReturningFromActionIntercept() )
            {
                Interceptors.doPreIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        _log.debug( msg.toString() );
                    }
                   
                    return fwd;
                }
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setReturningFromActionIntercept( false );
            }
           
            //
            // Execute the action.
            //
            RequestInterceptorContext requestContext =
                    context != null ?
                    context :
                    new RequestInterceptorContext( request, response, getServletContext() );
            ActionRunner actionExecutor = new ActionRunner( requestContext, action, form, mapping );
            ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
           
            //
            // Run any after-action interceptors.
            //
            if ( interceptors != null )
            {
                context.setOriginalForward( ret );
                Interceptors.doPostIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "Action interceptor " + context.getOverridingInterceptor().getClass().getName()
                                    + " after action " + actionName + ": forwarding to "
                                    + fwd != null ? fwd.getPath() : "null [no forward]" );
                    }
                   
                    return fwd;
View Full Code Here


     * @param pageFlow the page flow to push.
     * @param request the current HttpServletRequest.
     */
    public void push( PageFlowController pageFlow, HttpServletRequest request )
    {
        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
       
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
            _stack.push( new PushedPageFlow( pageFlow ) );
View Full Code Here

                                                  Action action, ActionForm form, ActionMapping mapping )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        String actionName = InternalUtils.getActionName( mapping );
        ActionInterceptorContext context = null;
        List/*< Interceptor >*/ interceptors = null;
       
        if ( action instanceof FlowControllerAction )
        {
            FlowController fc = ( ( FlowControllerAction ) action ).getFlowController();
           
            if ( fc instanceof PageFlowController )
            {
                PageFlowController pfc = ( PageFlowController ) fc;
                context = new ActionInterceptorContext( request, response, servletContext, pfc, null, actionName );
                interceptors = context.getActionInterceptors();
            }
        }
       
        try
        {
            //
            // Run any before-action interceptors.
            //
            if ( interceptors != null && ! PageFlowRequestWrapper.get( request ).isReturningFromActionIntercept() )
            {
                Interceptors.doPreIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        _log.debug( msg.toString() );
                    }
                   
                    return fwd;
                }
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setReturningFromActionIntercept( false );
            }
           
            //
            // Execute the action.
            //
            RequestInterceptorContext requestContext =
                    context != null ?
                    context :
                    new RequestInterceptorContext( request, response, getServletContext() );
            ActionRunner actionExecutor = new ActionRunner( requestContext, action, form, mapping );
            ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
           
            //
            // Run any after-action interceptors.
            //
            if ( interceptors != null )
            {
                context.setOriginalForward( ret );
                Interceptors.doPostIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "Action interceptor " + context.getOverridingInterceptor().getClass().getName()
                                    + " after action " + actionName + ": forwarding to "
                                    + fwd != null ? fwd.getPath() : "null [no forward]" );
                    }
                   
                    return fwd;
View Full Code Here

     * @param pageFlow the page flow to push.
     * @param request the current HttpServletRequest.
     */
    public void push( PageFlowController pageFlow, HttpServletRequest request )
    {
        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
       
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
            _stack.push( new PushedPageFlow( pageFlow ) );
View Full Code Here

     * @param pageFlow the page flow to push.
     * @param request the current HttpServletRequest.
     */
    public void push( PageFlowController pageFlow, HttpServletRequest request )
    {
        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
            _stack.push( new PushedPageFlow( pageFlow ) );
View Full Code Here

                                                  Action action, ActionForm form, ActionMapping mapping )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        String actionName = InternalUtils.getActionName( mapping );
        ActionInterceptorContext context = null;
        List/*< Interceptor >*/ interceptors = null;
       
        if ( action instanceof FlowControllerAction )
        {
            FlowController fc = ( ( FlowControllerAction ) action ).getFlowController();
           
            if ( fc instanceof PageFlowController )
            {
                PageFlowController pfc = ( PageFlowController ) fc;
                context = new ActionInterceptorContext( request, response, servletContext, pfc, null, actionName );
                interceptors = context.getActionInterceptors();
            }
        }
       
        if ( interceptors != null && interceptors.size() == 0 ) interceptors = null;
       
        try
        {
            //
            // Run any before-action interceptors.
            //
            if ( interceptors != null && ! PageFlowRequestWrapper.get( request ).isReturningFromActionIntercept() )
            {
                Interceptors.doPreIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        _log.debug( msg.toString() );
                    }
                   
                    return fwd;
                }
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setReturningFromActionIntercept( false );
            }
           
            //
            // Execute the action.
            //
            RequestInterceptorContext requestContext =
                    context != null ?
                    context :
                    new RequestInterceptorContext( request, response, getServletContext() );
            ActionRunner actionExecutor = new ActionRunner( requestContext, action, form, mapping );
            ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
           
            //
            // Run any after-action interceptors.
            //
            if ( interceptors != null )
            {
                context.setOriginalForward( ret );
                Interceptors.doPostIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( _log.isDebugEnabled() )
                    {
                        _log.debug( "Action interceptor " + context.getOverridingInterceptor().getClass().getName()
                                    + " after action " + actionName + ": forwarding to "
                                    + fwd != null ? fwd.getPath() : "null [no forward]" );
                    }
                   
                    return fwd;
View Full Code Here

                                                  Action action, ActionForm form, ActionMapping mapping )
            throws IOException, ServletException
    {
        ServletContext servletContext = getServletContext();
        String actionName = InternalUtils.getActionName( mapping );
        ActionInterceptorContext context = null;
        List/*< Interceptor >*/ interceptors = null;
       
        if ( action instanceof FlowControllerAction )
        {
            FlowController fc = ( ( FlowControllerAction ) action ).getFlowController();
           
            if ( fc instanceof PageFlowController )
            {
                PageFlowController pfc = ( PageFlowController ) fc;
                context = new ActionInterceptorContext( request, response, servletContext, pfc, null, actionName );
                interceptors = context.getActionInterceptors();
            }
        }
       
        if ( interceptors != null && interceptors.size() == 0 )
            interceptors = null;
       
        try
        {
            //
            // Run any pre-action interceptors.
            //
            if ( interceptors != null && ! PageFlowRequestWrapper.get( request ).isReturningFromActionIntercept() )
            {
                Interceptors.doPreIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( LOG.isDebugEnabled() )
                    {
                       
                        Interceptor overridingInterceptor = context.getOverridingInterceptor();
                        StringBuffer msg = new StringBuffer();
                        msg.append( "Action interceptor " );
                        msg.append( overridingInterceptor.getClass().getName() );
                        msg.append( " before action " );
                        msg.append( actionName );
                        msg.append( ": forwarding to " );
                        msg.append( fwd != null ? fwd.getPath() : "null [no forward]" );
                        LOG.debug( msg.toString() );
                    }
                   
                    return fwd;
                }
            }
            else
            {
                PageFlowRequestWrapper.get( request ).setReturningFromActionIntercept( false );
            }
           
            //
            // Execute the action.
            //
            RequestInterceptorContext requestContext =
                    context != null ?
                    context :
                    new RequestInterceptorContext( request, response, getServletContext() );
            ActionRunner actionExecutor = new ActionRunner( requestContext, action, form, mapping );
            ActionForward ret = ActionInterceptors.wrapAction( context, interceptors, actionExecutor );
           
            //
            // Run any post-action interceptors.
            //
            if ( interceptors != null )
            {
                context.setOriginalForward( ret );
                Interceptors.doPostIntercept( context, interceptors );
               
                if ( context.hasInterceptorForward() )
                {
                    InterceptorForward fwd = context.getInterceptorForward();
                   
                    if ( LOG.isDebugEnabled() )
                    {
                        LOG.debug( "Action interceptor " + context.getOverridingInterceptor().getClass().getName()
                                    + " after action " + actionName + ": forwarding to "
                                    + fwd != null ? fwd.getPath() : "null [no forward]" );
                    }
                   
                    return fwd;
View Full Code Here

     * @param pageFlow the page flow to push.
     * @param request the current HttpServletRequest.
     */
    public void push( PageFlowController pageFlow, HttpServletRequest request )
    {
        ActionInterceptorContext interceptorContext = ActionInterceptorContext.getActiveContext( request, true );
        if ( interceptorContext != null )
        {
            ActionInterceptor interceptor = interceptorContext.getOverridingActionInterceptor();
            InterceptorForward originalForward = interceptorContext.getOriginalForward();
            String actionName = interceptorContext.getActionName();
            _stack.push( new PushedPageFlow( pageFlow, interceptor, originalForward, actionName ) );
        }
        else
        {
            _stack.push( new PushedPageFlow( pageFlow ) );
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.pageflow.interceptor.action.ActionInterceptorContext

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.