geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r694356 - in /geronimo/gshell/trunk: gshell-application/src/main/java/org/apache/geronimo/gshell/application/ gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/ gshell-commands/gshell-builtins/src/main/java/or...
Date Thu, 11 Sep 2008 17:06:46 GMT
Author: jdillon
Date: Thu Sep 11 10:06:43 2008
New Revision: 694356

URL: http://svn.apache.org/viewvc?rev=694356&view=rev
Log:
Rename ApplicationContext to Application
Added Settings
Added accessors for ApplicationConfiguredEvent and SettingsConfiguredEvent to get to the typed
source
Using ApplicationConfiguredEvent to attach components
Added event for when we create a shell

Added:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
  (contents, props changed)
      - copied, changed from r694338, geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
  (with props)
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
  (contents, props changed)
      - copied, changed from r694338, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java
Removed:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java
Modified:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/SettingsManager.java
    geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/SettingsConfiguredEvent.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineBuilderImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineExecutorImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/LayoutManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
(from r694338, geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java&p1=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java&r1=694338&r2=694356&rev=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationContext.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
Thu Sep 11 10:06:43 2008
@@ -28,10 +28,8 @@
  *
  * @version $Rev$ $Date$
  */
-public interface ApplicationContext
+public interface Application
 {
-    // TODO: Rename to Application
-
     IO getIo();
 
     Variables getVariables();

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/Application.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/ApplicationManager.java
Thu Sep 11 10:06:43 2008
@@ -31,5 +31,5 @@
 {
     void configure(ApplicationConfiguration config) throws Exception;
 
-    ApplicationContext getContext();
+    Application getApplication();
 }
\ No newline at end of file

Added: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java?rev=694356&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
(added)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
Thu Sep 11 10:06:43 2008
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.geronimo.gshell.application.settings;
+
+import org.apache.geronimo.gshell.model.settings.SettingsModel;
+
+/**
+ * Encapsulates the context for user settings.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface Settings
+{
+    SettingsModel getModel();
+}
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/Settings.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/SettingsManager.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/SettingsManager.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/SettingsManager.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/settings/SettingsManager.java
Thu Sep 11 10:06:43 2008
@@ -28,7 +28,7 @@
  */
 public interface SettingsManager
 {
-    SettingsModel getModel();
+    Settings getSettings();
 
     void configure(SettingsConfiguration config) throws Exception;
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
(original)
+++ geronimo/gshell/trunk/gshell-commands/gshell-builtins/src/main/java/org/apache/geronimo/gshell/commands/builtins/HelpCommand.java
Thu Sep 11 10:06:43 2008
@@ -93,7 +93,7 @@
         assert context != null;
 
         IO io = context.getIo();
-        String about = applicationManager.getContext().getModel().getBranding().getAboutMessage();
+        String about = applicationManager.getApplication().getModel().getBranding().getAboutMessage();
 
         if (about != null) {
             io.out.print(about);

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
Thu Sep 11 10:06:43 2008
@@ -20,7 +20,7 @@
 package org.apache.geronimo.gshell.wisdom.application;
 
 import org.apache.geronimo.gshell.application.ApplicationConfiguration;
-import org.apache.geronimo.gshell.application.ApplicationContext;
+import org.apache.geronimo.gshell.application.Application;
 import org.apache.geronimo.gshell.application.ApplicationManager;
 import org.apache.geronimo.gshell.application.ApplicationSecurityManager;
 import org.apache.geronimo.gshell.application.settings.SettingsManager;
@@ -38,6 +38,7 @@
 import org.apache.geronimo.gshell.spring.BeanContainer;
 import org.apache.geronimo.gshell.spring.BeanContainerAware;
 import org.apache.geronimo.gshell.wisdom.application.event.ApplicationConfiguredEvent;
+import org.apache.geronimo.gshell.wisdom.application.event.ShellCreatedEvent;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
@@ -77,7 +78,7 @@
     @Autowired
     private SettingsManager settingsManager;
 
-    private ApplicationContext applicationContext;
+    private Application application;
 
     private BeanContainer container;
 
@@ -89,12 +90,12 @@
         this.container = container;
     }
 
-    public ApplicationContext getContext() {
-        if (applicationContext == null) {
+    public Application getApplication() {
+        if (application == null) {
             throw new IllegalStateException("Application has not been configured");
         }
 
-        return applicationContext;
+        return application;
     }
 
     public void configure(final ApplicationConfiguration config) throws Exception {
@@ -112,7 +113,7 @@
         configure(config.getModel());
 
         // Create a new context
-        applicationContext = new ApplicationContext() {
+        application = new Application() {
             public IO getIo() {
                 return config.getIo();
             }
@@ -142,7 +143,7 @@
 
         // User settings should override the applications
         assert settingsManager != null;
-        SettingsModel settingsModel = settingsManager.getModel();
+        SettingsModel settingsModel = settingsManager.getSettings().getModel();
         if (settingsModel != null) {
             interp.addValueSource(new PropertiesBasedValueSource(settingsModel.getProperties()));
         }
@@ -229,6 +230,7 @@
             "gshell-spring",
             "gshell-wisdom-bootstrap",
             "gshell-yarn",
+            "gshell-interpolation",
             "jcl104-over-slf4j",
             "jline",
             "log4j",
@@ -304,7 +306,7 @@
 
     public Shell create() throws Exception {
         // Make sure that we have a valid context
-        getContext();
+        getApplication();
 
         // Have to use named instance to prevent unique lookup problems due to shell also
being a CommandLineExecutor instance
         final Shell shell = applicationContainer.getBean("shell", Shell.class);
@@ -349,6 +351,8 @@
 
         log.debug("Create shell proxy: {}", proxy);
 
+        applicationContainer.publish(new ShellCreatedEvent(proxy));
+        
         return proxy;
     }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
Thu Sep 11 10:06:43 2008
@@ -21,6 +21,7 @@
 
 import org.apache.geronimo.gshell.application.settings.SettingsConfiguration;
 import org.apache.geronimo.gshell.application.settings.SettingsManager;
+import org.apache.geronimo.gshell.application.settings.Settings;
 import org.apache.geronimo.gshell.artifact.ArtifactManager;
 import org.apache.geronimo.gshell.model.common.RemoteRepository;
 import org.apache.geronimo.gshell.model.interpolate.Interpolator;
@@ -49,6 +50,8 @@
 
     private SettingsConfiguration settingsConfiguration;
 
+    private Settings settings;
+
     private BeanContainer container;
 
     public void setBeanContainer(final BeanContainer container) {
@@ -57,12 +60,12 @@
         this.container = container;
     }
 
-    public SettingsModel getModel() {
-        if (settingsConfiguration == null) {
+    public Settings getSettings() {
+        if (settings == null) {
             throw new IllegalStateException("Not configured");
         }
 
-        return settingsConfiguration.getModel();
+        return settings;
     }
 
     public void configure(final SettingsConfiguration config) throws Exception {
@@ -85,6 +88,13 @@
 
         settingsConfiguration = config;
 
+        settings = new Settings()
+        {
+            public SettingsModel getModel() {
+                return settingsConfiguration.getModel();
+            }
+        };
+
         log.debug("Settings configured");
 
         container.publish(new SettingsConfiguredEvent(this));

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java
Thu Sep 11 10:06:43 2008
@@ -20,6 +20,8 @@
 package org.apache.geronimo.gshell.wisdom.application.event;
 
 import org.springframework.context.ApplicationEvent;
+import org.apache.geronimo.gshell.application.ApplicationManager;
+import org.apache.geronimo.gshell.application.Application;
 
 /**
  * Event fired once the application has been configured.
@@ -29,7 +31,15 @@
 public class ApplicationConfiguredEvent
     extends ApplicationEvent
 {
-    public ApplicationConfiguredEvent(final Object source) {
+    public ApplicationConfiguredEvent(final ApplicationManager source) {
         super(source);
     }
+
+    public ApplicationManager getApplicationManager() {
+        return (ApplicationManager) getSource();
+    }
+
+    public Application getApplication() {
+        return getApplicationManager().getApplication();
+    }
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/SettingsConfiguredEvent.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/SettingsConfiguredEvent.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/SettingsConfiguredEvent.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/SettingsConfiguredEvent.java
Thu Sep 11 10:06:43 2008
@@ -20,6 +20,8 @@
 package org.apache.geronimo.gshell.wisdom.application.event;
 
 import org.springframework.context.ApplicationEvent;
+import org.apache.geronimo.gshell.application.settings.SettingsManager;
+import org.apache.geronimo.gshell.application.settings.Settings;
 
 /**
  * Event fired once settings have been configured.
@@ -29,7 +31,15 @@
 public class SettingsConfiguredEvent
     extends ApplicationEvent
 {
-    public SettingsConfiguredEvent(final Object source) {
+    public SettingsConfiguredEvent(final SettingsManager source) {
         super(source);
     }
+
+    public SettingsManager getSettingsManager() {
+        return (SettingsManager) getSource();
+    }
+
+    public Settings getSettings() {
+        return getSettingsManager().getSettings();
+    }
 }
\ No newline at end of file

Copied: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
(from r694338, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java?p2=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java&r1=694338&r2=694356&rev=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ApplicationConfiguredEvent.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
Thu Sep 11 10:06:43 2008
@@ -19,17 +19,22 @@
 
 package org.apache.geronimo.gshell.wisdom.application.event;
 
+import org.apache.geronimo.gshell.shell.Shell;
 import org.springframework.context.ApplicationEvent;
 
 /**
- * Event fired once the application has been configured.
- *
+ * Event fired once the application has constructed a shell.
+ * 
  * @version $Rev$ $Date$
  */
-public class ApplicationConfiguredEvent
+public class ShellCreatedEvent
     extends ApplicationEvent
 {
-    public ApplicationConfiguredEvent(final Object source) {
+    public ShellCreatedEvent(final Shell source) {
         super(source);
     }
+
+    public Shell getShell() {
+        return (Shell) getSource();
+    }
 }
\ No newline at end of file

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-bootstrap/src/main/java/org/apache/geronimo/gshell/wisdom/application/event/ShellCreatedEvent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineBuilderImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineBuilderImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineBuilderImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineBuilderImpl.java
Thu Sep 11 10:06:43 2008
@@ -83,7 +83,7 @@
 
         try {
             assert applicationManager != null;
-            final Variables vars = applicationManager.getContext().getVariables();
+            final Variables vars = applicationManager.getApplication().getVariables();
             final ASTCommandLine root = parse(commandLine);
 
             return new CommandLine() {

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineExecutorImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineExecutorImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineExecutorImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/CommandLineExecutorImpl.java
Thu Sep 11 10:06:43 2008
@@ -102,7 +102,7 @@
 
         log.info("Executing (Object...): [{}]", Arguments.asString(args));
 
-        return execute(String.valueOf(args[0]), Arguments.shift(args), applicationManager.getContext().getIo());
+        return execute(String.valueOf(args[0]), Arguments.shift(args), applicationManager.getApplication().getIo());
     }
 
     public Object execute(final String path, final Object[] args) throws Exception {
@@ -111,7 +111,7 @@
 
         log.info("Executing ({}): [{}]", path, Arguments.asString(args));
 
-        return execute(path, args, applicationManager.getContext().getIo());
+        return execute(path, args, applicationManager.getApplication().getIo());
     }
 
     public Object execute(final Object[][] commands) throws Exception {
@@ -121,7 +121,7 @@
         final IO[] ios = new IO[commands.length];
         PipedOutputStream pos = null;
 
-        IO io = applicationManager.getContext().getIo();
+        IO io = applicationManager.getApplication().getIo();
 
         for (int i = 0; i < ios.length; i++) {
             InputStream is = (i == 0) ? io.inputStream : new PipedInputStream(pos);
@@ -200,7 +200,7 @@
     protected Object execute(final String path, final Object[] args, final IO io) throws
Exception {
         log.debug("Executing");
 
-        final Variables variables = applicationManager.getContext().getVariables();
+        final Variables variables = applicationManager.getApplication().getVariables();
 
         final Command command = commandResolver.resolve(variables, path);
 

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/HistoryImpl.java
Thu Sep 11 10:06:43 2008
@@ -20,11 +20,9 @@
 package org.apache.geronimo.gshell.wisdom.shell;
 
 import jline.History;
-import org.apache.geronimo.gshell.application.ApplicationManager;
 import org.apache.geronimo.gshell.wisdom.application.event.ApplicationConfiguredEvent;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.ApplicationEvent;
 import org.springframework.context.ApplicationListener;
 
@@ -42,19 +40,16 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    @Autowired
-    private ApplicationManager applicationManager;
-
     public HistoryImpl() {}
 
     public void onApplicationEvent(final ApplicationEvent event) {
         assert event != null;
 
         if (event instanceof ApplicationConfiguredEvent) {
-            assert applicationManager != null;
+            ApplicationConfiguredEvent targetEvent = (ApplicationConfiguredEvent)event;
 
             try {
-                File file = applicationManager.getContext().getModel().getBranding().getHistoryFile();
+                File file = targetEvent.getApplication().getModel().getBranding().getHistoryFile();
 
                 log.debug("Application configured, setting history file: {}", file);
 

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/LayoutManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/LayoutManagerImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/LayoutManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/LayoutManagerImpl.java
Thu Sep 11 10:06:43 2008
@@ -49,7 +49,7 @@
     private Layout lookupLayout() {
         assert applicationManager != null;
 
-        Layout layout = applicationManager.getContext().getModel().getLayout();
+        Layout layout = applicationManager.getApplication().getModel().getLayout();
 
         if (layout == null) {
             throw new IllegalStateException("Layout has not been configured for application");
@@ -111,7 +111,7 @@
         else {
             assert applicationManager != null;
 
-            start = (Node) applicationManager.getContext().getVariables().get(CURRENT_NODE);
+            start = (Node) applicationManager.getApplication().getVariables().get(CURRENT_NODE);
 
             if (start == null) {
                 start = layout;

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java?rev=694356&r1=694355&r2=694356&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ShellImpl.java
Thu Sep 11 10:06:43 2008
@@ -21,8 +21,7 @@
 
 import jline.History;
 import org.apache.geronimo.gshell.ansi.Renderer;
-import org.apache.geronimo.gshell.application.ApplicationContext;
-import org.apache.geronimo.gshell.application.ApplicationManager;
+import org.apache.geronimo.gshell.application.Application;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.commandline.CommandLineExecutor;
 import org.apache.geronimo.gshell.console.Console;
@@ -59,9 +58,6 @@
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Autowired
-    private ApplicationManager applicationManager;
-
-    @Autowired
     private ShellInfo shellInfo;
 
     @Autowired
@@ -98,10 +94,12 @@
         assert event != null;
 
         if (event instanceof ApplicationConfiguredEvent) {
-            assert applicationManager != null;
+            ApplicationConfiguredEvent targetEvent = (ApplicationConfiguredEvent)event;
 
+            log.debug("Binding application io/variables/branding from context");
+            
             // Dereference some bits from the applciation context
-            ApplicationContext context = applicationManager.getContext();
+            Application context = targetEvent.getApplication();
             io = context.getIo();
             variables = context.getVariables();
             branding = context.getModel().getBranding();



Mime
View raw message