快速业务通道

Eclipse插件Lazy Start实现原理分析 - 编程入门网

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-06-15
configurators, remove duplicates. <p> 5   * 2. Get a list of hook configurators from the (&quot;osgi.hook.configurators.include&quot;) system property 6   *  and add this list to the overall list of hook configurators, remove duplicates. <p> 7   * 3. Get a list of hook configurators from the (&quot;osgi.hook.configurators.exclude&quot;) system property 8   *  and remove this list from the overall list of hook configurators. <p> 9   * 4. Load each hook configurator class, create a new instance, then call the {@link HookConfigurator#addHooks(HookRegistry)} method <p> 10   * 5. Set this HookRegistry object to read only to prevent any other hooks from being added. <p> 11   * @return an array of error log entries that occurred while initializing the hooks 12   */ 13   public FrameworkLogEntry[] initialize() { 14     ArrayList configurators = new ArrayList(5); 15     ArrayList errors = new ArrayList(0); // optimistic that no errors will occur 16     mergeFileHookConfigurators(configurators, errors); 17     mergePropertyHookConfigurators(configurators); 18     loadConfigurators(configurators, errors); 19     // set to read-only 20     readonly = true; 21     return (FrameworkLogEntry[]) errors.toArray(new FrameworkLogEntry[errors.size ()]); 22   }

Eclipse插件Lazy Start实现原理分析(5)

时间:2011-08-13 朱兴

其中的mergeFileHookConfigurators方法调用,读取了一个名为hookconfigurators.properties的属 性配置文件,在org.eclipse.osgi插件中。看一下里面的内容:

1 ############################################################################### 2 # Copyright (c) 2005, 2006 IBM Corporation and others. 3 # All rights reserved. This program and the accompanying materials 4 # are made available under the terms of the Eclipse Public License v1.0 5 # which accompanies this distribution, and is available at 6 # http://www.eclipse.org/legal/epl-v10.html 7 # 8 # Contributors: 9 # IBM Corporation - initial API and implementation 10 ############################################################################### 11 hook.configurators= \ 12 org.eclipse.osgi.internal.baseadaptor.BaseHookConfigurator,\ 13 org.eclipse.osgi.internal.baseadaptor.DevClassLoadingHook,\ 14 org.eclipse.core.runtime.internal.adaptor.EclipseStorageHook,\ 15 org.eclipse.core.runtime.internal.adaptor.EclipseLogHook,\ 16 org.eclipse.core.runtime.internal.adaptor.EclipseErrorHandler,\ 17 org.eclipse.core.runtime.internal.adaptor.EclipseAdaptorHook,\ 18 org.eclipse.core.runtime.internal.adaptor.EclipseClassLoadingHook,\ 19 org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter,\ 20 org.eclipse.core.runtime.internal.stats.StatsManager,\ 21 org.eclipse.osgi.internal.verifier.SignedBundleHook 22

^_^,我们的EclipseLazyStarter赫然在列!!!

回过头来看一下EclipseLazyStarter(继承ClassLoadingStatsHook)的使用方式:

BaseAdaptor.getHookRegistry().getClassLoadingStatsHooks()

前面已经看了Classpath

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号