openmdx 2 Overview June 2008
openmdx 2 New Features Mappings / Bindings MOF CCI2 MOF JMI2 MOF JDO2 Providers / Architecture JDO PersistenceManager architecture Plugin architecture Gateway Persistence Lightweight Container 2
openmdx 1 2 Migration Overview JDK 5 openmdx 2 requires JDK 5 Bindings Migration from openmdx CCI to JMI2 bindings Migration from openmdx CCI filters to CCI2 queries Deployment Changes in configuration of plugins and gateway For performance optimization new packacking of applications recommended Persistence Migration to DBOSlicedWithIdAsKey. RID/OID mapping not supported anymore State management State plugins replaced by StateViewHelper. State plugins not supported anymore Migration to StateViewHelper (not available yet for openmdx 2) required 3
Mappings / Bindings
CCI2 Mapping [1] The MOF CCI2 mapping generates Java interfaces which represent the MOF classes Java interfaces which represent the MOF associations The mapping is JMI compliant but without the javax.jmi.reflect overhead. A query interface is generated for each modeled class (openmdx 1 filters are not supported anymore) The MOF CCI2 mapping can be used to model and generate any kind of application-level Java interface. Examples are: Facade components XML-RPC / WebService components Clients which do not need the JMI features should use the CCI2 interfaces. 5
CCI2 Mapping [2] public interface ContractPositionT { public java.lang.string getamount( ); public java.lang.string getbaseamount( ); public java.lang.string getcontractnumber( );... 6
CCI2 Mapping [3] public interface AccountHasAccountAddress { interface Address<E> extends org.w3c.cci2.container<e> { E get( org.oasisopen.cci2.qualifiertype idtype, java.lang.string id ); void add( org.oasisopen.cci2.qualifiertype idtype, java.lang.string id, E address ); } } void remove( org.oasisopen.cci2.qualifiertype idtype, java.lang.string id ); 7
CCI2 Mapping [4] public interface ContractPositionTQuery extends org.w3c.cci2.anytypepredicate { public org.w3c.cci2.optionalfeaturepredicate amount( ); public org.w3c.cci2.stringtypepredicate thereexistsamount( ); public org.w3c.cci2.stringtypepredicate forallamount( );... 8
JMI2 Mapping [1] The MOF JMI1 mapping generates Java interfaces which are JMI-compliant and extend the CCI2 interface. JMI1 objects can be passed to methods having CCI2 signatures. openmdx 1 filters are not supported anymore. They must be replaced by CCI2 queries. JMI implementation classes are not generated anymore. The are implemented by Java proxies in a generic way. 9
JDO2 Mapping [1] The MOF JDO2 mapping generates Java classes which are PersistenceCapable and implement the CCI2 interface. JDO metadata information which allows to customize the OO-to- RR mapping. The generation of the metadata can be controlled by.openmdxjdo metadata files. JDO2 classes can be enhanced and managed by any JDOcompliant persistence manager. The JDO2 classes are de-coupled from the rest of the openmdx framework classes can be used in any kind of Java application. 10
JDO2 [2] Account.java package org.opencrx.kernel.account1.jdo2; public class Account extends org.w3c.jdo2.abstractobject implements org.opencrx.kernel.account1.cci2.account { private short accessleveldelete; public short getaccessleveldelete( ) { return this.accessleveldelete; } public void setaccessleveldelete( short accessleveldelete ) { this.accessleveldelete = accessleveldelete; } 11
JDO2 [3] Account.jdo <jdo> <package name="org.opencrx.kernel.account1.jdo2"> <class name="account" persistence-modifier="persistence-capable" detachable="true" identity-type="application" objectid-class="javax.jdo.identity.stringidentity"> <inheritance> </inheritance> <field name="openmdxjdoidentity" primary-key="true"/> <field name="segment" persistence-modifier="persistent"/> <field name="accessleveldelete" persistence-modifier="persistent"> </field> 12
JDO2 [5] Account-standard.orm <orm> <package name="org.opencrx.kernel.account1.jdo2"> <class name="account" table="oocke1_account"> <inheritance> <discriminator strategy="value-map" column="dtype" value="org:opencrx:kernel:account1:account"/> </inheritance> <version strategy="date-time"> <column name="modified_at"/> </version> <field name="openmdxjdoidentity"> <column name="object_id"/> </field> <field name="segment"> <column name="p$$parent"/> </field> <field name="accessleveldelete"> <column name="access_level_delete" allows-null="true"/> </field> 13
Providers / Architecture
Provider Architecture [1] Application EntityManagerFactory (gateway) DataProvider Layer_1 Client EntityManager PersistenceManager Entity DO Object_1 (*) UoW DataProvider Layer_1 getpersistencemanager getobjectbyid invoke operation openmdx 2 Plugins (*) openmdx 1 JMI Plugins delegating to DataproviderConnection (deprecated) A client retrieves and modifies objects using the JDO APIs (JDOHelper, PersistenceManager) All entity / object-level invocations are simple Java method invocations no EJB context switch is required to invoke application logic / plugins. The openmdx 2 service-based persistence manager supports openmdx 1 DataProviders / Layers. 15
Provider Architecture [2] Clients must be migrated to CCI2 / JMI1 APIs PersistenceManagers are configured as resources. The lookup of a persistence manager is done as follows: JDOHelper.getPersistenceManagerFactory( ); "java:comp/env/jdo/gateway", (Context)null Clients must use the JDO APIs (JDOHelper, PersistenceManager), i.e. pm.getobjectbyid() pm.currenttransaction().begin(); pm.currenttransaction().commit(); 16
Provider Architecture [3] Plugin classes do not have to extend any openmdxspecific classes anymore, e.g. public class AccountImpl { //----------------------------------------------------------------------- public AccountImpl( org.opencrx.kernel.account1.jmi1.account current, org.opencrx.kernel.account1.cci2.account next ) { this.current = current; this.next = next; } } //----------------------------------------------------------------------- public org.opencrx.kernel.account1.jmi1.createleadresult createlead( org.opencrx.kernel.account1.jmi1.createleadparams params ) { // business logic return ((Account1Package)this.current.refOutermostPackage().refPackage( Account1Package.class.getName() )).createcreateleadresult( lead ); } 17
Persistence
Persistence [1] The MOF JDO2 mapping generates JDO-compliant Java classes JDO metadata Any JDO-compliant PersistenceManager can be used for persistence management. openmdx 2 offers a service-based PersistenceManager which is backwards compatible to openmdx 1, i.e. existing databases do not have to be migrated. 19
Persistence [2] openmdx 2 Persistence Manager Based on openmdx 1 Database-Plugin Database schema can be generated using JPOX SchemaTool (requires the use of DBOSlicedWithIdAsKey) Service-based. PersistenceCapables can be created on-the-fly or retrieved from (remote) services 20
Lightweight Container
Lightweight Container Schema based deployment descriptors Integration with Tomcat 6. Tomcat/LWC allows to deploy EARs containing web and ejb modules. Tomcat/LWC supports stateless session beans leightweight deployment platform performance improvement by a factor of 2+ compared to other application servers. 22
Questions?