Package net.csdn.filter

Examples of net.csdn.filter.FilterEnhancer


* Time: 上午11:29
*/
public class ModelLoader implements Loader {
    @Override
    public void load(Settings settings) throws Exception {
        final ControllerEnhancer enhancer = new FilterEnhancer(settings);
        final List<CtClass> classList = new ArrayList<CtClass>();
        ServiceFramwork.scanService.scanArchives(settings.get("application.model"), new ScanService.LoadClassEnhanceCallBack() {
            @Override
            public Class loaded(DataInputStream classFile) {
                try {
                    classList.add(enhancer.enhanceThisClass(classFile));
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return null;
            }
        });

        enhancer.enhanceThisClass2(classList);


        for (CtClass ctClass : classList) {
            if (ctClass.hasAnnotation(DiscriminatorColumn.class)) {
                loadClass(ctClass);
View Full Code Here


    @Override
    public void load(Settings settings) throws Exception {
        ServiceFramwork.injector = Guice.createInjector(Stage.PRODUCTION, ServiceFramwork.AllModules);
        final List<Module> moduleList = new ArrayList<Module>();
        final List<CtClass> controllers = list();
        final ControllerEnhancer enhancer = new FilterEnhancer(settings);
        for (String item : WowCollections.split2(settings.get("application.controller"), ",")) {
            //自动加载所有Action类
            ServiceFramwork.scanService.scanArchives(item, new ScanService.LoadClassEnhanceCallBack() {
                @Override
                public Class loaded(DataInputStream classFile) {
                    try {
                        CtClass ctClass = enhancer.enhanceThisClass(classFile);
                        logger.info("controller load :    " + ctClass.getName());
                        controllers.add(ctClass);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }

                    return null;
                }
            });
        }

        enhancer.enhanceThisClass2(controllers);
        for (String item : WowCollections.split2(settings.get("application.controller.default","net.csdn.api.controller.SystemInfoController"), ",")) {
            try {
                moduleList.add(bindAction(Class.forName(item)));
            } catch (Exception e) {
                logger.error("load default controller error:" + e);
View Full Code Here

TOP

Related Classes of net.csdn.filter.FilterEnhancer

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.