[seam-commits] Seam SVN: r13548 - in modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence: util and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Tue Aug 3 03:58:36 EDT 2010


Author: swd847
Date: 2010-08-03 03:58:35 -0400 (Tue, 03 Aug 2010)
New Revision: 13548

Added:
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EJBContextUtils.java
Removed:
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java
Modified:
   modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java
Log:
minor refactoring


Deleted: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java	2010-08-03 07:52:12 UTC (rev 13547)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java	2010-08-03 07:58:35 UTC (rev 13548)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * 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.jboss.seam.persistence.transaction;
-
-import javax.ejb.EJBContext;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-
-import org.jboss.seam.persistence.util.NamingUtils;
-
-/**
- * utility class to look up the EJBContext
- * 
- * 
- */
-public class EJB
-{
-   public static String ejbContextName = "java:comp.ejb3/EJBContext";
-   public static final String STANDARD_EJB_CONTEXT_NAME = "java:comp/EJBContext";
-
-   public static EJBContext getEJBContext() throws NamingException
-   {
-      try
-      {
-         return (EJBContext) NamingUtils.getInitialContext().lookup(ejbContextName);
-      }
-      catch (NameNotFoundException nnfe)
-      {
-         return (EJBContext) NamingUtils.getInitialContext().lookup(STANDARD_EJB_CONTEXT_NAME);
-      }
-   }
-
-   protected static String getEjbContextName()
-   {
-      return ejbContextName;
-   }
-
-   protected static void setEjbContextName(String ejbContextName)
-   {
-      EJB.ejbContextName = ejbContextName;
-   }
-
-}

Modified: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java	2010-08-03 07:52:12 UTC (rev 13547)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/TransactionInvocationHandler.java	2010-08-03 07:58:35 UTC (rev 13548)
@@ -10,6 +10,7 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
+import org.jboss.seam.persistence.util.EJBContextUtils;
 import org.jboss.seam.persistence.util.NamingUtils;
 import org.jboss.weld.extensions.literal.DefaultLiteral;
 
@@ -62,7 +63,7 @@
 
    protected SeamTransaction createCMTTransaction() throws NamingException
    {
-      return new CMTTransaction(EJB.getEJBContext(), synchronizations);
+      return new CMTTransaction(EJBContextUtils.getEJBContext(), synchronizations);
    }
 
    protected SeamTransaction createUTTransaction() throws NamingException

Copied: modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EJBContextUtils.java (from rev 13513, modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/transaction/EJB.java)
===================================================================
--- modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EJBContextUtils.java	                        (rev 0)
+++ modules/persistence/trunk/impl/src/main/java/org/jboss/seam/persistence/util/EJBContextUtils.java	2010-08-03 07:58:35 UTC (rev 13548)
@@ -0,0 +1,61 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * 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.jboss.seam.persistence.util;
+
+import javax.ejb.EJBContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
+
+/**
+ * utility class to look up the EJBContext
+ * 
+ * 
+ */
+public class EJBContextUtils
+{
+   public static String ejbContextName = "java:comp.ejb3/EJBContext";
+   public static final String STANDARD_EJB_CONTEXT_NAME = "java:comp/EJBContext";
+
+   public static EJBContext getEJBContext() throws NamingException
+   {
+      try
+      {
+         return (EJBContext) NamingUtils.getInitialContext().lookup(ejbContextName);
+      }
+      catch (NameNotFoundException nnfe)
+      {
+         return (EJBContext) NamingUtils.getInitialContext().lookup(STANDARD_EJB_CONTEXT_NAME);
+      }
+   }
+
+   protected static String getEjbContextName()
+   {
+      return ejbContextName;
+   }
+
+   protected static void setEjbContextName(String ejbContextName)
+   {
+      EJBContextUtils.ejbContextName = ejbContextName;
+   }
+
+}



More information about the seam-commits mailing list