public void contextInitialized(ServletContextEvent sce) { context = sce.getServletContext(); // Use JVM properties as external config setConfig(System.getProperties()); // Initialise the registerable drivers try { mountContexts.put("classpath", new ClassPathMountFactory(context.getClassLoader())); mountContexts.put("file", new FileMountFactory(Utils.getCurrentDirectory())); mountContexts.put("war", new WarMountFactory(context)); } catch (Exception e) { log.log(Level.SEVERE, "Coult not initialize classpath driver", e); return; } // String contextPath = context.getContextPath(); synchronized (lock) { if (!contextMap.containsKey(contextPath)) { ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader(); PluginDiscovery discovery = createDiscovery(context, webAppLoader); PluginContext pluginContext = start(new ServletContextMap(context), discovery, context.getClassLoader()); contextMap.put(contextPath, pluginContext); registered = true; } } }
public void contextInitialized(ServletContextEvent sce) { ServletContext context = sce.getServletContext(); String contextPath = context.getContextPath(); // Use JVM properties as external config setConfig(System.getProperties()); // synchronized (lock) { if (!contextMap.containsKey(contextPath)) { // FS cmdFS = createCommandFS(context); FS confFS = createConfFS(context); ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader(); // PluginContext pluginContext = new PluginContext( createDiscovery(context, webAppLoader), new ServletContextMap(context), cmdFS, confFS, webAppLoader); // contextMap.put(contextPath, pluginContext); registered = true; // start(pluginContext); } } }
public void contextInitialized(ServletContextEvent sce) { context = sce.getServletContext(); // Use JVM properties as external config setConfig(System.getProperties()); // Initialise the registerable drivers try { mountContexts.put("classpath", new ClassPathMountFactory(context.getClassLoader())); mountContexts.put("file", new FileMountFactory(Utils.getCurrentDirectory())); mountContexts.put("war", new WarMountFactory(context)); } catch (Exception e) { log.log(Level.SEVERE, "Coult not initialize classpath driver", e); return; } // String contextPath = context.getContextPath(); synchronized (lock) { if (!contextMap.containsKey(contextPath)) { ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader(); PluginDiscovery discovery = createDiscovery(context, webAppLoader); PluginContext pluginContext = start(new ServletContextMap(context), discovery, context.getClassLoader()); contextMap.put(contextPath, pluginContext); registered = true; } } }
public void contextInitialized(ServletContextEvent sce) { context = sce.getServletContext(); // Use JVM properties as external config setConfig(System.getProperties()); // Initialise the registerable drivers try { mountContexts.put("classpath", new ClassPathMountFactory(context.getClassLoader())); mountContexts.put("file", new FileMountFactory(Utils.getCurrentDirectory())); mountContexts.put("war", new WarMountFactory(context)); } catch (Exception e) { log.log(Level.SEVERE, "Coult not initialize classpath driver", e); return; } // String contextPath = context.getContextPath(); synchronized (lock) { if (!contextMap.containsKey(contextPath)) { ClassLoader webAppLoader = Thread.currentThread().getContextClassLoader(); PluginDiscovery discovery = createDiscovery(context, webAppLoader); PluginContext pluginContext = start(new ServletContextMap(context), discovery, context.getClassLoader()); contextMap.put(contextPath, pluginContext); registered = true; } } }