[jboss-cvs] JBossAS SVN: r96802 - projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Nov 24 05:15:20 EST 2009


Author: ctomc
Date: 2009-11-24 05:15:20 -0500 (Tue, 24 Nov 2009)
New Revision: 96802

Modified:
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java
Log:
even less lookups

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java	2009-11-24 10:10:55 UTC (rev 96801)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java	2009-11-24 10:15:20 UTC (rev 96802)
@@ -651,7 +651,7 @@
 
         // would be nice to have a wrapper that returns null and throws no exceptions
         try {
-            actx = (Context) new InitialContext().lookup("java:/FRESH/GlobalContext");
+            actx = getComponentByType(Context.class);//(Context) new InitialContext().lookup("java:/FRESH/GlobalContext");
         } catch (Exception ex) {
             //log.warn("Could not get context",ex);
         }
@@ -707,10 +707,10 @@
 
             if (ti == null) {
                 if (i == 0) {
-                    c = (Context) ctx.get("AppContext");
+                    c =  (Context) ctx.get("AppContext");
                     if (c == null) {
                         try {
-                            c = (Context) new InitialContext().lookup("java:/FRESH/GlobalContext");
+                            c = getComponentByType(Context.class);//(Context) new InitialContext().lookup("java:/FRESH/GlobalContext");
                         } catch (Exception ex) {
                         }
                         i++;
@@ -718,7 +718,7 @@
                 } else if (i == 1) {
 
                     try {
-                        c = (Context) new InitialContext().lookup("java:/FRESH/GlobalContext");
+                        c = getComponentByType(Context.class);//(Context) new InitialContext().lookup("java:/FRESH/GlobalContext");
                     } catch (Exception ex) {
                     }
                     if (c == null) {




More information about the jboss-cvs-commits mailing list