Package com.dyuproject.web.rest

Examples of com.dyuproject.web.rest.Interceptor


    }
   
    public static void handle(Controller controller, String mime, HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException
    {
        Interceptor interceptor = controller.getInterceptor();
        if(interceptor==null)
        {
            controller.handle(mime, request, response);
            return;
        }
        boolean success = false;
        try
        {
            success = interceptor.preHandle(getCurrentRequestContext());
        }
        finally
        {           
            if(success)
            {
                try
                {
                    controller.handle(mime, request, response);
                }
                finally
                {
                    interceptor.postHandle(true, getCurrentRequestContext());
                }
            }
            else
                interceptor.postHandle(false, getCurrentRequestContext());
        }      
    }
View Full Code Here


        return _id;
    }
   
    void addMappedInterceptor(Interceptor interceptor, int wildcard)
    {
        Interceptor existing = _mappedInterceptors[wildcard];
        if(existing==null)
            _mappedInterceptors[wildcard] = interceptor;
        else if(existing instanceof InterceptorCollection)
            ((InterceptorCollection)existing).addInterceptor(interceptor);
        else
View Full Code Here

            rc.getResponse().sendError(405);
            return;
        }
       
        // cache to local copy
        Interceptor interceptor = _interceptor;
        if(interceptor==null)
        {
            resource.handle(rc);
            return;
        }

        boolean success = false;
        try
        {
            success = interceptor.preHandle(rc);
        }
        finally
        {           
            if(success)
            {
                try
                {
                    resource.handle(rc);
                }
                finally
                {
                    interceptor.postHandle(true, rc);
                }
            }
            else
                interceptor.postHandle(false, rc);
        }     
    }   
View Full Code Here

TOP

Related Classes of com.dyuproject.web.rest.Interceptor

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.