Each shell gets its own variables using its apps vars as its parent


git-svn-id: https://svn.apache.org/repos/asf/geronimo/gshell/trunk@726062 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java b/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
index efebbb2..ec28544 100644
--- a/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
+++ b/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
@@ -100,24 +100,18 @@
 
         assert application != null;
 
-        // Dereference some bits from the applciation context
-        final IO io = application.getIo();
+        // Each shell gets its own variables, using application variables for defaults
+        final Variables vars = new Variables(application.getVariables());
 
-        //
-        // TODO: Each shell should really have its own variables, using the apps vars as its parents
-        //       but before we do that we need to implement a general ShellContextHolder to allow
-        //       detached components access in the threads context.
-        //
-        final Variables vars = application.getVariables();
-
-        context = new ShellContext() {
-
+        context = new ShellContext()
+        {
             public Shell getShell() {
                 return ShellImpl.this;
             }
 
             public IO getIo() {
-                return io;
+                // Shells inherit the application's IO
+                return application.getIo();
             }
 
             public Variables getVariables() {