public WebResourceManagerImpl(final WebResourceAssemblerFactory webResourceAssemblerFactory, final LegacyPageBuilderService pageBuilderService, final PluginResourceLocator pluginResourceLocator, final WebResourceIntegration webResourceIntegration, final WebResourceUrlProvider webResourceUrlProvider, final ResourceBatchingConfiguration batchingConfiguration, final ResourceDependencyResolver resourceDependencyResolver) { this.webResourceAssemblerFactory = notNull("webResourceAssemblerFactory", webResourceAssemblerFactory); this.pageBuilderService = notNull("pageBuilderService", pageBuilderService); this.webResourceIntegration = notNull("webResourceIntegration", webResourceIntegration); this.webResourceUrlProvider = notNull("webResourceUrlProvider", webResourceUrlProvider); }
/** * @throws IllegalArgumentException if the moduleClass is <code>null</code> */ public ModuleOfClassPredicate(final Class<T> moduleClass) { this.moduleClass = notNull("moduleClass", moduleClass); }
/** * Delegate all event publication to the supplied {@code EventPublisher}. */ public DefaultPluginEventManager(final EventPublisher eventPublisher) { this.eventPublisher = notNull("eventPublisher", eventPublisher); }
/** * Sets the package scanner configuration instance that contains information about what packages to expose to plugins. * * @param packageScannerConfiguration The configuration instance * @return this */ public PluginsConfigurationBuilder packageScannerConfiguration(final PackageScannerConfiguration packageScannerConfiguration) { this.packageScannerConfiguration = notNull("packageScannerConfiguration", packageScannerConfiguration); return this; }
public SinglePluginLoader(final String resource) { this.resource = notNull("resource", resource); url = null; }
/** * Sets the host component provider instance, used for registering application services as OSGi services so that * they can be automatically available to plugins * * @param hostComponentProvider The host component provider implementation * @return this */ public PluginsConfigurationBuilder hostComponentProvider(final HostComponentProvider hostComponentProvider) { this.hostComponentProvider = notNull("hostComponentProvider", hostComponentProvider); return this; }
public SinglePluginLoader(final URL url) { this.url = notNull("url", url); resource = null; }
public ProductPluginAccessorBase(final PluginRegistry.ReadOnly pluginRegistry, final PluginPersistentStateStore store, final ModuleDescriptorFactory moduleDescriptorFactory, final PluginEventManager pluginEventManager) { this.pluginRegistry = pluginRegistry; this.moduleDescriptorFactory = notNull("ModuleDescriptorFactory", moduleDescriptorFactory); this.classLoader = new PluginsClassLoader(null, this, pluginEventManager); this.store = notNull("PluginPersistentStateStore", store); }
public SpringHostComponentProvider(BeanFactory beanFactory, Set<String> beanNames, Map<String, Class[]> beanInterfaces, Map<String, ContextClassLoaderStrategy> beanContextClassLoaderStrategies, Set<String> bundleTrackingBeans, boolean useAnnotation) { this.beanFactory = notNull("beanFactory", beanFactory); this.useAnnotation = useAnnotation; this.beanNames = beanNames != null ? beanNames : new HashSet<>(); this.beanInterfaces = beanInterfaces != null ? beanInterfaces : new HashMap<>(); this.beanContextClassLoaderStrategies = beanContextClassLoaderStrategies != null ? beanContextClassLoaderStrategies : new HashMap<>(); this.bundleTrackingBeans = bundleTrackingBeans != null ? bundleTrackingBeans : new HashSet<>(); }
/** * @param parent The parent classloader * @param pluginAccessor The plugin accessor * @param pluginEventManager The plugin event manager * @since 2.5.0 */ public PluginsClassLoader(final ClassLoader parent, final PluginAccessor pluginAccessor, PluginEventManager pluginEventManager) { super(parent); this.parentClassLoader = parent; this.pluginAccessor = notNull("pluginAccessor", pluginAccessor); pluginEventManager.register(this); }
@Override public Plugin getPlugin(final String key) { return pluginRegistry.get(notNull("Plugin key ", key)); }
public WebSection build() { return new WebSectionImpl(fragmentBuilder.completeKey, fragmentBuilder.label, fragmentBuilder.title, fragmentBuilder.styleClass, fragmentBuilder.id, fragmentBuilder.params, fragmentBuilder.weight, notNull("location", location)); } }
public WebItem build() { return new WebItemImpl(fragmentBuilder.completeKey, fragmentBuilder.label, fragmentBuilder.title, fragmentBuilder.styleClass, fragmentBuilder.id, fragmentBuilder.params, fragmentBuilder.weight, notNull("section", section), url, accessKey); } }
public void register(final Object listener) { eventPublisher.register(notNull("listener", listener)); }
@Override public <D extends ModuleDescriptor<?>> List<D> getEnabledModuleDescriptorsByClass(final Class<D> descriptorClazz) { notNull("Descriptor class", descriptorClazz); return getEnabledPlugins().stream() .flatMap(p -> p.getModuleDescriptors().stream()) .filter(descriptorClazz::isInstance) .filter(new EnabledModulePredicate()) .map(descriptorClazz::cast) .collect(Collectors.toList()); }
@Override public <M> Collection<ModuleDescriptor<M>> getModuleDescriptors(final Predicate<ModuleDescriptor<M>> predicate) { notNull("moduleDescriptorPredicate", predicate); return getModuleDescriptors(getPlugins(), predicate).collect(Collectors.toList()); }
@Override public <M> Collection<M> getModules(final Predicate<ModuleDescriptor<M>> predicate) { notNull("moduleDescriptorPredicate", predicate); return getModules(getModuleDescriptors(getPlugins(), predicate)) .collect(Collectors.toList()); }
public void broadcast(final Object event) throws NotificationException { notNull("event", event); try { eventPublisher.publish(event); } catch (final RuntimeException e) { throw new NotificationException(e); } }
@Override public boolean isPluginEnabled(final String key) throws IllegalArgumentException { final Plugin plugin = pluginRegistry.get(notNull("Plugin key", key)); return plugin != null && plugin.getPluginState() == PluginState.ENABLED; }
/** * This method checks to see if the plugin is enabled based on the state * manager and the plugin. * * @param key The plugin key * @return True if the plugin is enabled */ public boolean isPluginEnabled(final String key) { final Plugin plugin = pluginRegistry.get(notNull("The plugin key must be specified", key)); return plugin != null && plugin.getPluginState() == PluginState.ENABLED; }