HHH-11546 Add support for SAP NetWeaver as JTA Platform

This commit is contained in:
lpradel 2017-03-05 20:28:52 +01:00 committed by Vlad Mihalcea
parent 6ec060b1d2
commit 0e83628c92
6 changed files with 56 additions and 0 deletions

View File

@ -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.

View File

@ -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> -

View File

@ -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.

View File

@ -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.

View File

@ -77,6 +77,7 @@ import org.hibernate.engine.transaction.jta.platform.internal.JRun4JtaPlatform;
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;
@ -314,6 +315,13 @@ public class StrategySelectorBuilder {
"org.hibernate.service.jta.platform.internal.ResinJtaPlatform"
);
addJtaPlatforms(
strategySelector,
SapNetWeaverJtaPlatform.class,
"SapNetWeaver",
"org.hibernate.service.jta.platform.internal.SapNetWeaverJtaPlatform"
);
addJtaPlatforms(
strategySelector,
SunOneJtaPlatform.class,

View File

@ -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 );
}
}