• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries

on

  • 1,511 views

OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries (Ian Robinson - IBM)

OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries (Ian Robinson - IBM)

Statistics

Views

Total Views
1,511
Views on SlideShare
1,511
Embed Views
0

Actions

Likes
0
Downloads
21
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries Presentation Transcript

    • 00•05G 6 Community axe 2010 LONDON Event 2010 Enterprise OSGi in WebSphere and Apache Aries Ian Robinson, IBM
    • 29 Sep 2010 1 62605Gi Community Bowl 1010 Agenda OSGi and Java Enterprise – who needs who? The Culture Clash Apache Aries What’s Next in Aries and Enterprise OSGi? Aries and WebSphere Application Sever Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 2 62605Gi Community Bowl 1010 OSGi and Java Enterprise – who needs who? Direct dependency Java EE Web technologies Indirect (soft) dependency Optional dependencies Web Container Servlet JSP Service Metada Manag JavaM JASPI HTTP/ ement CDI & JACC JAXR JSTL JAX- JAX- JAX- RPC Web JMS SSL JPA EJB JSF JTA WS WS RS ail DI C ta s tation Anno StAX Com mon JCA Deb SAA JAF JAX ug s B J jpt. A IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP Enterprise APIs in Java SE (Required for Java EE) HTTP Session Replication Connection Management Persistence Providers User Registries Event Mgmt Admin Console Logging and Tracing MBean Server DataSources Messaging Engines Security and scripting HTTP Serving High Availability Transaction Logging Transport Channels Workload Management and routing Management and Recovery Thread management Classloading Provisioning Policy and SLA Monitoring Configuration mgmt … Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 3 05G1 kwo OSGi and Java Enterprise – who needs who? Three ways of looking at Enterprise OSGi technologies Applications 3 Enterprise Metadata and enterprise service-enablement 2 Services Java EE App Server Applications (bundles) Services Direct dependency Indirect (soft) dependency Java EE Web technologies Optional dependencies Web ContainerServlet JSP Life Cycle PI A S C JA Se JA JA J SL JS JS Ja JA JA eb ce ad JT an ag en JP EJ TL ail X- rvi P/ va W W X- X- et at DI DI M M R W M M m R S S S A C C X H S R P C S a e A B T T C & F s J t m m C C A A S A X o o n n n o a o n J s D t t t i e b u g A S A A F A X B J J J Module 1 IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP Enterprise APIs in Java SE (Required for Java EE) HTTP Session Replication Connection Management User Registries Event Mgmt Persistence Providers Java Execution Env Admin Console Logging and Tracing MBean Server DataSources essaging Engines Security M and scripting Transport Channels HTTP Serving High Availability Transaction Logging Workload Management and routing Management and Recovery OS + Hardware Thread management lassloading Provisioning C Policy and SLA Monitoring Configuration mgmt Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 4 12' 05G. Community Bowl 1010 The Culture Clash Java EE OSGi An application is a collection of There is no multi-bundle wars/jar modules scoped by an “application” scope other than an EAR OSGi framework Applications are isolated from Bundle exports are visible one another in a server throughout the framework Container-centric. Distinct All bundles are created equal. contracts for containers and applications Defines complete enterprise OSGi Enterprise Specification programming model (JTA, JPA, V4.2 defines services-based Web, JMX, Web, EJB, JAX-WS…) access to Java EE technologies Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 5 62605Gi Community Bowl 1010 OSGi Enterprise Specification Released 22 March 2010 – The product of the OSGi Enterprise Expert Group (EEG) Brings Enterprise technologies and OSGi together Using existing Java SE/EE specifications: – JTA, JPA, JNDI, JMX, WebApps… Plus Spring-derived Blueprint component model and DI container Java EE provides the core enterprise application programming model Deploying modules as OSGi bundles simplifies reuse between applications, provides versioning, encourages (and enforces) modular design and enables dynamic module updates. Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 6 62605Gi- Ezn Apache ARIES Enterprise OSGi in Apache Aries Apache Aries Project started in Sep 2009 http://incubator.apache.org/aries/ – Delivering a set of pluggable Java components enabling an enterprise OSGi application programming model. – Implementations and extensions of application-focused specifications defined by the OSGi Alliance Enterprise Expert Group (EEG) and an assembly format for multi-bundle applications, for deployment to a variety of OSGi based runtimes. – to build a broad development community to encourage implementation and adoption of EEG specs Just delivered 2nd (incubator) release. – OSGi Compliance Tests published for each release. Aries componentry supporting an enterprise OSGi programming model has been integrated into both Geronimo and WebSphere Application Server. – As well as Apache Felix Karaf, JBossOSGi and others Project was 1 year old last week Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 7 62605Gi Community Bowl 1010 Aries projects include… JMX JTA integration Blueprint container JPA integration JNDI integration Application assembly and deployment Samples, documentation, integrator’s guide http://svn.apache.org/repos/asf/incubator/aries/trunk/ Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 6'605G 8 Community Event 1 :10 jax,.., Aries JMX Integration Aries )MX Integration Implementation of OSGi JMXspecification. Implementation of OSGi JMX specification. o Aries JMX bundle automatically registers the JMX Aries JMX bundle automatically registers the JMX MBeans into any MBeans into any javax.management.MBeanServer service in the javax.management.MBeanServer service in the OSGi Service Registry. OSGi Service Registry. <<MBean>> «M3ean>> <<MBean>> «MBean>> <<MBean>> Fram ework Fram ework Bundle State Bund le State Blue print MB ean MBean MB ean MBean MB ean Framework MBeans 1111111111111111111111111111111111111111111111111111111111111111111 '1111111111111111 1111111111111111111111111111111111111111111111111 um ummummummummummummummum ll <<MBean>> <4V1Bean» PermissionAdmin PermissionAdrnin Permis sion O Compendium MBeans D.rrn:e Ad min MB ean MBean Serve MBean Server 91111111111111111111111111111111111111111111111111111111111111111111 JMX OSGi <<MBean>> Configur ation Admin O Additional Aries MBeans 111AV / —NC Cnnficriratinn Admin Manager !VIC 1 ICI 661 Co nfiguratio n W III 1151. PL./ 11 Ad min MB ean Ad min MBean .1111111111111111111111111111111111111111111111111111111111111111111 "I11111111111111111111111111111111111111111111111111111111111111111111 Provisioning Service 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1111.......... <<MBean>> «MBean» Provisioning Service Provisi onin g Provisi onin g ServiceMBean ServiceM Bean "mmimmimmimmimmimmimmimmimmimm """""""". """""""""""""""""""""""". User Admin <<MBean>> «M3ean>> <<MBean>> «MBean» <<MBean>> «MBean» User Adrrin Service St ate Service St ate Package St ate Package St ate User Adm in User Adm in MB ean MBean MB ean MBean MB ean MBean Immimmimmimmimmimmimmimmimmim ..... "111111111111111111111111111111111111111111111111111111111111111111111 1 11111111111111111111111111111111111111111111111111111111111111111111 Robinson Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 9 62605Gi Community Ewen! 2010 Aries JTA integration Apache Aries integrates the OSGi Transaction Service Ref Impl from Apache Geronimo. This spec is a good example of the [TA Provider XA Protocol 7 OSGi/Java EE ((interface» XAResource culture clash: User Transaction Transaction Manager Transaction Synchroni: ation Registry – Different services for application and an aged Application Imp! Application Container Impl -source onager Impl XA Resource Imp! container . 7* a resource specific service Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 10 62605Gi Carrfflnunity jax,.. Bowl 1010 OSGi Services – No Java EE analog bond e service bund:e S Services registered in Service Registry. Services are dynamic Clients (bundle B) need to cope with them going away There is no analog for dynamic services in Java EE. Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 11 12' 05G. Community Bowl 1010 Using Services can be hard private BundleContext ctx; private AtomicReference<LogService> ls = new AtomicReference<LogService>(); private AtomicReference<ServiceReference> lr = new AtomicReference<ServiceReference>(); public void start(BundleContext ctx) throws InvalidSyntaxException { this.ctx = ctx; ctx.addServiceListener(this, "(objectClass=org.osgi.service.log.LogService)"); ServiceReference ref = ctx.getServiceReference(LogService.class.getName()); if (ref != null) { ls.set((LogService) ctx.getService(ref)); lr.set(ref); } } @Override public void serviceChanged(ServiceEvent event) { ServiceReference ref = event.getServiceReference(); if (ls.get() == null && event.getType() == ServiceEvent.REGISTERED) { ls.set((LogService) ctx.getService(ref)); } else if (ls.get() != null && event.getType() == ServiceEvent.UNREGISTERING && ref == lr.get()) { ref = ctx.getServiceReference(LogService.class.getName()); if (ref != null) { ls.set((LogService) ctx.getService(ref)); lr.set(ref); } } } September 8th 2010 Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 •_ 12 62605G1 Carrfflnunity Bowl 1010 Blueprint Simplification <blueprint> <bean id=”shop” class=”org.example.ecomm.Bean”> <property name=”log”> <reference interface=”org.osgi.service.log.LogService”/> </property> </bean> </blueprint> public class Bean { private LogService log; void setLog(LogService logService) { log = logService; } void process(Order o) { log.log(LOG_INFO, “processing: “ + o); } } September 8th 2010 Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 13 62605Gi Community Bowl 1010 Aries Blueprint Container XML Blueprint definition describes component configuration and scope – Optionally publish and consume components to/from OSGi service registry. Simplifies unit test outside either Java EE or OSGi r/t. The Aries BP container implementation is highly extensible: – Namespace handlers supported to dependencies injected extend the Blueprint definitions consumes publishes service – Bean interceptors can be service registered by handlers OSGI-INF/blueprint/ Other Aries components contribute A static assembly blueprint.xml handlers – “jpa” and “jta” handlers. and configuration Blueprint bundle of components (POJOs) Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 14 62605Gi Community Bowl 1010 Aries Blueprint Extensions Container managed JPA support integrated with Aries Blueprint container: – @PersistenceUnit or @PersistenceContext (managed) – or <jpa:unit>, <jpa:context> bean property injection – Familiar development experience for JPA developers – Load-time enhancement of Entity classes (WebSphere) Same container managed transaction attributes as EJBs: – Required, RequiresNew, Mandatory, NotSupported, Supports, Never <blueprint> <bean id=”shop” class=”org.example.ecomm.ShopImpl”> <jpa:context property="em" unitname="myUnit"/> <tx:transaction method="*" value="Required"/> </bean> </blueprint> Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 15 62605Gi Community jax Bowl 1010 Aries JNDI integration Provides JNDI-based access to OSGi Service Registry <blueprint xmlns=...> <bean id="bloggingServiceComponent" class="org.apache.aries.BloggingServiceImpl"> </bean> <service ref="bloggingServiceComponent" interface="org.apache.aries.samples.blog.api.BloggingService"/> ... </blueprint> A way for a Web component to registerService OSGi Service Registry access a Blueprint component getService InitialContext ic = new InitialContext(); BloggingService blog= ic.lookup("osgi:services/" JNDI Context + BloggingService.class.getName()); Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 16 62605Gi Community Bowl 1010 Application-level Metadata and Archive <web.xml /> Apache Aries defines the notion of an Web components Web components “enterprise bundle archive” (EBA) to represent a multi-bundle application. <blueprint.xml/> Constituent bundles may be contained (“by-value”) or referenced Blueprint Blueprint from a bundle repository. Config by exception - absence of <persistence.xml/> APPLICATION.MF metadata means: Entities Entities • application content is the set of bundles contained Application by-value plus any repository-hosted APPLICATION.MF dependencies identified during deployment. Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 17 62605Gi Community Bowl 1010 Aries Application Assembly and Deploy “application” project: resolve and deploy .eba archives – bundle converter extn point e.g for war to wab conversion – application resolver extn point for different type of repository e.g Felix OBR – application context extn point for runtime specific installation and management of bundles Manifest-Version: 1.0 Uses APPLICATION.MF metadata Application-ManifestVersion: 1.0 Application-Name: Blog Application Application-SymbolicName: aries.sample.blog Metadata can be generated from Application-Version: 1.0 POM configuration or authored Application-Content: aries.sample.blog; version=1.0.0, aries.sample.blog-api; version=1.0.0, Eclipse-based tools for authoring aries.sample.blog-persistence; version=1.0.0, aries.sample.blog-servlet; version=1.0.0 Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 18 62605Gi- Ezn OSGi Application Development Tools WAS v7 OSGi FeP WAS v7 OSGi FeP Test Environment OSGi Application Support in RAD V8 Test Environment Provide integrated development and test of Publish and Run OSGi Applications on the WebSphere platform Integrated with Web Tools, JEE productivity tools, and WAS v7 Server WAS v7 Server other capabilities in RAD Bundle Explorer Bundle Explorer Support Support Supports deployment to WAS v7 OSGi FeP and includes the FeP in the WAS Test Environment Blueprint Graphical Blueprint Graphical Editor Editor SCA // OSGi SCA OSGi Integration Integration I SCA support for OSGi Applications Additional OSGi tools: Graphical and wiring editor for Blueprint Bundle Explorer Tools for WAS OSGi extensions / Value-add Developer Productivity Developer Productivity (e.g. content assist, validation, re-factoring) (e.g. content assist, validation, re-factoring) http://www-01.ibm.com/software/awdtools/developer /application/index.html Graphical Graphical Tutorials and Tutorials and Application Editor Application Editor Documentation Documentation Free Eclipse Plugin for OSGi Applications Graphical tools to develop OSGi applications and Graphical Creation Graphical Creation Creation // Import // Creation Import bundles Wizards Wizards Export Tools Export Tools Includes features that increase developer productivity Creates OSGi Applications for any Aries-based server WTP 3.6 WTP 3.6 PDE PDE runtime. Eclipse Eclipse WTP 3.6 (Helios) required OSGi App Devt Tool http://marketplace.eclipse.org/content/ibm-rational- development-tools-osgi-applications RAD V8 Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 19 e005Gi Community Ewen! 2010 Development Support for EBAs OSGi App Dev Tool supports import, creation, and export of applications Form-based editor for application manifest Validation of manifest syntax and properties [ILI Project Explorer E--' .3 "__ ..ibm.ws.eba.example.blog. 'Workspace] o OSGi Application Manifest com.ibm.json.java ▪ com.ibm.ws.eba.example.blog Gen era IInformation ▪ com.ibm.ws.eba.example.blog.api Spedfies thegeneralinformation for this application, --s -- ▪1=,com.ibm.ws.eba.example.blog.app 20 Import DR'. 4.Manifest: Aries Slog Symbolic Name (ID): ibm.vo.ehe.example.blog.app 8-2?META-INF Version: 1.0 OSGi Application Import Import an OSGi application into theworkspace. r , APPLICATION,MF permissions.perm Name: Aries Slag f0com.ibm.ws.eba.example.blog.persistence O com.ibm.ws.eba.example.blog.web Contained Bundles Spedfies the OSGi bundles indudedinthis appliption. EBA file: DS COM .ibm.ws.eba.example.blag.eba v Browse... • COM. ibm.os.eba.example.blog.api Add... Project name: com.ibm.ws.eba.example.blog.app com.ibm.ws.eba.example.blog.persisi Target runtime: <None> E [ New... 1 com.ibm.ws.eba.example.blog.web 1 [ Remove com. ws.eba. example .blog 1.0.0 Properties... Bundles doindude: [ New... MI iii. com.ibm.ws.eba.exampk.blog.ap(1.0.0) SelectAll [ Up El 4:rcom.ibm.ws.eba.exampk.blog.persistence (1.0.0) MI * ClearAll L.5_1 * com.ibm.ws.eba.exampk.blog.web(1.0.0) El com.ibm.ws.eba.exampk.blog(1.0.0) Explicitly s Sha red Bundles Spedfies the OSGibundles induded from the shared runtime area.(Use-bundle header) • bm.json.java 1.0.0 Add... < Back 1 Next > I Finish [ Cancel Overview APPLICATION.MF Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 20 65 005Gi Community Bowl 2310 Development Support for Web and JPA Bundles YJ Create OSGi bundle projects with Web or JPA configurations YJ Can convert existing JEE Web or JPA projects into bundles: – Creates or updates a valid bundle manifest – Adds a Web-ContextPath or Meta-Persistence header – Adds package imports based on current New Si Bundle Project __ module contents OSGi Bundle Project Create a sthndalone OSGi bundle project or add it to a new or existing applimtion. Graphical manifest editor for OSGi metadata. Project build paths respect OSGi visibility rules Projectname NewBundle – Supports and enforces modular characteristics Project lomtion trdl from design through to execution We defaultloustion L Location: C: 'yedipse 36Vorkspace',NewBundle Browse... Target runtime Plus in RAD: Comprehensive support for <None> New Runtime.,, Web and JPA. These tools can continue to be used as-is in OSGi projects, including: r Configuration OSGiWebConfiguration Modify... – New wizards (Servlet, JSP, etc.) <custom> Default Configuration – Page designer and other web editors JavaServer Faces v1.1 Project JavaServer Faces v1.2 Project – Persistence.xml editor JavaServer Faces v2.0 Project Minimal Configuration OSGi PA Configuration OSGi Web Configuration < Back. Next > Finish Cancel Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 21 62605Gi Community Ewen! 2010 Development Support for Blueprint Bundles Blueprint creation wizard – Supports extension schema including JPA and transactions A blueprint editor, including: – Source page with syntax highlighting, content assist – Form-based editing similar to Java EE deployment descriptors (RAD) – Syntax and reference validation – Hyperlinking to impl e.. blueprint. xr721 Blueprint XML Editor classes Overview 3 1E1 Details [17 – Refactoring support type filter text ID: bloggingServiceComponent 1Nr. Blueprint [ Add... Class: com.ibm.ws.eba.example.blog.BloggingServiceImpl Browse... blogAuthorManager (Bean) [ Remove Activation: 1:1 blogCommentManager (Bean) ;FE, blogEniryManager (Bean) bloggingServiceComponent (Beal, r 1 Scope: Description: blogAuthorManager (Property) I Down blogCommentManager (Property. blogEntryManager (Property) com.ibm .ws.eba e xample b log . api.B commentPersistenceService (Refere persistenceManager (Reference) ilefgrepc.5gttingj 0 Method references 1 <1 Design Scum Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 22 62605Gi Community Bowl 1010 Aries Innovation Blueprint Bean Interceptors – RFP 137 Blueprint Transactions – RFP 138 Message Driven Services – RFP 131 Subsystem Metadata and Lifecycle – RFP 121 Container-managed JPA - RFP 115 – RFP 136 (Classpath scanning) – RFP 139 (Bytecode weaving) META-INF/services RFP 128 (Blueprint annotations, no RFP yet) Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 23 62605Gi Carrfflnunity Bowl 1010 Application exploitation of OSGi in WebSphere OSGi has been used internally in WAS since V6.1 and in Eclipse since R3. Application-level exploitation is introduced in the WebSphere Application Server V7 Feature Pack for OSGi Applications and JPA 2.0 http://www.ibm.com/websphere/was/osgi – Generally available since May 2010 – Early Program available since Nov 2009 Apache AR1 ES Tools support in RAD V8: http://www.ibm.com/software/awdtools/developer/application/ Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 24 62605Gi Community Ewen! 2010 Modular Deployment Common bundles factored out of the applications and used at specific versions webA.jar webA.jar webA.jar webA.war IIwebA.jar WEB-INF/classes/servletA.class webA.jar WEB-INF/classes/servletA.class webA.jar WEB-INF/classes/servletA.class webA.jar WEB-INF/classes/servletA.class webA.jar WEB-INF/web.xml WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/classes/servletA.class META-INF/MANIFEST.MF WEB-INF/web.xml webA.war META-INF/MANIFEST.MF WEB-INF/web.xml META-INF/MANIFEST.MF WEB-INF/web.xml webA.war META-INF/MANIFEST.MF WEB-INF/web.xml webA.war WEB-INF/classes/servletA.class META-INF/MANIFEST.MF webA.war WEB-INF/classes/servletA.class s META-INF/MANIFEST.MF webA.war WEB-INF/classes/servletA.class META-INF/MANIFEST.MF webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… Import-Package WEB-INF/web.xml WEB-INF/lib/… WEB-INF/web.xml WEB-INF/lib/… WEB-INF/web.xml WEB-INF/lib/… WEB-INF/lib/… jar logging f/w Bundle Repository WEB-INF/lib/… WEB-INF/lib/… jar logging f/w Bundle Repository logging f/w jar • Manage multiple persistence f/w f/w jar logging jar persistence f/w jar versions of libraries persistence f/w jar across an enterprise MVC f/w jar f/w jar persistence MVC f/w jar • Isolate application MVC f/w jar dependencies from the DI f/w jar f/w jar MVC DI f/w jar server runtime 1 DI f/w jar • Centralized location to 1 DI f/w jar deliver critical fixes • Flexibility to update to new versions one app at a time Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 25 62605Gi Community Ewing 2010 Modular Deployment in WAS Integrated Solutions Console Welcome Help I Logout Cell=irobinsNodeOlCell, Profile=AppSni01 Close page View: I task All s Internal bundle repository s Welcome E l Guided Activities Internal bundle repository > comibmjson.java E Servers + The internal bundle repository is used to store bundles that are referenced by OSGi applications running in WebSphere Application Server. When an OSGi application is imported as an assetr the provisioner attempts to ['Applications satisfy all its dependencies by using the contents of the asset, the contents of the internal bundle repository, and the contents of any available external bundle repositories. I=1 Services Configuration E l Resources E Security + El Environment General Properties Virtual hosts Bundle symbolic name Update global Web server plu configuration CO.T. I bm.json jays s WebSphere variables Bundle version s Shared libraries s Replication domains 1.0.0 E Naming Bundle name OSGi bundle repositories JSCIN4J s s Internal bundle repository Bundle description E System a MFIIT3Dam.rri Imported packages ID Users and Groups I=1 Monitoring and Tuning, ID Troubleshooting ['Service integration I=1 UDDI Exported packages com.ibm.json.javawersion=“1.0.0" Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 26 d'u OSGi Even,1010 Details: Isolated and Shared Bundles In Java EE, modules are isolated within an application and applications are isolated from one another. – Makes sharing modules difficult OSGi 4.2 all bundles have shared visibility to the externals of all others bundles within an OSGi framework (JVM) – Makes isolating applications difficult OSGi v4.2 Framework Java EE App Server _—- EAR 1 EAR 2 Isolation Module A Module A ___------- bundle 6 Module B Module G __------- Bundle C ___---- - Sharing Bundle Module C Module C Everything isolated Everything shared Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 27 62605Gi Community Bowl 1010 Details: Isolated and Shared Bundles Equinox 3.5 “nested framework” support enables “composite bundles” to run in isolated child frameworks – WebSphere installs each OSGi Application into an isolated child framework. – Shared bundles are installed into the (single) parent framework. OSGi v4.2 Framework Java EE App Server WAS V7 OSGi App FeP EBA 1 EBA 2 EAR 1 EAR 2 Bundle A Bundle A Module A Module A Bundle B Bundle G Module B Module B Isolated Isolated Module C Module C framework framework J Bundle C Shared framework Everything isolated Everything shared Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 28 62605Gi Community Bowl 1010 Example “Blog” Application t.own.ibm.ws.eba.example.bloghapp t Manifest-Version: 1.0 Application-ManifestVersion: 2.0 Application-Name: Aries Blog Application-SymbolicName: com.ibm.ws.eba.example.blog.app Application-Version: 1.0 44 isolated content Application-Content: com.ibm.ws.eba.example.blog.apivrtersion=1.0.0, com.ibm.ws.eba.example.blog.persistence:7ersion=1.0.0, com.ibm.ws.eba.example.blog.webvriersior=1.0.0, com.ibm.ws.eba.example.blog:version=2.0.0 shared content Use-Bundle: com.ibm.json.java;version=1.0.0 i<1 OverviewAPPLICATION.MF r blog-api Web application bundle O 0 JNDI -0- EM WEB-INF/ Blogging Blog META-INF/ web.xml Service OSGI-INF/blueprint/ persistence.xml blueprint.xml Persistence Service blog-servlet OSGI-INF/blueprint/ blog blueprint.xml blog.eba blog-persistence Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 29 JMX and Isolated Frameworks in Action 1 wsadmin>list() ID Framework Version Node Server 0 SharedBundles 7.0.0 irobinsNode01 serverl 1 com.ibm.ws.eba.example.blog.app 1.0.0 irobinsNode01 serverl wsa•min connec u CWSAJ0035I: Connecting to framework SharedBundles_7.0.0 on node irobinsNode01 an cprvpr qprup.r1 401WSAJ0036I: Successfully connected to framework SharedBundles_7.0.0. wsadmin>ss() ID State Bundle 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126 1 ACTIVE shared.bundle.framework_0.0.0 2 ACTIVE com.ibm.json.java_1.0.0 ACTIVE com.ibm.ws.eba.example.blog.app_1.0.0 ./ wsadmin>connect(1) CWSAJ0035I: Connecting to framework com.ibm.ws.eba.example.blog.app_1.0.0 on e innhinANnHt.01 And Apbrypq- Ap.mit.r1 A SAJ0036I: Successfully connected to framework com.ibm.ws.eba.example.blog.ap 1.0.0. wsadmin>ss() ID State Bundle 0 ACTIVE org.eclipse.osgi_3.5.2.R35x_v20100126 1 ACTIVE com.ibm.ws.eba.example.blog.app_1.0.0 2 ACTIVE com.ibm.ws.eba.example.blog_1.0.0 3 ACTIVE com.ibm.ws.eba.example.blog.web_1.0.0 4 ACTIVE com.ibm.ws.eba.example.blog.persistence_1.0.0 I ndmin> ACTIVE com.ibm.ws.eba.example.blog.api_1.0.0 Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 30 12' 05G. Community Bowl 1010 OSGi Applications and SCA: the assembly food chain SCA Composite SCA Composite assembled from heterogeneous components including an Component OSGi Application component, and integrated through SCA services with configurable bindings (JMS, web POJO EAR services…). OSGi Application OSGi Bundles assembled in an OSGi Application and integrated through Bundle Bundle services in the OSGi service registry POJO POJOs assembled using a Blueprint POJO POJO context and scoped by an OSGi Bundle. Bundle Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 31 62605Gi Community Bowl 1010 Summary Java EE and OSGi are good for each other. – Java EE defines standard enterprise technologies with contracts for applications and runtimes – OSGi encourages and enforces modular design and enables modular deployment The Apache Aries project delivers enterprise OSGi technologies that have been integrated into a number of runtimes. – As well as experimental implementation of new EEG RFPs to inform the specs. WAS V7 and RAD integration of Aries provides complete develop-test-deploy-manage environment for modular enterprise applications. Ian Robinson (c) IBM Corp, 2010
    • 29 Sep 2010 32 62605Gi Community Bowl 1010 References Apache Aries http://incubator.apache.org/aries/ Apache Geronimo v3.0-M1: http://geronimo.apache.org/ WAS V7 Feature Pack for OSGi Applications and JPA 2.0 http://www.ibm.com/websphere/was/osgi OSGi Application Development Plugin: http://marketplace.eclipse.org/content/ibm-rational- development-tools-osgi-applications Rational Application Developer V8: http://www.ibm.com/software/awdtools/developer/application/ Ian Robinson (c) IBM Corp, 2010