[exo-jcr-commits] exo-jcr SVN: r1370 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Jan 13 03:24:44 EST 2010


Author: tolusha
Date: 2010-01-13 03:24:43 -0500 (Wed, 13 Jan 2010)
New Revision: 1370

Added:
   jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java
Log:
EXOJCR-334: add JBossTransactionService

Added: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java	                        (rev 0)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java	2010-01-13 08:24:43 UTC (rev 1370)
@@ -0,0 +1,116 @@
+/*
+ * 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.jbosscache;
+
+import org.exoplatform.services.transaction.ExoResource;
+import org.exoplatform.services.transaction.TransactionService;
+import org.jboss.cache.transaction.TransactionManagerLookup;
+
+import javax.transaction.RollbackException;
+import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
+import javax.transaction.xa.Xid;
+
+/**
+ * @author <a href="mailto:dmitry.kataev at exoplatform.com">Dmytro Katayev</a>
+ * @version $Id$
+ */
+public class JBossTransactionService implements TransactionService
+{
+
+   /**
+    * TransactionManagerLookup.
+    */
+   final protected TransactionManagerLookup tmLookup;
+
+   /**
+    * JBossTransactionManagerLookup  constructor.
+    *
+    * @param tmLookup TransactionManagerLookup
+    */
+   public JBossTransactionService(TransactionManagerLookup tmLookup)
+   {
+      this.tmLookup = tmLookup;
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public Xid createXid()
+   {
+      throw new RuntimeException("Method createXid() not supported");
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void delistResource(ExoResource xares) throws RollbackException, SystemException
+   {
+      throw new RuntimeException("Method delistResource() not supported");
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void enlistResource(ExoResource xares) throws RollbackException, SystemException
+   {
+      throw new RuntimeException("Method enlistResource() not supported");
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public int getDefaultTimeout()
+   {
+      throw new RuntimeException("Method getDefaultTimeout() not supported");
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public TransactionManager getTransactionManager()
+   {
+      try
+      {
+         return tmLookup.getTransactionManager();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Transaction manager not found");
+      }
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public UserTransaction getUserTransaction()
+   {
+      throw new RuntimeException("Method UserTransaction() not supported");
+   }
+
+   /**
+    * {@inheritDoc}
+    */
+   public void setTransactionTimeout(int seconds) throws SystemException
+   {
+      throw new RuntimeException("Method setTransactionTimeout() not supported");
+   }
+
+}


Property changes on: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/transaction/jbosscache/JBossTransactionService.java
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the exo-jcr-commits mailing list