Skip to content

Commit

Permalink
HHH-11546 Add support for SAP NetWeaver as JTA Platform
Browse files Browse the repository at this point in the history
  • Loading branch information
lpradel authored and vladmihalcea committed May 16, 2017
1 parent 6ec060b commit 0e83628
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 0 deletions.
Expand Up @@ -81,6 +81,7 @@ Hibernate provides many implementations of the `JtaPlatform` contract, all with
`OC4J`:: `JtaPlatform` for Oracle's OC4J container.
`Orion`:: `JtaPlatform` for the Orion Application Server.
`Resin`:: `JtaPlatform` for the Resin Application Server.
`SapNetWeaver`:: `JtaPlatform` for the SAP NetWeaver Application Server.
`SunOne`:: `JtaPlatform` for the SunOne Application Server.
`Weblogic`:: `JtaPlatform` for the Weblogic Application Server.
`WebSphere`:: `JtaPlatform` for older versions of the WebSphere Application Server.
Expand Down
Expand Up @@ -505,6 +505,13 @@
Can also be referenced using the <property>Resin</property> configuration short name
</para>
</listitem>
<listitem>
<para>
<classname>org.hibernate.engine.transaction.jta.platform.internal.SapNetWeaverJtaPlatform</classname> -
Integration with transaction manager as deployed in a SAP NetWeaver application server.
Can also be referenced using the <property>SapNetWeaver</property> configuration short name
</para>
</listitem>
<listitem>
<para>
<classname>org.hibernate.engine.transaction.jta.platform.internal.SunOneJtaPlatform</classname> -
Expand Down
Expand Up @@ -505,6 +505,11 @@
<literal>Resin</literal> - JtaPlatform for the Resin Application Server.
</para>
</listitem>
<listitem>
<para>
<literal>SapNetWeaver</literal> - JtaPlatform for the SAP NetWeaver Application Server.
</para>
</listitem>
<listitem>
<para>
<literal>SunOne</literal> - JtaPlatform for the SunOne Application Server.
Expand Down
Expand Up @@ -177,6 +177,11 @@
<literal>Resin</literal> - JtaPlatform for the Resin Application Server.
</para>
</listitem>
<listitem>
<para>
<literal>SapNetWeaver</literal> - JtaPlatform for the SAP NetWeaver Application Server.
</para>
</listitem>
<listitem>
<para>
<literal>SunOne</literal> - JtaPlatform for the SunOne Application Server.
Expand Down
Expand Up @@ -77,6 +77,7 @@
import org.hibernate.engine.transaction.jta.platform.internal.OC4JJtaPlatform;
import org.hibernate.engine.transaction.jta.platform.internal.OrionJtaPlatform;
import org.hibernate.engine.transaction.jta.platform.internal.ResinJtaPlatform;
import org.hibernate.engine.transaction.jta.platform.internal.SapNetWeaverJtaPlatform;
import org.hibernate.engine.transaction.jta.platform.internal.SunOneJtaPlatform;
import org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform;
import org.hibernate.engine.transaction.jta.platform.internal.WebSphereJtaPlatform;
Expand Down Expand Up @@ -314,6 +315,13 @@ private void addJtaPlatforms(StrategySelectorImpl strategySelector) {
"org.hibernate.service.jta.platform.internal.ResinJtaPlatform"
);

addJtaPlatforms(
strategySelector,
SapNetWeaverJtaPlatform.class,
"SapNetWeaver",
"org.hibernate.service.jta.platform.internal.SapNetWeaverJtaPlatform"
);

addJtaPlatforms(
strategySelector,
SunOneJtaPlatform.class,
Expand Down
@@ -0,0 +1,30 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.engine.transaction.jta.platform.internal;

import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;

/**
* {@link org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform} implementation for SAP NetWeaver
*
* @author Lukas Pradel
*/
public class SapNetWeaverJtaPlatform extends AbstractJtaPlatform {
public static final String TM_NAME = "TransactionManager";
public static final String UT_NAME = "UserTransaction";

@Override
protected TransactionManager locateTransactionManager() {
return (TransactionManager) jndiService().locate( TM_NAME );
}

@Override
protected UserTransaction locateUserTransaction() {
return (UserTransaction) jndiService().locate( UT_NAME );
}
}

0 comments on commit 0e83628

Please sign in to comment.