Download presentation
Presentation is loading. Please wait.
Published byOsborne Cunningham Modified over 8 years ago
1
Apache Aries An Open Source project for Enterprise OSGi Applications
3
Apache Aries – Project Overview 3 Agenda History Community Content Consumers Future
4
Apache Aries – Project Overview 4 History “Aries” created as a new Apache incubator project in Sep 2009 Independent of OSGi framework provider and integration/server runtime Initial contribution included the Blueprint container implementation developed originally by the Apache Geronimo community. Web Site for all resources and documentation: http://incubator.apache.org/aries/
5
Apache Aries – Project Overview 5 Community Currently 43 committers, contributors from Ericsson, IBM, JBoss, LinkedIn, Progress, ProSyst, SAP and individuals http://incubator.apache.org/aries/people.html Creation of community is one of the primary goals of the Apache Incubator
6
Apache Aries – Project Overview 6 Aries Content includes… Blueprint container JPA integration JTA integration JMX JNDI integration Application assembly and deployment META-INF/services handler Samples http://svn.apache.org/repos/asf/incubator/aries/trunk/
7
Apache Aries – Project Overview 7 Aries Samples AriesTrader – Apache Geronimo DayTrader Java EE benchmark application converted to OSGi Application using web and blueprint components Objective is to demonstrate best practices Performance benchmarking Blog Sample – New application to demonstrate Aries features The Samples illustrate how to run Aries applications on a standard OSGi f/w (e.g. Equinox) + Aries + dependencies (Derby DB, PaxWeb servlet container). http://incubator.apache.org/aries/samples.html
8
Apache Aries – Project Overview 8 Example “Blog” Application Architecture Blogging Service Blog Persistence Service blog-web Web application bundle MetaPersitstence WEB-INF/ web.xml OSGI-INF/blueprint/ blueprint.xml OSGI-INF/blueprint/ blueprint.xml JNDI META-INF/ persistence.xml blog.eba blog-biz blog-persistence blog-api
9
Apache Aries – Project Overview 9 Run the Blog Sample EBA
10
Apache Aries – Project Overview 10 Aries Application Assembly and Deploy org.apache.aries.application.management Pluggable ApplicationResolver - NoOpResolver - OBRAriesResolver Pluggable BundleConverters - WabConverterService 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-biz; version="[1.0.0,1.1.0)", aries.sample.blog-api; version="1.0.0", aries.sample.blog-persistence; version="1.0.0", aries.sample.blog-web; version="[1.0.0,1.0.0]” Manifest-Version: 1.0 Deployment-ManifestVersion: 1.0 Application-Name: Blog Application Application-SymbolicName: aries.sample.blog Application-Version: 1.0 Deployed-Content: aries.sample.blog-biz; version=1.0.0, aries.sample.blog-api; version=1.0.0, aries.sample.blog-persistence; version=1.0.0, aries.sample.blog-web; version=1.0.0, Application Manifest (developer/assembler authored artefact) Enumerates constituent bundles and allowable version ranges Declares Application “externals” Deployment Manifest (generated during createApplication) Transitively closed description of all bundles resolved at specific versions to “freeze-dry” the application. Felix File Install
11
Apache Aries – Project Overview 11 Example “Blog” Application Architecture Blogging Service Blog Persistence Service blog-web Web application bundle MetaPersitstence WEB-INF/ web.xml OSGI-INF/blueprint/ blueprint.xml OSGI-INF/blueprint/ blueprint.xml META-INF/ persistence.xml JNDI blog.eba blog-biz blog-persistence blog-api
12
Apache Aries – Project Overview 12 Blog-biz - blueprint.xml.....
13
Apache Aries – Project Overview 13 Aries Blueprint Container Managed beans publishes service consumes service Blueprint bundle OSGI-INF/blueprint/ blueprint.xml A static assembly and configuration of components (POJOs)
14
Apache Aries – Project Overview 14 Aries JNDI integration Provides JNDI-based access to OSGi Service Registry... 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
15
Apache Aries – Project Overview 15 Example “Blog” Application Architecture Blogging Service Blog Persistence Service blog-web Web application bundle MetaPersitstence WEB-INF/ web.xml OSGI-INF/blueprint/ blueprint.xml OSGI-INF/blueprint/ blueprint.xml META-INF/ persistence.xml JNDI blog.eba blog-biz blog-persistence blog-api
16
Apache Aries – Project Overview 16 Blog Sample - persistence.xml Persistence unit for the example blogging application org.apache.openjpa.persistence.PersistenceProviderImpl osgi:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/blogdb) osgi:services/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/blogdbnojta) org.apache.aries.samples.blog.persistence.jpa.entity.AuthorImpl org.apache.aries.samples.blog.persistence.jpa.entity.EntryImpl true OpenJP A
17
Apache Aries – Project Overview 17 Aries JPA Container – Blueprint Integration <bean id="persistenceImpl" class="org.apache.aries.samples.blog.persistence.jpa.BlogPersistenceServiceImpl"> <service ref="persistenceImpl" interface="org.apache.aries.samples.blog.api.persistence.BlogPersistenceService"> Example blueprint with JPA resource injection and container-managed transactions
18
Apache Aries – Project Overview 18 Example “Blog” JPA persistence bundle MetaPersistence OSGI-INF/blueprint/ blueprint.xml META-INF/ persistence.xml blog-persistence Blog Persistence Service Entity Manager Factory Service The Aries JPA container uses the MetaPersistence and the persistence.xml to register the EM Factory service The JPA container finds jpa:context and injects a managed persistence context. The declarative transactions runtime locates the transaction metadata and enforces the defined transaction behaviour
19
Apache Aries – Project Overview 19 Example “Blog” JPA persistence bundle Blog Persistence Service MetaPersistence OSGI-INF/blueprint/ blueprint.xml META-INF/ persistence.xml blog-persistence Entity Manager Factory Service Queue
20
Apache Aries – Project Overview 20 JDBC vs JPA comparison
21
Apache Aries – Project Overview 21 public void createAuthor(String email, Date dob, String name, String displayName, String bio) { try { Connection connection = dataSource.getConnection(); String sql = "INSERT INTO AUTHOR VALUES (?,?,?,?,?)"; PreparedStatement ppsm = connection.prepareStatement(sql); ppsm.setString(1, email); ppsm.setString(2, bio); ppsm.setString(3, displayName); if (dob != null) ppsm.setDate(4, new java.sql.Date(dob.getTime())); else ppsm.setDate(4, null); ppsm.setString(5, name); int insertRows = ppsm.executeUpdate(); ppsm.close(); connection.close(); if (insertRows != 1) throw new IllegalArgumentException("The Author " + email + " cannot be inserted."); } catch (SQLException e) { e.printStackTrace(); throw new IllegalArgumentException(e.getMessage()); } } createAuthor() method in JDBC persistence service implementation
22
Apache Aries – Project Overview 22 public void createAuthor(String email, Date dob, String name, String displayName, String bio) { AuthorImpl a = new AuthorImpl(); a.setEmail(email); a.setName(name); a.setDisplayName(displayName); a.setBio(bio); a.setDob(dob); em.persist(a); } Example: createAuthor() method in JPA persistence service implementation
23
Apache Aries – Project Overview 23 Current Aries Consumers Aries SNAPSHOT builds available right now Aries 0.1 Release will be available soon. Aries components are currently used by: Apache Geronimo Apache Felix Karaf JBossOSGi WebSphere Application Server
24
Apache Aries – Project Overview 24 Futures There are many new application-centric features that Aries may develop including: message-driven blueprint components and services declarative role-based security for blueprint components annotation-based alternative to XML configuration resource-reference metadata and bindings (Original Proposal: http://wiki.apache.org/incubator/AriesProposal) Interested in getting involved? http://incubator.apache.org/aries/gettinginvolved.html
25
Apache Aries – Project Overview 25 The end........
26
Apache Aries – Project Overview 26 Aries JPA Container – Application Managed PUs Persistence bundle Bundle Manifest … Meta-Persistence: META-INF/persistence.xml META-INF/ persistence.xml OSGI-INF/blueprint/ blueprint.xml JPA container looks for MetaData persistence Headers. Locates descriptions and registers an EM Factory Service using data from - persistence.xml - JPA provider - DataSource JPA provider (Open JPA) org.apache.aries.jpa.container DataSource (blogDB) JND I Implementation of PersistenceProvider
27
Apache Aries – Project Overview 27 Aries JPA Container – Container Managed PUs Persistence bundle Bundle Manifest … Meta-Persistence: OSGI-INF/persistence.xml META-INF/ persistence.xml OSGI-INF/blueprint/ blueprint.xml BP container calls service if it encounters a jpa namespace element Calls the container service to let It know there is a new client Registers EM factory shadow Against the persistence service org.apache.aries.jpa.blueprint.aries org.apache.aries.jpa.container.context
28
Apache Aries – Project Overview 28 Aries JTA transactions Persistence bundle Bundle Manifest … Meta-Persistence: OSGI-INF/persistence.xml META-INF/ persistence.xml OSGI-INF/blueprint/ blueprint.xml BP container calls Namespace Manager service if it encounters a jta namespace element Transaction Manager service called by interceptor to start and end transactions. org.apache.aries.transaction.blueprint JTA provider (Geronimo) org.apache.aries.transaction.manager
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.