001    package com.khubla.pragmatach.framework.application;
002    
003    import com.khubla.pragmatach.framework.api.Configuration;
004    import com.khubla.pragmatach.framework.api.PragmatachException;
005    import com.khubla.pragmatach.framework.controller.Controllers;
006    import com.khubla.pragmatach.framework.lifecycle.LifecycleListeners;
007    import com.khubla.pragmatach.framework.router.PragmatachRoutes;
008    
009    /**
010     * @author tome
011     */
012    public class Application {
013       /**
014        * configuration
015        */
016       private static Configuration configuration;
017       /**
018        * lifecycle listeners
019        */
020       private static final LifecycleListeners lifecycleListeners = new LifecycleListeners();
021    
022       public static Configuration getConfiguration() {
023          return configuration;
024       }
025    
026       /**
027        * get all known controllers
028        */
029       public static Controllers getControllers() {
030          return Controllers.getInstance();
031       }
032    
033       public static LifecycleListeners getLifecyclelisteners() {
034          return lifecycleListeners;
035       }
036    
037       /**
038        * get all known routes
039        */
040       public static PragmatachRoutes getRoutes() throws PragmatachException {
041          return PragmatachRoutes.getInstance();
042       }
043    
044       public static void setConfiguration(Configuration configuration) {
045          Application.configuration = configuration;
046       }
047    }