[jboss-cvs] JBossAS SVN: r77171 - trunk/ejb3/src/main/org/jboss/ejb3/client.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 18 16:39:18 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-08-18 16:39:18 -0400 (Mon, 18 Aug 2008)
New Revision: 77171

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java
Log:
JBAS-5457, Make the main client class as loaded by the mc loaders available

Modified: trunk/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java	2008-08-18 20:11:08 UTC (rev 77170)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java	2008-08-18 20:39:18 UTC (rev 77171)
@@ -84,7 +84,15 @@
 
    /** The deployer */
    private static BasicXMLDeployer deployer;
+   /** The mainClass used by the ClientContainer */
+   private static Class<?> theMainClass;
 
+   
+   public static Class<?> getTheMainClass()
+   {
+      return theMainClass;
+   }
+
    /**
     * Convenience method for launching a client container.
     * 
@@ -246,10 +254,15 @@
          if (clientContainerClass.getClassLoader() != ccLoader)
             log.warn(clientContainerClass.getClassLoader()+" != "+ccLoader);
 
-         // Invoke main on the underlying client main class through the ClientContain
+         // Invoke main on the underlying client main class through the ClientContainer
          ClassLoader prevLoader = Thread.currentThread().getContextClassLoader();
          try
          {
+            // Get the mainClass
+            Class<?> empty[] = {};
+            Method getMainClass = clientContainerClass.getDeclaredMethod("getMainClass", empty);
+            theMainClass = (Class<?>) getMainClass.invoke(client, null);
+            // Invoke main
             Thread.currentThread().setContextClassLoader(ccLoader);
             Class<?> parameterTypes[] = { args.getClass() };
             Method invokeMain = clientContainerClass.getDeclaredMethod("invokeMain", parameterTypes);




More information about the jboss-cvs-commits mailing list