Equinox 是 Eclipse 基金會提供的 OSGi R4 核心框架實現。Eclipse 3.0 將內核遷移至 OSGi,憑藉強大的 Bundle 生命週期管理、服務動態交互能力,實現跳躍式發展。OSGi 亦因 Eclipse 巨大用戶群進入快速發展期。本系列以 Equinox 為基礎,講解基於 OSGi 的應用開發。
startup.jar 遷移為 Fragment,建立類加載路徑、運行配置參數等環境。eclipse.exe,原生啟動器,部分功能下沉至 launcher 共享 DLL。Equinox 提供大部分 R4 標準服務,並擴展 Eclipse 特有工具類:
| Bundle | 服務 | 備註 |
|---|---|---|
| org.eclipse.equinox.log | Log Service | 標準日志服務 |
| org.eclipse.equinox.event | Event Admin Service | 事件管理 |
| org.eclipse.equinox.http | HTTP Service | 支援 Servlet 2.3 |
| org.eclipse.equinox.ds | Declarative Services | Prosyst 實現,宣告式服務 |
| org.eclipse.equinox.metatype | Metatype Service | 元類型描述 |
| org.eclipse.equinox.preferences | Preferences Service | 偏好設置 |
| org.eclipse.equinox.registry | Extension Registry | Eclipse 擴展點註冊表 |
| org.eclipse.equinox.useradmin | User Admin Service | 用戶管理 |
| org.eclipse.equinox.wireadmin | Wire Admin Service | 服務通信拓撲管理 |
| org.eclipse.osgi.services | OSGi Services API | 聯盟定義標準介面 |
| org.eclipse.osgi.util | OSGi Utilities | 工具類介面與實現 |
Equinox 推動 OSGi 進入 J2EE 領域:
http、http.registry、servletbridge、http.servlet、http.servletbridge、javax.servlet、javax.servlet.jsp、org.mortbay.jetty、org.eclipse.equinox.http.jetty — 支援 JSP/Servlet/Struts 運行於 Equinox,或將 Equinox 嵌入 Tomcat/Jetty/WebSphere/WebLogic。Eclipse 插件分組/更新/遠程維護機制遷移至 OSGi 環境,稱為 equinox p2。Eclipse 3.4 整合發布,支援遠程更新站點安裝/升級功能。
JSR 291 推動 OSGi 納入 Java SE 標準,未來開發者可在基礎編程中直接使用 OSGi 動態模塊化能力。Equinox 源碼位於 Eclipse CVS org.eclipse.equinox.* 及 equinox-incubator。