public PluginContext start(final ClassLoader loader, final Properties props, final Map<String, Object> attributes, final Set<CRaSHPlugin<?>> plugins) throws IOException { FS conffs = newFS(CrashFSDriver.parse(loader, asList(new CrashPredicate("crash", ACCEPT)))); FS cmdfs = newFS(CrashFSDriver.parse(loader, asList( new CrashPredicate("cmd", ACCEPT), new CrashPredicate("org/jooby/crash", ACCEPT), new CrashPredicate("crash/commands", noneOf("jndi.groovy", "jdbc.groovy", "jpa.groovy", "jul.groovy"))))); setConfig(props); PluginContext ctx = new PluginContext(executor("crash"), scanner("crash-scanner"), () -> plugins, attributes, cmdfs, conffs, loader); ctx.refresh(); start(ctx); return ctx; }
/** * Create the plugin context, allow subclasses to customize it. * * @param discovery the plugin discovery * @return the plugin context */ protected PluginContext create(Map<String, Object> attributes, PluginDiscovery discovery, ClassLoader loader) { // FS cmdFS; FS confFS; try { cmdFS = createCommandFS(); confFS = createConfFS(); } catch (IOException e) { log.log(Level.SEVERE, "Coult not initialize the file system", e); return null; } // return new PluginContext(discovery, attributes, cmdFS, confFS, loader); }
PluginContext ctx = new PluginContext( new ServiceLoaderDiscovery(Thread.currentThread().getContextClassLoader()), Collections.<String, Object>emptyMap(),
/** * Trigger the boostrap. * * @throws Exception any exception that would prevent the bootstrap */ public void bootstrap() throws Exception { // The service loader discovery ServiceLoaderDiscovery discovery = new ServiceLoaderDiscovery(loader); // PluginContext context = new PluginContext( discovery, attributes, cmdFS, confFS, loader); // context.refresh(); // start(context); }
private TestPluginLifeCycle(PluginDiscovery discovery, ClassLoader classLoader) throws Exception { this.attributes = new HashMap<String, Object>(); this.commands = new RAMDriver(); this.context = new PluginContext( discovery, attributes, new FS().mount(classLoader,Path.get("/crash/commands/")).mount(commands), new FS().mount(classLoader,Path.get("/crash/")), classLoader); this.crash = new CRaSH(context); }
/** * Create the plugin context, allow subclasses to customize it. * * @param discovery the plugin discovery * @return the plugin context */ protected PluginContext create(Map<String, Object> attributes, PluginDiscovery discovery, ClassLoader loader) { // FS cmdFS; FS confFS; try { cmdFS = createCommandFS(); confFS = createConfFS(); } catch (IOException e) { log.log(Level.SEVERE, "Coult not initialize the file system", e); return null; } // return new PluginContext(discovery, attributes, cmdFS, confFS, loader); }
/** * Create the plugin context, allow subclasses to customize it. * * @param discovery the plugin discovery * @return the plugin context */ protected PluginContext create(Map<String, Object> attributes, PluginDiscovery discovery, ClassLoader loader) { // FS cmdFS; FS confFS; try { cmdFS = createCommandFS(); confFS = createConfFS(); } catch (IOException e) { log.log(Level.SEVERE, "Coult not initialize the file system", e); return null; } // return new PluginContext(discovery, attributes, cmdFS, confFS, loader); }
PluginContext ctx = new PluginContext( new ServiceLoaderDiscovery(Thread.currentThread().getContextClassLoader()), Collections.<String, Object>emptyMap(),
/** * Trigger the boostrap. * * @throws Exception any exception that would prevent the bootstrap */ public void bootstrap() throws Exception { // The service loader discovery ServiceLoaderDiscovery discovery = new ServiceLoaderDiscovery(loader); // PluginContext context = new PluginContext( discovery, attributes, cmdFS, confFS, loader); // context.refresh(); // start(context); }
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); } } }
/** * Trigger the boostrap. * * @throws Exception any exception that would prevent the bootstrap */ public void bootstrap() throws Exception { // The service loader discovery ServiceLoaderDiscovery discovery = new ServiceLoaderDiscovery(loader); // PluginContext context = new PluginContext( discovery, attributes, cmdFS, confFS, loader); // context.refresh(); // start(context); }
/** * Trigger the boostrap. * * @throws Exception any exception that would prevent the bootstrap */ public void bootstrap() throws Exception { // The service loader discovery ServiceLoaderDiscovery discovery = new ServiceLoaderDiscovery(loader); // PluginContext context = new PluginContext( discovery, attributes, cmdFS, confFS, loader); // context.refresh(); // start(context); }
public void afterPropertiesSet() throws Exception { // List beans Map<String,Object> attributes = new HashMap<String, Object>(); attributes.put("factory", factory); if (factory instanceof ListableBeanFactory) { ListableBeanFactory listable = (ListableBeanFactory)factory; attributes.put("beans", new SpringMap(listable)); } // PluginDiscovery discovery = new SpringPluginDiscovery(loader, factory); // FS cmdFS = createCommandFS(); // FS confFS = createConfFS(); // PluginContext context = new PluginContext( discovery, Collections.unmodifiableMap(attributes), cmdFS, confFS, loader); // context.refresh(); // start(context); }
PluginContext ctx = new PluginContext( new ServiceLoaderDiscovery(Thread.currentThread().getContextClassLoader()), Collections.<String, Object>emptyMap(),