Your SlideShare is downloading. ×
OSGi Community Event 2010 - Enterprise OSGi in WebSphere and Apache Aries
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

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

1,329
views

Published on

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)

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,329
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
21
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. axe2010LONDON 060•05GCommunity Event2010 Enterprise OSGi in WebSphere and Apache Aries Ian Robinson, IBM
  • 2. 62605GiCommunity Bowl1010 129 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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
  • 3. 62605GiCommunity Bowl1010 A jpt. 229 Sep 2010 Ian Robinson (c) IBM Corp, 2010 IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP Enterprise APIs in Java SE (Required for Java EE) Servlet JSP Web Container JavaM ail JAF JAX- RPC JAX- WS Web Service s WS Metada ta JMS JTA JACC JAXR Manag ement JPA EJB SAA J HTTP/ SSL Direct dependency Optional dependencies JSTL JSF JAX B JCA Deb ug Com mon Anno tation s Java EE Web technologies StAX Indirect (soft) dependency JAX- RS JASPI C CDI& DI OSGi and Java Enterprise – who needs who? HTTP Session Replication Connection Management Persistence Providers User Registries Event Mgmt Logging and Tracing MBean Server Admin Console and scripting DataSources Messaging Engines Security Transport Channels Workload Management HTTP Serving and routing High Availability Management Transaction Logging and Recovery Thread management Classloading Provisioning Monitoring Policy and SLA mgmt Configuration …
  • 4. 05G1 kwo Applications (bundles) Services Life Cycle Module Java Execution Env OS + Hardware 329 Sep 2010 Ian Robinson (c) IBM Corp, 2010 OSGi and Java Enterprise – who needs who? IDL JDBC JNDI JAXP JAAS JMX RMI-IIOP Enterprise APIs in Java SE (Required for Java EE) Servlet JSPWeb Container Ja va M ail J A F JA X- R P C JA X- W S W eb Se rvi ce s W S M et ad at a J M S JT A JA C C JA X R M an ag e m en t JP A EJ B S A A J H T T P/ S SL Direct dependency Optional dependencies JS TL JS F J A X B J C A D e b u g C o m m o n A n n o t a t i o n s Java EE Web technologies S t A X Indirect (soft) dependency JA X- R S J A S PI C C DI & DI HTTP Session ReplicationConnection ManagementPersistence ProvidersUser Registries Event Mgmt Logging and TracingMBean Server Admin Console and scripting DataSourcesMessaging Engines Security Transport ChannelsWorkload Management HTTP Serving and routing High Availability Management Transaction Logging and Recovery Thread managementClassloading Provisioning Monitoring Policy and SLA mgmt Configuration Java EE App Server Applications Enterprise Services Metadata and enterprise service-enablement Three ways of looking at Enterprise OSGi technologies 1 2 3
  • 5. 12' 05G.Community Bowl1010 429 Sep 2010 Ian Robinson (c) IBM Corp, 2010 The Culture Clash Java EE OSGi An application is a collection of wars/jar modules scoped by an EAR There is no multi-bundle “application” scope other than an OSGi framework Applications are isolated from one another in a server Bundle exports are visible throughout the framework Container-centric. Distinct contracts for containers and applications All bundles are created equal. Defines complete enterprise programming model (JTA, JPA, Web, JMX, Web, EJB, JAX-WS…) OSGi Enterprise Specification V4.2 defines services-based access to Java EE technologies
  • 6. 62605GiCommunity Bowl1010 529 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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.
  • 7. 62605Gi- Ezn Apache ARIES 629 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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
  • 8. 62605GiCommunity Bowl1010 729 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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/
  • 9. O MBean Serve O «MBean>> Bundle State MBean 1111111111111111111111111111111111111111111111111 .1111111111111111111111111111111111111111111111111111111111111111111 """"""""."""""""""""""""""""""""". «MBean» Package St ate MBean Immimmimmimmimmimmimmimmimmim '1111111111111111 «M3ean>> Fram ework MBean 1111111111111111111111111111111111111111111111111111111111111111111 «M3ean>> Service St ate MBean 11111111111111111111111111111111111111111111111111111111111111111111 111AV /—NC !VIC 1 ICI 661 um ll ummummummummummummummum <4V1Bean» D.rrn:e 91111111111111111111111111111111111111111111111111111111111111111111 W III 1151. PL./ 11 Ad min MBean "I11111111111111111111111111111111111111111111111111111111111111111111 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,1111.......... «MBean» Provisi onin g ServiceM Bean "mmimmimmimmimmimmimmimmimmimm «MBean» User Adm in MBean "111111111111111111111111111111111111111111111111111111111111111111111..... 1 jax,.., 829 Sep 2010 6'605GCommunity Event 1:10 Aries )MX Integration Implementation of OSGi JMX specification. o Aries JMX bundle automatically registers the JMX MBeans into any javax.management.MBeanServer service in the OSGi Service Registry. PermissionAdrnin Cnnficriratinn Admin Provisioning Service User Adrrin Ian Robinson (c) IBM Corp, 2010 829 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Aries JMX Integration Implementation of OSGi JMX specification. Aries JMX bundle automatically registers the JMX MBeans into any javax.management.MBeanServer service in the OSGi Service Registry. JMX OSGi Manager <<MBean>> Framework MBean <<MBean>> Bundle State MBean <<MBean>> Service St ate MBean <<MBean>> Package St ate MBean <<MBean>> Configuration Admin MBean <<MBean>> Permission Admin MBean <<MBean>> Provisioning ServiceMBean <<MBean>> User Admin MBean PermissionAdmin Configuration Admin Provisioning Service User Admin MBean Server <<MBean>> Blue print MBean Framework MBeans Compendium MBeans Additional Aries MBeans
  • 10. XA Protocol 7 [TA Provider Transaction Synchroni: ation Registry ((interface» XAResource an aged Application Imp! Application Container Impl -source onager Impl XAResource Imp! User Transaction Transaction Manager 62605GiCommunity Ewen!2010 .7* a resource specific service 929 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Aries JTA integration Apache Aries integrates the OSGi Transaction Service Ref Impl from Apache Geronimo. This spec is a good example of the OSGi/Java EE culture clash: – Different services for application and container
  • 11. 62605GiCarrfflnunity Bowl1010 bond e service bund:e jax,.. 1029 Sep 2010 Ian Robinson (c) IBM Corp, 2010 OSGi Services – No Java EE analog 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. S
  • 12. 12' 05G.Community Bowl1010 1129 Sep 2010 Ian Robinson (c) IBM Corp, 2010September 8th 2010 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); } } }
  • 13. 62605G1 •_ Carrfflnunity Bowl1010 1229 Sep 2010 Ian Robinson (c) IBM Corp, 2010September 8th 2010 Blueprint Simplification public class Bean { private LogService log; void setLog(LogService logService) { log = logService; } void process(Order o) { log.log(LOG_INFO, “processing: “ + o); } } <blueprint> <bean id=”shop” class=”org.example.ecomm.Bean”> <property name=”log”> <reference interface=”org.osgi.service.log.LogService”/> </property> </bean> </blueprint>
  • 14. 62605GiCommunity Bowl1010 1329 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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 extend the Blueprint definitions – Bean interceptors can be registered by handlers Other Aries components contribute handlers – “jpa” and “jta” handlers. dependencies injected consumes servicepublishes service A static assembly and configuration of components (POJOs) Blueprint bundle OSGI-INF/blueprint/ blueprint.xml
  • 15. 62605GiCommunity Bowl1010 1429 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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> Aries Blueprint Extensions
  • 16. 62605GiCommunity Bowl1010 jax 1529 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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> registerService InitialContext ic = new InitialContext(); BloggingService blog= ic.lookup("osgi:services/" + BloggingService.class.getName()); getService A way for a Web component to access a Blueprint component OSGi Service Registry JNDI Context
  • 17. 62605GiCommunity Bowl1010 1629 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Application-level Metadata and Archive Apache Aries defines the notion of an “enterprise bundle archive” (EBA) to represent a multi-bundle application. Constituent bundles may be contained (“by-value”) or referenced from a bundle repository. Config by exception - absence of APPLICATION.MF metadata means: • application content is the set of bundles contained by-value plus any repository-hosted dependencies identified during deployment. Application EntitiesEntities BlueprintBlueprint Web componentsWeb components <web.xml /> <persistence.xml/> <blueprint.xml/> APPLICATION.MF
  • 18. 62605GiCommunity Bowl1010 1729 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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 Application-ManifestVersion: 1.0 Application-Name: Blog Application Application-SymbolicName: aries.sample.blog Application-Version: 1.0 Application-Content: aries.sample.blog; version=1.0.0, aries.sample.blog-api; version=1.0.0, aries.sample.blog-persistence; version=1.0.0, aries.sample.blog-servlet; version=1.0.0 Uses APPLICATION.MF metadata Metadata can be generated from POM configuration or authored Eclipse-based tools for authoring
  • 19. I 62605Gi- Ezn 1829 Sep 2010 Ian Robinson (c) IBM Corp, 2010 RAD V8 OSGi App Devt Tool WAS v7 OSGi FeP Test Environment WAS v7 OSGi FeP Test Environment Eclipse WTP 3.6WTP 3.6 PDEPDE Graphical Application Editor Graphical Application Editor Developer Productivity (e.g. content assist, validation, re-factoring) Developer Productivity (e.g. content assist, validation, re-factoring) Graphical Creation Wizards Graphical Creation Wizards Creation / Import / Export Tools Creation / Import / Export Tools Tutorials and Documentation Tutorials and Documentation Publish and Run WAS v7 Server Support WAS v7 Server Support Free Eclipse Plugin for OSGi Applications Graphical tools to develop OSGi applications and bundles Includes features that increase developer productivity Creates OSGi Applications for any Aries-based server runtime. Eclipse WTP 3.6 (Helios) required http://marketplace.eclipse.org/content/ibm-rational- development-tools-osgi-applications OSGi Application Development Tools Blueprint Graphical Editor Blueprint Graphical Editor Bundle ExplorerBundle Explorer SCA / OSGi Integration SCA / OSGi Integration OSGi Application Support in RAD V8 Provide integrated development and test of OSGi Applications on the WebSphere platform Integrated with Web Tools, JEE productivity tools, and other capabilities in RAD Supports deployment to WAS v7 OSGi FeP and includes the FeP in the WAS Test Environment SCA support for OSGi Applications Additional OSGi tools: Graphical and wiring editor for Blueprint Bundle Explorer Tools for WAS OSGi extensions / Value-add http://www-01.ibm.com/software/awdtools/developer /application/index.html
  • 20. ibm.vo.ehe.example.blog.app 1.0 Aries Slag Gen eraIInformation Spedfiesthegeneralinformation for this application, Symbolic Name (ID): Version: Name: e005GiCommunity Ewen!2010 --s--20 Import DR'. OSGi Application Import rImport an OSGi application into theworkspace. EBA file: DS COM.ibm.ws.eba.example.blag.eba v Browse... Project name: com.ibm.ws.eba.example.blog.app Target runtime: <None> E [ New... 1 Bundlesdoindude: MIiii.com.ibm.ws.eba.exampk.blog.ap(1.0.0) El 4:rcom.ibm.ws.eba.exampk.blog.persistence (1.0.0) SelectAll ClearAllMI *com.ibm.ws.eba.exampk.blog.web(1.0.0) El *com.ibm.ws.eba.exampk.blog(1.0.0) < Back 1 Next > I Finish [ Cancel [ILIProject Explorer E-.3-'"__ 'Workspace] com.ibm.json.java ▪ com.ibm.ws.eba.example.blog ▪ com.ibm.ws.eba.example.blog.api ▪1=,com.ibm.ws.eba.example.blog.app 4.Manifest: Aries Slog 8-2?META-INF APPLICATION,MF permissions.perm ..ibm.ws.eba.example.blog. OSGi Application Manifest Contained Bundles Spedfies the OSGi bundles indudedinthis appliption. o , f0com.ibm.ws.eba.example.blog.persistence O com.ibm.ws.eba.example.blog.web Add... [ Remove Properties... [ New... [ Up sExplicitly Sha red Bundles Spedfies the OSGibundles induded from the shared runtimearea.(Use-bundle header) • bm.json.java 1.0.0 Add... Overview APPLICATION.MF • COM.ibm.os.eba.example.blog.api com.ibm.ws.eba.example.blog.persisi com.ibm.ws.eba.example.blog.web 1 com. ws.eba. example.blog 1.0.0 L.5_1 1929 Sep 2010 Ian Robinson (c) IBM Corp, 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
  • 21. OSGi Bundle Project Create a sthndalone OSGi bundle project or add it to a new or existing applimtion. Projectname NewBundle trdl We defaultloustion Location: Browse...C: 'yedipse 36Vorkspace',NewBundle New Si Bundle Project_ _ Project lomtion Target runtimeL New Runtime.,, rConfiguration OSGiWebConfiguration <None> Modify... < Back. Next > Finish Cancel <custom> Default Configuration JavaServer Faces v1.1 Project JavaServer Faces v1.2 Project JavaServer Faces v2.0 Project Minimal Configuration OSGi PA Configuration OSGi Web Configuration 65005GiCommunity Bowl2310 YJ YJ 2029 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Development Support for Web and JPA Bundles Create OSGi bundle projects with Web or JPA configurations 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 module contents Graphical manifest editor for OSGi metadata. Project build paths respect OSGi visibility rules – Supports and enforces modular characteristics from design through to execution Plus in RAD: Comprehensive support for Web and JPA. These tools can continue to be used as-is in OSGi projects, including: – New wizards (Servlet, JSP, etc.) – Page designer and other web editors – Persistence.xml editor
  • 22. Details ID: Class: 1E1 [17 bloggingServiceComponent com.ibm.ws.eba.example.blog.BloggingServiceImpl Browse... Activation: Scope: Description: 1:1 1 ilefgrepc.5gttingj 0 Method references 1Nr.Blueprint blogAuthorManager (Bean) blogCommentManager (Bean) blogEniryManager (Bean) ;FE,bloggingServiceComponent (Beal, blogAuthorManager (Property) blogCommentManager (Property. blogEntryManager (Property) com.ibm .ws.eba e xample b log . api.B commentPersistenceService (Refere persistenceManager (Reference) 1 <1 blueprint. xr721 e..Blueprint XML Editor Overview type filter text 3 [ Add... [ Remove r I Down Design Scum Community Ewen!2010 62605Gi 2129 Sep 2010 Ian Robinson (c) IBM Corp, 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 classes – Refactoring support
  • 23. Community Bowl1010 62605Gi 2229 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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)
  • 24. Apache AR1 ES 62605GiCarrfflnunity Bowl1010 2329 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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 Tools support in RAD V8: http://www.ibm.com/software/awdtools/developer/application/
  • 25. Community Ewen!2010 1 1 s I I 62605Gi 2429 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Modular Deployment Common bundles factored out of the applications and used at specific versions webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF Bundle Repository Bundle Repository Import-Package webA.jar WEB-INF/classes/servletA.class WEB-INF/web.xml META-INF/MANIFEST.MF webA.jar 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/lib/… webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… logging f/w jar persistence f/w jar MVC f/w jar DI f/w jar webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… logging f/w jar persistence f/w jar MVC f/w jar DI f/w jar webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… logging f/w jar persistence f/w jar MVC f/w jar DI f/w jar webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… webA.war WEB-INF/classes/servletA.class WEB-INF/web.xml WEB-INF/lib/… logging f/w jar persistence f/w jar MVC f/w jar DI f/w jar logging f/w jar persistence f/w jar MVC f/w jar DI f/w jar • Manage multiple versions of libraries across an enterprise • Isolate application dependencies from the server runtime • Centralized location to deliver critical fixes • Flexibility to update to new versions one app at a time
  • 26. IDTroubleshooting ['Service integration I=1 UDDI 62605GiCommunity Ewing2010 Integrated Solutions Console Welcome Help ILogout Cell=irobinsNodeOlCell, Profile=AppSni01 View: IAll tasks Close page s Welcome E l Guided Activities E+ Servers ['Applications I=1 Services E l Resources E+ Security El Environment Internal bundle repository Internal bundle repository> comibmjson.java 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 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. Configuration Exported packages com.ibm.json.javawersion=“1.0.0" Virtual hosts Update global Web server plu configuration s WebSphere variables s Shared libraries s Replication domains E Naming OSGi bundle repositories s s Internal bundle repository E System a MFIIT3Dam.rri ID Users and Groups I=1 Monitoring and Tuning, General Properties Bundle symbolic name CO.T. Ibm.json jays Bundle version 1.0.0 Bundle name JSCIN4J Bundle description Imported packages 2529 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Modular Deployment in WAS
  • 27. ___------- ___----- _ — - bundle 6 Bundle C Bundle __------- d'uOSGi Even,1010 2629 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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 Java EE App Server Everything isolated Everything shared EAR 1 Module A Module B Module C EAR 2 Module A Module G Module C OSGi v4.2 Framework Isolation Sharing
  • 28. J 62605GiCommunity Bowl1010 2729 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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. Everything isolated Everything shared OSGi v4.2 Framework Java EE App Server EAR 1 Module A Module B Module C EAR 2 Module A Module B Module C Java EE App Server EAR 1 Module A Module B Module C EAR 1 Module A Module B Module C EAR 2 Module A Module B Module C EAR 2 Module A Module B Module C WAS V7 OSGi App FeP EBA 1 Bundle A Bundle B Bundle C EBA 2 Bundle A Bundle G Isolated framework Isolated framework Shared framework
  • 29. tt.own.ibm.ws.eba.example.bloghapp 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 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 Use-Bundle: com.ibm.json.java;version=1.0.0 i<1 OverviewAPPLICATION.MF r 0 -0- O 62605GiCommunity Bowl1010 2829 Sep 2010 Ian Robinson (c) IBM Corp, 2010 Example “Blog” Application Blogging Service Blog Persistence Service blog-servlet Web application bundle META-INF/ persistence.xml WEB-INF/ web.xml OSGI-INF/blueprint/ blueprint.xml OSGI-INF/blueprint/ blueprint.xml JNDI EM blog.eba blog blog-persistence blog-api isolated content shared content
  • 30. ID 0 1 1 wsadmin>list() Framework Version Node Server SharedBundles 7.0.0 irobinsNode01 serverl 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 ASAJ0036I: 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 Indmin> ACTIVE com.ibm.ws.eba.example.blog.api_1.0.0 2929 Sep 2010 Ian Robinson (c) IBM Corp, 2010 JMX and Isolated Frameworks in Action
  • 31. 12' 05G.Community Bowl1010 3029 Sep 2010 Ian Robinson (c) IBM Corp, 2010 OSGi Application BundleBundle Bundle POJO POJOs assembled using a Blueprint context and scoped by an OSGi Bundle. OSGi Bundles assembled in an OSGi Application and integrated through services in the OSGi service registry SCA Composite assembled from heterogeneous components including an OSGi Application component, and integrated through SCA services with configurable bindings (JMS, web services…). POJO POJO OSGi Applications and SCA: the assembly food chain SCA Composite Component EARPOJO
  • 32. 62605GiCommunity Bowl1010 3129 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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.
  • 33. 62605GiCommunity Bowl1010 3229 Sep 2010 Ian Robinson (c) IBM Corp, 2010 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/