public static void init(ServletConfig config) throws ServletException { GravityManager.start(config); }
/** * Parse gravity configuration (granite-config.xml), start gravity by using the specified factory and put it * in ServletContext. If Gravity is already started, returns the previous instance from the servlet context. * <br><br> * This method is intended to be used in {@link HttpServlet#init(ServletConfig)} methods only and * synchronizes on the current ServletContext instance. * * @param servletConfig the servlet config passed in HttpServlet.init(ServletConfig config) method. * @return a newly created and started Gravity instance or previously started one. * @throws ServletException if something goes wrong (GravityFactory not found, Gravity.start() error, etc.) */ public static Gravity start(ServletConfig servletConfig) throws ServletException { return start(servletConfig.getServletContext()); }
try { if (gravity == null) gravity = GravityManager.start(servletContextEvent.getServletContext());