You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2004/09/30 10:27:12 UTC

svn commit: rev 47570 - in geronimo/trunk/modules/client: . src/java/org/apache/geronimo/client

Author: djencks
Date: Thu Sep 30 01:27:11 2004
New Revision: 47570

Modified:
   geronimo/trunk/modules/client/project.xml
   geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java
Log:
Install a TransactionContext.  Resource-refs now work in the app client

Modified: geronimo/trunk/modules/client/project.xml
==============================================================================
--- geronimo/trunk/modules/client/project.xml	(original)
+++ geronimo/trunk/modules/client/project.xml	Thu Sep 30 01:27:11 2004
@@ -47,21 +47,28 @@
     <!-- ============ -->
 
     <dependencies>
+
         <dependency>
             <groupId>geronimo</groupId>
-            <artifactId>geronimo-naming</artifactId>
+            <artifactId>geronimo-kernel</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
 
         <dependency>
             <groupId>geronimo</groupId>
-            <artifactId>geronimo-kernel</artifactId>
+            <artifactId>geronimo-naming</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
 
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-system</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-transaction</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
 

Modified: geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java
==============================================================================
--- geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java	(original)
+++ geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java	Thu Sep 30 01:27:11 2004
@@ -22,6 +22,8 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoFactory;
+import org.apache.geronimo.transaction.context.TransactionContext;
+import org.apache.geronimo.transaction.context.UnspecifiedTransactionContext;
 
 /**
  * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
@@ -60,35 +62,31 @@
     }
 
     public void main(String[] args) throws Exception {
-        Throwable throwable = null;
         Thread thread = Thread.currentThread();
 
         ClassLoader contextClassLoader = thread.getContextClassLoader();
         thread.setContextClassLoader(classLoader);
+        TransactionContext oldTransactionContext = TransactionContext.getContext();
 
         try {
             jndiContext.startClient(appClientModuleName);
-
+            TransactionContext.setContext(new UnspecifiedTransactionContext());
             mainMethod.invoke(null, new Object[]{args});
 
         } catch (InvocationTargetException e) {
             Throwable cause = e.getCause();
             if (cause instanceof Exception) {
-                throwable = cause;
+                throw (Exception) cause;
             } else if (cause instanceof Error) {
-                throwable = cause;
+                throw (Error) cause;
             }
-            throwable = new Error(e);
+            throw new Error(e);
         } finally {
             jndiContext.stopClient(appClientModuleName);
 
             thread.setContextClassLoader(contextClassLoader);
+            TransactionContext.setContext(oldTransactionContext);
 
-            if (throwable instanceof Exception) {
-                throw (Exception) throwable;
-            } else if (throwable instanceof Error) {
-                throw (Error) throwable;
-            }
         }
     }