Revision: 1436
          http://svn.sourceforge.net/spring-rich-c/?rev=1436&view=rev
Author:   ge0ffrey
Date:     2006-09-22 07:27:55 -0700 (Fri, 22 Sep 2006)

Log Message:
-----------
cleaned up method order, javadoc errors and Exception instead of 
RuntimeException catching

Modified Paths:
--------------
    
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/ApplicationLauncher.java

Modified: 
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/ApplicationLauncher.java
===================================================================
--- 
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/ApplicationLauncher.java
   2006-09-22 12:55:18 UTC (rev 1435)
+++ 
trunk/spring-richclient/support/src/main/java/org/springframework/richclient/application/ApplicationLauncher.java
   2006-09-22 14:27:55 UTC (rev 1436)
@@ -79,7 +79,7 @@
      * loading of the application splash screen.
      * 
      * @param startupContext the startup context classpath
-     * @param contextPaths the classpath application context paths
+     * @param rootContextPath the classpath application context path
      */
     public ApplicationLauncher(String startupContext, String rootContextPath) {
         this(startupContext, new String[] {rootContextPath});
@@ -103,6 +103,38 @@
         launchMyRichClient();
     }
 
+    /**
+     * Launch the application from the pre-loaded application context.
+     *
+     * @param rootApplicationContext the application context.
+     */
+    public ApplicationLauncher(ApplicationContext rootApplicationContext) {
+        this(null, rootApplicationContext);
+    }
+
+    /**
+     * Launch the application from the pre-loaded application context.
+     *
+     * @param rootApplicationContext the application context.
+     */
+    public ApplicationLauncher(String startupContextPath, ApplicationContext 
rootApplicationContext) {
+        this.startupContext = loadStartupContext(startupContextPath);
+        if (startupContext != null) {
+            displaySplashScreen(startupContext);
+        }
+        setRootApplicationContext(rootApplicationContext);
+        launchMyRichClient();
+    }
+
+    private ApplicationContext loadStartupContext(String startupContextPath) {
+        if (StringUtils.hasText(startupContextPath)) {
+            logger.info("Loading startup context...");
+            return new ClassPathXmlApplicationContext(startupContextPath);
+        } else {
+            return null;
+        }
+    }
+
     private ApplicationContext loadRootApplicationContext(String[] 
contextPaths) {
         try {
             final ClassPathXmlApplicationContext applicationContext = new 
ClassPathXmlApplicationContext(contextPaths,
@@ -151,7 +183,7 @@
 
             return applicationContext;
         }
-        catch (Exception e) {
+        catch (RuntimeException e) {
             logger.warn("Exception occured initializing application startup 
context.", e);
             destroySplashScreen(); // when app context fails to load, destroy
             // splashscreen
@@ -159,48 +191,11 @@
         }
     }
 
-    /**
-     * Launch the application from the pre-loaded application context.
-     * 
-     * @param context the application context.
-     */
-    public ApplicationLauncher(String startupContextPath, ApplicationContext 
rootApplicationContext) {
-        this.startupContext = loadStartupContext(startupContextPath);
-        if (startupContext != null) {
-            displaySplashScreen(startupContext);
-        }
-        setRootApplicationContext(rootApplicationContext);
-        launchMyRichClient();
-    }
-
-    /**
-     * Launch the application from the pre-loaded application context.
-     * 
-     * @param context the application context.
-     */
-    public ApplicationLauncher(ApplicationContext rootApplicationContext) {
-        setRootApplicationContext(rootApplicationContext);
-        launchMyRichClient();
-    }
-
     private void setRootApplicationContext(ApplicationContext context) {
         Assert.notNull(context, "The root rich client application context is 
required");
         this.rootApplicationContext = context;
     }
 
-    private ApplicationContext loadStartupContext(String startupContextPath) {
-        logger.info("Loading startup context...");
-        try {
-            if (StringUtils.hasText(startupContextPath)) {
-                return new ClassPathXmlApplicationContext(startupContextPath);
-            }
-        }
-        catch (Exception e) {
-            logger.warn("Exception occured initializing startup context.", e);
-        }
-        return null;
-    }
-
     /**
      * Launch this rich client application; with the startup context loading 
first, built
      * from the <code>startupContextPath</code> location in the classpath.
@@ -248,7 +243,7 @@
                 logger.info("No splash screen bean found to 
display--continuing...");
             }
         }
-        catch (Exception e) {
+        catch (RuntimeException e) {
             logger.warn("Unable to load and display startup splash screen.", 
e);
         }
     }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
spring-rich-c-cvs mailing list
spring-rich-c-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spring-rich-c-cvs

Reply via email to