[exo-jcr-commits] exo-jcr SVN: r4403 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan and 1 other directory.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon May 23 03:41:44 EDT 2011
Author: tolusha
Date: 2011-05-23 03:41:43 -0400 (Mon, 23 May 2011)
New Revision: 4403
Added:
jcr/trunk/applications/product-patches/as/jboss/bin/run.conf
jcr/trunk/applications/product-patches/as/jboss/bin/run.conf.bat
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java
Log:
EXOJCR-480: Managed transactions support
Added: jcr/trunk/applications/product-patches/as/jboss/bin/run.conf
===================================================================
--- jcr/trunk/applications/product-patches/as/jboss/bin/run.conf (rev 0)
+++ jcr/trunk/applications/product-patches/as/jboss/bin/run.conf 2011-05-23 07:41:43 UTC (rev 4403)
@@ -0,0 +1,58 @@
+## -*- shell-script -*- ######################################################
+## ##
+## JBoss Bootstrap Script Configuration ##
+## ##
+##############################################################################
+
+### $Id: run.conf 88389 2009-05-08 02:37:00Z ispringer $
+
+#
+# This shell script is sourced by run.sh to initialize the environment
+# variables that run.sh uses. It is recommended to use this file to
+# configure these variables, rather than modifying run.sh itself.
+#
+
+#
+# Specify the maximum file descriptor limit, use "max" or "maximum" to use
+# the default, as queried by the system.
+#
+# Defaults to "maximum"
+#
+#MAX_FD="maximum"
+
+#
+# Specify the JBoss Profiler configuration file to load.
+#
+# Default is to not load a JBoss Profiler configuration file.
+#
+#PROFILER=""
+
+#
+# Specify the location of the Java home directory. If set then $JAVA will
+# be defined to $JAVA_HOME/bin/java, else $JAVA will be "java".
+#
+#JAVA_HOME="/usr/java/jdk1.6.0"
+
+#
+# Specify the exact Java VM executable to use.
+#
+#JAVA=""
+
+#
+# Specify options to pass to the Java VM.
+#
+if [ "x$JAVA_OPTS" = "x" ]; then
+ JAVA_OPTS="-Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
+fi
+
+# Sample JPDA settings for remote socket debugging
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+
+# Sample JPDA settings for shared memory debugging
+#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_shmem,address=jboss,server=y,suspend=n"
+
+# Add the eXo variables
+JAVA_OPTS="$JAVA_OPTS -Dexo.profiles=$1 -Dexo.jcr.parent.dir=../server/default/data"
+if [ "$1" = "jbc" ] || [ "$1" = "ispn" ]; then
+ shift
+fi
\ No newline at end of file
Added: jcr/trunk/applications/product-patches/as/jboss/bin/run.conf.bat
===================================================================
--- jcr/trunk/applications/product-patches/as/jboss/bin/run.conf.bat (rev 0)
+++ jcr/trunk/applications/product-patches/as/jboss/bin/run.conf.bat 2011-05-23 07:41:43 UTC (rev 4403)
@@ -0,0 +1,63 @@
+rem ### -*- batch file -*- ######################################################
+rem # ##
+rem # JBoss Bootstrap Script Configuration ##
+rem # ##
+rem #############################################################################
+
+rem # $Id: run.conf.bat 88820 2009-05-13 15:25:44Z dimitris at jboss.org $
+
+rem #
+rem # This batch file is executed by run.bat to initialize the environment
+rem # variables that run.bat uses. It is recommended to use this file to
+rem # configure these variables, rather than modifying run.bat itself.
+rem #
+
+if not "x%JAVA_OPTS%" == "x" goto JAVA_OPTS_SET
+
+rem #
+rem # Specify the JBoss Profiler configuration file to load.
+rem #
+rem # Default is to not load a JBoss Profiler configuration file.
+rem #
+rem set "PROFILER=%JBOSS_HOME%\bin\jboss-profiler.properties"
+
+rem #
+rem # Specify the location of the Java home directory (it is recommended that
+rem # this always be set). If set, then "%JAVA_HOME%\bin\java" will be used as
+rem # the Java VM executable; otherwise, "%JAVA%" will be used (see below).
+rem #
+rem set "JAVA_HOME=C:\opt\jdk1.6.0_13"
+
+rem #
+rem # Specify the exact Java VM executable to use - only used if JAVA_HOME is
+rem # not set. Default is "java".
+rem #
+rem set "JAVA=C:\opt\jdk1.6.0_13\bin\java"
+
+rem #
+rem # Specify options to pass to the Java VM. Note, there are some additional
+rem # options that are always passed by run.bat.
+rem #
+
+rem # JVM memory allocation pool parameters - modify as appropriate.
+set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"
+
+rem # Reduce the RMI GCs to once per hour for Sun JVMs.
+set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
+
+rem # Warn when resolving remote XML DTDs or schemas.
+set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true"
+
+rem # Sample JPDA settings for remote socket debugging
+rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
+
+rem # Sample JPDA settings for shared memory debugging
+rem set "JAVA_OPTS=%JAVA_OPTS% -Xrunjdwp:transport=dt_shmem,address=jboss,server=y,suspend=n"
+
+rem # Add the eXo variables
+set "JAVA_OPTS=%JAVA_OPTS% -Dexo.profiles=%1 -Dexo.jcr.parent.dir=../server/default/data"
+
+if ""%1"" == ""jbc"" shift
+if ""%1"" == ""ispn"" shift
+
+:JAVA_OPTS_SET
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/GenericTransactionService.java 2011-05-23 07:41:43 UTC (rev 4403)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.transaction.infinispan;
+
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.services.transaction.impl.AbstractTransactionService;
+import org.infinispan.transaction.lookup.TransactionManagerLookup;
+
+import javax.transaction.TransactionManager;
+
+/**
+ * @author <a href="mailto:dmitry.kataev at exoplatform.com">Dmytro Katayev</a>
+ * @version $Id: GenericTransactionService.java -1 $
+ */
+public class GenericTransactionService extends AbstractTransactionService
+{
+
+ /**
+ * TransactionManagerLookup.
+ */
+ protected final TransactionManagerLookup tmLookup;
+
+ /**
+ * JBossTransactionManagerLookup constructor.
+ *
+ * @param tmLookup TransactionManagerLookup
+ */
+ public GenericTransactionService(TransactionManagerLookup tmLookup)
+ {
+ this(tmLookup, null);
+ }
+
+ public GenericTransactionService(TransactionManagerLookup tmLookup, InitParams params)
+ {
+ super(params);
+ this.tmLookup = tmLookup;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public TransactionManager findTransactionManager() throws Exception
+ {
+ return tmLookup.getTransactionManager();
+ }
+}
Added: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java (rev 0)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/infinispan/JBossTransactionsService.java 2011-05-23 07:41:43 UTC (rev 4403)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.transaction.infinispan;
+
+import org.exoplatform.container.xml.InitParams;
+import org.infinispan.transaction.lookup.TransactionManagerLookup;
+
+import javax.transaction.UserTransaction;
+
+/**
+ * Add the specific part for Arjuna
+ *
+ * @author <a href="mailto:nicolas.filotto at exoplatform.com">Nicolas Filotto</a>
+ * @version $Id$
+ *
+ */
+public class JBossTransactionsService extends GenericTransactionService
+{
+
+ public JBossTransactionsService(TransactionManagerLookup tmLookup)
+ {
+ super(tmLookup);
+ }
+
+ public JBossTransactionsService(TransactionManagerLookup tmLookup, InitParams params)
+ {
+ super(tmLookup, params);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected UserTransaction findUserTransaction() throws Exception
+ {
+ return com.arjuna.ats.jta.UserTransaction.userTransaction();
+ }
+}
More information about the exo-jcr-commits
mailing list