this.version = version; this.started = false; this.manager = new PluginManager(this, discovery); this.executor = executor; this.scanner = scanner;
/** * Returns the plugins associated with this context. * * @param pluginType the plugin type * @param <T> the plugin generic type * @return the plugins */ public <T> Iterable<T> getPlugins(Class<T> pluginType) { return manager.getPlugins(pluginType); }
synchronized void stop() { // if (started) { // Shutdown manager manager.shutdown(); // Shutdown scanner if (scannerFuture != null) { scannerFuture.cancel(true); } // scanner.shutdownNow(); // Shutdown executor executor.shutdownNow(); } else { log.log(Level.WARNING, "Attempt to stop when stopped"); } } }
public Iterable<CRaSHPlugin<?>> getPlugins() { return manager.getPlugins(); }
synchronized void stop() { // if (started) { // Shutdown manager manager.shutdown(); // Shutdown scanner if (scannerFuture != null) { scannerFuture.cancel(true); } // scanner.shutdownNow(); // Shutdown executor executor.shutdownNow(); } else { log.log(Level.WARNING, "Attempt to stop when stopped"); } } }
this.version = version; this.started = false; this.manager = new PluginManager(this, discovery); this.executor = executor; this.scanner = scanner;
/** * Returns the first plugin associated with this context implementing the specified type. * * @param pluginType the plugin type * @param <T> the plugin generic type * @return the plugins */ public <T> T getPlugin(Class<T> pluginType) { Iterator<T> plugins = manager.getPlugins(pluginType).iterator(); return plugins.hasNext() ? plugins.next() : null; }
synchronized void stop() { // if (started) { // Shutdown manager manager.shutdown(); // Shutdown scanner if (scannerFuture != null) { scannerFuture.cancel(true); } // scanner.shutdownNow(); // Shutdown executor executor.shutdownNow(); } else { log.log(Level.WARNING, "Attempt to stop when stopped"); } } }
this.version = version; this.started = false; this.manager = new PluginManager(this, discovery); this.executor = executor; this.scanner = scanner;
synchronized void start() { if (!started) { // Start refresh Integer refreshRate = getProperty(PropertyDescriptor.VFS_REFRESH_PERIOD); TimeUnit timeUnit = getProperty(PropertyDescriptor.VFS_REFRESH_UNIT); if (refreshRate != null && refreshRate > 0) { TimeUnit tu = timeUnit != null ? timeUnit : TimeUnit.SECONDS; scannerFuture = scanner.scheduleWithFixedDelay(new Runnable() { public void run() { refresh(); } }, 0, refreshRate, tu); } // Init plugins manager.getPlugins(Object.class); // started = true; } else { log.log(Level.WARNING, "Attempt to double start"); } }
synchronized void stop() { // if (started) { // Shutdown manager manager.shutdown(); // Shutdown scanner if (scannerFuture != null) { scannerFuture.cancel(true); } // scanner.shutdownNow(); // Shutdown executor executor.shutdownNow(); } else { log.log(Level.WARNING, "Attempt to stop when stopped"); } } }
this.version = version; this.started = false; this.manager = new PluginManager(this, discovery); this.executor = executor; this.scanner = scanner;
synchronized <T> Iterable<T> getPlugins(Class<T> wantedType) { Iterable<CRaSHPlugin<?>> plugins = getPlugins();
for (final CRaSHPlugin<?> plugin : context.manager.getPlugins()) { Iterable<PropertyDescriptor<?>> capabilities = plugin.getConfigurationCapabilities(); Iterator<PropertyDescriptor<?>> i = capabilities.iterator();
/** * Returns the plugins associated with this context. * * @param pluginType the plugin type * @param <T> the plugin generic type * @return the plugins */ public <T> Iterable<T> getPlugins(Class<T> pluginType) { return manager.getPlugins(pluginType); }
/** * Returns the plugins associated with this context. * * @param pluginType the plugin type * @param <T> the plugin generic type * @return the plugins */ public <T> Iterable<T> getPlugins(Class<T> pluginType) { return manager.getPlugins(pluginType); }
/** * Returns the plugins associated with this context. * * @param pluginType the plugin type * @param <T> the plugin generic type * @return the plugins */ public <T> Iterable<T> getPlugins(Class<T> pluginType) { return manager.getPlugins(pluginType); }
public Iterable<CRaSHPlugin<?>> getPlugins() { return manager.getPlugins(); }
public Iterable<CRaSHPlugin<?>> getPlugins() { return manager.getPlugins(); }
public Iterable<CRaSHPlugin<?>> getPlugins() { return manager.getPlugins(); }