Package net.csdn.modules.controller

Examples of net.csdn.modules.controller.API


        boolean disableMySql = settings.getAsBoolean(ServiceFramwork.mode + ".datasources.mysql.disable", false);
        systemLog(processInfo.startTime, request, settings, processInfo);
        endORM(disableMySql);
        closeTx(settings, processInfo);
        Trace.clean();
        API api = ServiceFramwork.injector.getInstance(API.class);
        api.statusIncrement(processInfo.method, processInfo.status);
        api.averageTimeIncrement(processInfo.method, System.currentTimeMillis() - processInfo.startTime);
    }
View Full Code Here


                    Method[] methods = clzz.getDeclaredMethods();

                    for (Method method : methods) {
                        if (method.getModifiers() == Modifier.PRIVATE) continue;
                        RestController restController = ServiceFramwork.injector.getInstance(RestController.class);
                        API api = ServiceFramwork.injector.getInstance(API.class);
                        NoAction noAction = method.getAnnotation(NoAction.class);
                        if (noAction != null) {
                            restController.setDefaultHandlerKey(new Tuple<Class<ApplicationController>, Method>(clzz, method));
                        }

                        ErrorAction errorAction = method.getAnnotation(ErrorAction.class);
                        if (errorAction != null) {
                            restController.setErrorHandlerKey(new Tuple<Class<ApplicationController>, Method>(clzz, method));
                        }

                        At at = method.getAnnotation(At.class);
                        if (at == null) continue;
                        String url = at.path()[0];
                        RestRequest.Method[] httpMethods = at.types();

                        for (RestRequest.Method httpMethod : httpMethods) {
                            Tuple<Class<ApplicationController>, Method> tuple = new Tuple<Class<ApplicationController>, Method>(clzz, method);
                            restController.registerHandler(httpMethod, url, tuple);
                            api.addPath(tuple.v2());
                        }
                        bind(clzz);
                    }
                } catch (Exception e) {
                    logger.error(CError.SystemInitializeError, e);
View Full Code Here

TOP

Related Classes of net.csdn.modules.controller.API

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.