void registerHooks(HookRegistry hookRegistry) { // only register if sharing is enabled if (!Shared.isSharingEnabled()) { return; } hookRegistry.addClassLoaderHook(this); hookRegistry.addBundleFileWrapperFactoryHook(this); } }
/** * Initializes the hook configurators. The following steps are used to initialize the hook configurators. <p> * 1. Get a list of hook configurators from all hook configurators properties files on the classpath, * add this list to the overall list of hook configurators, remove duplicates. <p> * 2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property * and add this list to the overall list of hook configurators, remove duplicates. <p> * 3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property * and remove this list from the overall list of hook configurators. <p> * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> */ public void initialize() { List<String> configurators = new ArrayList<String>(5); List<FrameworkLogEntry> errors = new ArrayList<FrameworkLogEntry>(0); // optimistic that no errors will occur mergeFileHookConfigurators(configurators, errors); mergePropertyHookConfigurators(configurators); synchronized (this) { addClassLoaderHook(new DevClassLoadingHook(container.getConfiguration())); addClassLoaderHook(new EclipseLazyStarter(container)); addClassLoaderHook(new WeavingHookConfigurator(container)); configurators.add(SignedBundleHook.class.getName()); loadConfigurators(configurators, errors); // set to read-only initialized = true; } for (FrameworkLogEntry error : errors) { container.getLogServices().getFrameworkLog().log(error); } }
/** * Initializes the hook configurators. The following steps are used to initialize the hook configurators. <p> * 1. Get a list of hook configurators from all hook configurators properties files on the classpath, * add this list to the overall list of hook configurators, remove duplicates. <p> * 2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property * and add this list to the overall list of hook configurators, remove duplicates. <p> * 3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property * and remove this list from the overall list of hook configurators. <p> * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> */ public void initialize() { List<String> configurators = new ArrayList<String>(5); List<FrameworkLogEntry> errors = new ArrayList<FrameworkLogEntry>(0); // optimistic that no errors will occur mergeFileHookConfigurators(configurators, errors); mergePropertyHookConfigurators(configurators); synchronized (this) { addClassLoaderHook(new DevClassLoadingHook(container.getConfiguration())); addClassLoaderHook(new EclipseLazyStarter(container)); addClassLoaderHook(new WeavingHookConfigurator(container)); configurators.add(SignedBundleHook.class.getName()); loadConfigurators(configurators, errors); // set to read-only initialized = true; } for (FrameworkLogEntry error : errors) { container.getLogServices().getFrameworkLog().log(error); } }
/** * Initializes the hook configurators. The following steps are used to initialize the hook configurators. <p> * 1. Get a list of hook configurators from all hook configurators properties files on the classpath, * add this list to the overall list of hook configurators, remove duplicates. <p> * 2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property * and add this list to the overall list of hook configurators, remove duplicates. <p> * 3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property * and remove this list from the overall list of hook configurators. <p> * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> */ public void initialize() { List<String> configurators = new ArrayList<>(5); List<FrameworkLogEntry> errors = new ArrayList<>(0); // optimistic that no errors will occur mergeFileHookConfigurators(configurators, errors); mergePropertyHookConfigurators(configurators); synchronized (this) { addClassLoaderHook(new DevClassLoadingHook(container.getConfiguration())); addClassLoaderHook(new EclipseLazyStarter(container)); addClassLoaderHook(new WeavingHookConfigurator(container)); configurators.add(SignedBundleHook.class.getName()); configurators.add(CDSHookConfigurator.class.getName()); loadConfigurators(configurators, errors); // set to read-only initialized = true; } for (FrameworkLogEntry error : errors) { container.getLogServices().getFrameworkLog().log(error); } }
/** * Initializes the hook configurators. The following steps are used to initialize the hook configurators. <p> * 1. Get a list of hook configurators from all hook configurators properties files on the classpath, * add this list to the overall list of hook configurators, remove duplicates. <p> * 2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property * and add this list to the overall list of hook configurators, remove duplicates. <p> * 3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property * and remove this list from the overall list of hook configurators. <p> * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> */ public void initialize() { List<String> configurators = new ArrayList<String>(5); List<FrameworkLogEntry> errors = new ArrayList<FrameworkLogEntry>(0); // optimistic that no errors will occur mergeFileHookConfigurators(configurators, errors); mergePropertyHookConfigurators(configurators); synchronized (this) { addClassLoaderHook(new DevClassLoadingHook(container.getConfiguration())); addClassLoaderHook(new EclipseLazyStarter(container)); addClassLoaderHook(new WeavingHookConfigurator(container)); configurators.add(SignedBundleHook.class.getName()); loadConfigurators(configurators, errors); // set to read-only initialized = true; } for (FrameworkLogEntry error : errors) { container.getLogServices().getFrameworkLog().log(error); } }
/** * Initializes the hook configurators. The following steps are used to initialize the hook configurators. <p> * 1. Get a list of hook configurators from all hook configurators properties files on the classpath, * add this list to the overall list of hook configurators, remove duplicates. <p> * 2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property * and add this list to the overall list of hook configurators, remove duplicates. <p> * 3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property * and remove this list from the overall list of hook configurators. <p> * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> */ public void initialize() { List<String> configurators = new ArrayList<>(5); List<FrameworkLogEntry> errors = new ArrayList<>(0); // optimistic that no errors will occur mergeFileHookConfigurators(configurators, errors); mergePropertyHookConfigurators(configurators); synchronized (this) { addClassLoaderHook(new DevClassLoadingHook(container.getConfiguration())); addClassLoaderHook(new EclipseLazyStarter(container)); addClassLoaderHook(new WeavingHookConfigurator(container)); configurators.add(SignedBundleHook.class.getName()); loadConfigurators(configurators, errors); // set to read-only initialized = true; } for (FrameworkLogEntry error : errors) { container.getLogServices().getFrameworkLog().log(error); } }
/** * Initializes the hook configurators. The following steps are used to initialize the hook configurators. <p> * 1. Get a list of hook configurators from all hook configurators properties files on the classpath, * add this list to the overall list of hook configurators, remove duplicates. <p> * 2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property * and add this list to the overall list of hook configurators, remove duplicates. <p> * 3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property * and remove this list from the overall list of hook configurators. <p> * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> */ public void initialize() { List<String> configurators = new ArrayList<String>(5); List<FrameworkLogEntry> errors = new ArrayList<FrameworkLogEntry>(0); // optimistic that no errors will occur mergeFileHookConfigurators(configurators, errors); mergePropertyHookConfigurators(configurators); synchronized (this) { addClassLoaderHook(new DevClassLoadingHook(container.getConfiguration())); addClassLoaderHook(new EclipseLazyStarter(container)); addClassLoaderHook(new WeavingHookConfigurator(container)); configurators.add(SignedBundleHook.class.getName()); loadConfigurators(configurators, errors); // set to read-only initialized = true; } for (FrameworkLogEntry error : errors) { container.getLogServices().getFrameworkLog().log(error); } }