EclipseRT
Transkrypt
EclipseRT
An Introduction to EclipseRT and OSGi Chris Aniszczyk Principal Software Engineer [email protected] http://twitter.com/caniszczyk June 23, 2008 Confidential | Date | Other Information, if necessary © 2002 IBM Corporation Agenda OSGi and an Eclipse History Lesson EclipseRT Toast Stackless Stacks, Equinox and CODA Summary Q&A Agenda OSGi and an Eclipse History Lesson EclipseRT Toast Stackless Stacks, Equinox and CODA Summary Q&A OSGi in 10 minutes... • The dynamic module system for java • What’s a module? “Modular programming is a software design technique that increases the extent to which software is composed from separate parts, called modules. Conceptually, modules represent a separation of concerns, and improve maintainability by enforcing logical boundaries between components.” JARs != Modules • JARs are deployment artifacts • JARs have dependencies • They are not modules... missing crucial information identifier (file name isn’t good enough) version vendor exports dependencies ;( How does OSGI help? • OSGi Bundle == Module • Just a JAR with module related metadata identifier version vendor exports dependencies (imports) ;) Community of Bundles OSGi Application Bundle A Bundle D Bundle X Bundle Z Bundle C Bundle B Bundle G Bundle E Bundle F Bundle Y Bundle H Bundles, Metadata and the MANIFEST.MF Manifest-Version: 1.0 Bundle-ClassPath: junit.jar Bundle-Vendor: Eclipse.org Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.3 Bundle-Name: JUnit3 Bundle-SymbolicName: org.junit Export-Package: junit.awtui;version="3.8.2",junit.extensions;version=" 3.8.2",junit.framework;version="3.8.2",junit.runner;version="3.8.2",j unit.swingui;version="3.8.2",junit.swingui.icons;version="3.8.2",juni t.textui;version="3.8.2" Bundle-Version: 3.8.2.v20090203-1005 Bundle-ManifestVersion: 2 Quick Toast Demo - Modularity in Action OSGi in Details • OSGi Alliance o Worldwide consortium of technology innovators that advances OSGi technology • OSGi Technology o o Set of specifications that define a module system for Java Enables modular programming for Java • Originally designed for embedded systems... o Home automation... set-top boxes... vehicles... • Now in widespread use in desktop and servers... OSGi Alliance • An open standards organization founded in March 1999 Founded by Ericsson, IBM, Motorola and Sun Microsystems • Five expert groups that produce specifications Core Platform Enterprise Mobile Vehicle Residential • Now ~100 members IBM, Oracle, Tibco, Siemens, SAP, Motorola, Red Hat... OSGi Technology • Bundles OSGi modules made by the developers • Services Connects bundles in a dynamic way by offering a publish-find-bind model • Life Cycle API to install, start, stop, update and uninstall bundles • Modules Defines how a bundle can import and export code • Security Handles the security aspects, think permissions • Execution Environment Defines what methods and classes are available in a specific platform OSGi API: BundleContext • Represents the system • Unique context supplied to each bundle • Find, register services • Install bundles • Register listeners • Get properties OSGi API: BundleActivator • No main() • Each bundle is self-contained • Some need initialization HTTP bundle might start server on port 80 • Implement start() and stop() • Can be called at any time on any thread Bundle Lifecycle • OSGi is dynamic • Bundles can come and go! OSGi Specifications • Two major specifications • Core Specifications Covers the core layers of OSGi • Service Compendium Contains a variety of useful services OSGi Specification Releases • OSGi Release 1 (R1): May 2000 • OSGi Release 2 (R2): October 2001 • OSGi Release 3 (R3): March 2003 • OSGi Release 4 (R4): October 2005 Core Specification (R4 Core): October 2005 Mobile Specification (R4 Mobile / JSR-232): September 2006 • OSGi Release 4.1 (R4.1): May 2007 (AKA JSR-291) • OSGi Release 4.1 (R4.2): (Summer 2009) • OSGi EEG spec coming in 4Q09 OSGi Frameworks • There’s a lot of OSGi framework implementations... OSGi Framework Implementations • Equinox (open source) Reference implementation for the core framework and various services Base runtime for EclipseRT • Felix (open source) Implementation developed at Apache Ships with GlassFish • Knopflerfish (open source) BSD license • Concierge (open source) Highly optimized and tiny R3 implementation Runs in tiny devices • Many other commercial and private implementations How does this relate to Eclipse? • Eclipse had its own non-standard plug-in model • OSGi and old Eclipse plug-in model were similar What happened? • The world didn’t need two modular systems • Eclipse went to OSGi in 3.0 with Equinox* o o Eclipse needed something robust and standard Put OSGi on the map! *http://portal.acm.org/citation.cfm?id=1086616 Agenda OSGi and an Eclipse History Lesson EclipseRT Toast Stackless Stacks, Equinox and CODA Summary Q&A Eclipse? Enterprise? Runtimes? What? Eclipse is a trusted source of development tools However, Eclipse is more than just tools! There are 100+ Eclipse.org projects Eclipse provides a wide selection of... Runtime Containers Middleware Enterprise Frameworks What is EclipseRT? EclipseRT is the name given to the runtime projects http://eclipse.org/eclipsert/whitepaper/eclipseRT.php EclipseRT-related Projects at Eclipse.org Equinox Riena RAP EMF++ BIRT EclipseLink ECF Gemini eRCP Swordfish Jetty GEF SMILA e4 Higgins Virgo http://www.eclipse.org/projects EclipseRT - UI Layers RCP and Riena for the desktop RAP for the web EclipseRT - Runtimes Equinox Jetty Virgo (formerly SpringDM) EclipseRT - Persistence EclipseLink (formerly known as TopLink) EclipseRT - BI / Reporting Business Intelligence and Reporting Tools (BIRT) Common Denominator? It’s all OSGi based! http://www.osgi.org Infrastructure-related projects Modular philosophy Realizing Eclipse value, in runtimes EclipseRT Adopters Jazz SpringDM (Gemini) SAP GlassFish Oracle JP Morgan Lotus NASA Infor Websphere US Army ... http://eclipse.org/eclipsert/case_studies/case_studies.php The Software Landscape How did we get here? Software complexity and skyscrapers Developers will specialize further in order to cope with the complexity of the systems they build Lack of a common component model hurt us... Solid foundations and frameworks will save us Agenda OSGi and an Eclipse History Lesson EclipseRT Toast Stackless Stacks, Equinox and CODA Summary Q&A Toast Overview • Fleet management system • Client = Vehicle head unit • Server = Backend business logic/data Vehicle discovery/tracking Dynamic provisioning Emergency reporting Remote control Google Earth/Maps Open source Extensible client UI Lots of opportunities • Full version open source at Eclipse http://wiki.eclipse.org/Toast Toast Modules Toast Modules http://wiki.eclipse.org/Toast Technology in Toast Equinox p2 ECF BIRT RCP RAP Jetty EclipseLink http://wiki.eclipse.org/Toast Derby Amazon EC2 SLP Twitter JavaScript Google Earth Agenda OSGi and an Eclipse History Lesson EclipseRT Toast Stackless Stacks, Equinox and CODA Summary Q&A What makes Toast possible? OSGi and Equinox Modularity API CODA Monolithic Middleware and Stackless Stacks Traditional middleware is monolithic; a comfortable place to run applications but comes with a lot of baggage Ideally, you only want to run what you need EclipseRT allows you to specialize your own enterprise stack based on your needs via Equinox and OSGi http://www.redmonk.com/jgovernor/2008/02/05/osgi-and-the-rise-of-the-stackless-stack-just-in-time/ OSGi and Equinox Equinox is an OSGi runtime framework implementation Equinox is the foundation of EclipseRT Equinox provides a common component model and runtime via OSGi Allows you to specialize the enterprise stack for your application’s needs We all this component oriented approach CODA... Component Oriented Development and Assembly Multiple Component Producers Customize Components Individual Solutions http://www.eclipse.org/equinox-portal/whitepaper/20080310_equinox.php Platforms Platforms are all about components EclipseRT and CODA enables you to build platforms Example: NASA and the Ensemble platform Agenda OSGi and an Eclipse History Lesson EclipseRT Toast Stackless Stacks, Equinox and CODA Summary Q&A Summary Eclipse is more than just a tools framework! Eclipse is evolving into runtimes via EclipseRT EclipseRT allows you to build your own stacks The tight integration between Eclipse tools and EclipseRT provides a great developer experience EclipseRT and CODA is the future of runtime technology at Eclipse http://www.eclipse.org/eclipsert Question and Answers?