Package vn.pyco.tinycms.services

Examples of vn.pyco.tinycms.services.BootManager


     * @see org.apache.tapestry5.services.ApplicationInitializerFilter#initializeApplication(org.apache.tapestry5.services.Context, org.apache.tapestry5.services.ApplicationInitializer)
     */
    @Override
    public void initializeApplication(Context context, ApplicationInitializer initializer) {
        // Init boot from boot file path
        BootManager bootManager = BootManager.getInstance();
        bootManager.setBootFilePath(context.getRealFile("/WEB-INF/boot.properties").getAbsolutePath());
       
        //handle DataInitializer
        if (bootManager.isSetup()) {
            List<DataInitializer> dataInitializers = new ArrayList<DataInitializer>();
            String[] beanNames = _appContext.getBeanNamesForType(DataInitializer.class);
            for (String beanName : beanNames) {
                dataInitializers.add((DataInitializer) _appContext.getBean(beanName));
            }
           
            dataInitializers = sortInitializers(dataInitializers);
            for (DataInitializer dataInitializer : dataInitializers) {
                try {
                    dataInitializer.initialize();
                } catch (Exception e) {
                    logger.error("An error ocurred when initilizing entities.", e);
                }
            }
           
            bootManager.setSetup(false);
            bootManager.save();
        }
       
        initializer.initializeApplication(context);
    }
View Full Code Here

TOP

Related Classes of vn.pyco.tinycms.services.BootManager

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.