Examples of FastClass


Examples of net.sf.cglib.reflect.FastClass

        controllerClasses.add(TestMethodInterceptorController1.class);
        FakeRouteMap rm = new FakeRouteMap();
        ControllerDatabase db = new MappedControllerDatabase(controllerClasses, rm,
                new HashMap<String, EntityMarshaller>());

        FastClass fc = db.getFastClass(TestMethodInterceptorController1.class);
        assertNotNull(fc);
        assertEquals(TestMethodInterceptorController1.class, fc.getJavaClass());
        fc = db.getFastClass(Interceptor1.class);
        assertNotNull(fc);
        assertEquals(Interceptor1.class, fc.getJavaClass());

        List<Class<?>> interceptors = db.getInterceptorsForAction(TestMethodInterceptorController1.class, "someAction");

        assertNotNull(interceptors);
        assertEquals(1, interceptors.size());
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        controllerClasses.add(TestMethodInterceptorController2.class);
        FakeRouteMap rm = new FakeRouteMap();
        ControllerDatabase db = new MappedControllerDatabase(controllerClasses, rm,
                new HashMap<String, EntityMarshaller>());

        FastClass fc = db.getFastClass(TestMethodInterceptorController2.class);
        assertNotNull(fc);
        assertEquals(TestMethodInterceptorController2.class, fc.getJavaClass());
        fc = db.getFastClass(Interceptor1.class);
        assertNotNull(fc);
        assertEquals(Interceptor1.class, fc.getJavaClass());
        fc = db.getFastClass(Interceptor2.class);
        assertNotNull(fc);
        assertEquals(Interceptor2.class, fc.getJavaClass());

        List<Class<?>> interceptors = db.getInterceptorsForAction(TestMethodInterceptorController2.class, "someAction");

        assertNotNull(interceptors);
        assertEquals(2, interceptors.size());
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        if (view != null) {
            return view;
        }

        FastClass actionFastClass = controllerDb.getFastClass(actionControllerClass);
        Object entity = actionFastClass.invoke(actionSignature.fastIndex(), actionController, args);
        View marshalledEntity = actionSignature.marshall(entity);
        view = marshalledEntity;
        logger.debug("invoked " + actionSignature.methodName() + " for " + actionControllerClass.getName());

        View afterActionView = invokeAfterActionIfRequired(actionController, actionAnnotations,
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

            /*
             * we've already validated that there are no method parameters when
             * creating the controller database
             */

            FastClass actionFastClass = controllerDb.getFastClass(instance.getClass());
            Object returnObj = actionFastClass.invoke(interceptorMethod.fastIndex(), instance,
                    getBeforeOrAfterActionArgs(interceptorMethod.parameterTypes(), actionArgs,
                            actionAnnotations, entity, marshalledEntity));

            if (returnObj != null && returnObj instanceof View) {
                view = (View) returnObj;
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        Map<HttpMethod, List<Class<?>>> httpMethodActionInterceptorsMap = new EnumMap<HttpMethod, List<Class<?>>>(
                HttpMethod.class);

        Method[] methods = getAllMethodsIn(controllerClass);
       
        FastClass fastClass = FastClass.create(controllerClass);
        classToFastClassMap.put(controllerClass, fastClass);

        for (int i = 0; i < methods.length; i++) {

            Annotation ann = methods[i].getAnnotation(Action.class);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

         */
        if (!interceptorClassToAfterActionMap.containsKey(interceptorClass)
                && !interceptorClassToBeforeActionMap.containsKey(interceptorClass)) {

            Method[] methods = getAllMethodsIn(interceptorClass);
            FastClass fastClass = FastClass.create(interceptorClass);
            classToFastClassMap.put(interceptorClass, fastClass);

            for (int i = 0; i < methods.length; i++) {

                Annotation ann = methods[i].getAnnotation(BeforeAction.class);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        logger.debug("creating error handler factory - " + errorHandlerFactoryName + " ...");
       
        try {

            Class<?> errorHandlerFactoryClass = Class.forName(errorHandlerFactoryName);
            FastClass errorHandlerFactoryFastClass = FastClass.create(errorHandlerFactoryClass);
            ErrorHandlerFactory errorHandlerFactory = (ErrorHandlerFactory) errorHandlerFactoryFastClass.newInstance();

            context.setAttribute(ErrorHandlerFactory.KEY, errorHandlerFactory);

        } catch (Throwable e) {
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

                    if (afterConstructSig != null) {
                        /*
                         * we've already validated that there are no method
                         * parameters when creating the controller database
                         */
                        FastClass actionFastClass = controllerDb.getFastClass(controllerClass);
                        actionFastClass.invoke(afterConstructSig.fastIndex(), actionController, new Object[] {});
                        logger.debug("invoked after construct action for " + controllerClass.getName());
                    }

                    /* add this singleton controller to the servlet context */
                    context.setAttribute(controllerClass.getName(), actionController);
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        if (afterConstructSig != null) {
            /*
             * we've already validated that there are no method parameters when
             * creating the controller database
             */
            FastClass actionFastClass = controllerDb.getFastClass(controllerClass);
            actionFastClass.invoke(afterConstructSig.fastIndex(), actionController, new Object[] {});
            logger.debug("invoked after construct action for " + controllerClass.getName());
        }
    }
View Full Code Here

Examples of net.sf.cglib.reflect.FastClass

        T cntrl = injector.getInstance(clazz);
        Set<Class<?>> controllerClasses = new HashSet<Class<?>>();
        controllerClasses.add(cntrl.getClass());
        ControllerDatabase db = newControllerDatabase(controllerClasses);

        FastClass fastClass = FastClass.create(clazz);
        int fastIndex = fastClass.getIndex(methodName, new Class<?>[] {});
        ActionSignature sig = mock(ActionSignature.class);
        when(sig.fastIndex()).thenReturn(fastIndex);
        when(sig.parameterTypes()).thenReturn(new Class<?>[] {});
        when(sig.methodName()).thenReturn(methodName);
        when(sig.getArgs(parametersMap, req.getInputStream())).thenReturn(new Object[] {});
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.