You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/08/01 09:14:41 UTC

svn commit: r681614 - in /geronimo/gshell/trunk/gshell-wisdom/src: main/java/org/apache/geronimo/gshell/wisdom/application/ main/resources/META-INF/spring/ test/java/org/apache/geronimo/gshell/wisdom/ test/resources/org/apache/geronimo/gshell/wisdom/

Author: jdillon
Date: Fri Aug  1 00:14:40 2008
New Revision: 681614

URL: http://svn.apache.org/viewvc?rev=681614&view=rev
Log:
Start to wire up components

Modified:
    geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/src/main/resources/META-INF/spring/components.xml
    geronimo/gshell/trunk/gshell-wisdom/src/test/java/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest.java
    geronimo/gshell/trunk/gshell-wisdom/src/test/resources/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest-context.xml

Modified: geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java?rev=681614&r1=681613&r2=681614&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/ApplicationManagerImpl.java Fri Aug  1 00:14:40 2008
@@ -57,7 +57,7 @@
 import java.util.Set;
 
 /**
- * Default implementation of the {@link org.apache.geronimo.gshell.application.ApplicationManager} component.
+ * Default implementation of the {@link ApplicationManager} component.
  *
  * @version $Rev$ $Date$
  */
@@ -77,6 +77,14 @@
     private GShellPlexusContainer container;
     */
 
+    public ApplicationManagerImpl(final ArtifactManager artifactManager, final SettingsManager settingsManager) {
+        assert artifactManager != null;
+        assert settingsManager != null;
+        
+        this.artifactManager = artifactManager;
+        this.settingsManager = settingsManager;
+    }
+
     private ApplicationContext applicationContext;
 
     public ApplicationContext getContext() {

Modified: geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java?rev=681614&r1=681613&r2=681614&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/application/SettingsManagerImpl.java Fri Aug  1 00:14:40 2008
@@ -31,7 +31,7 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Default implementation of the {@link org.apache.geronimo.gshell.application.settings.SettingsManager} component.
+ * Default implementation of the {@link SettingsManager} component.
  *
  * @version $Rev$ $Date$
  */
@@ -44,6 +44,12 @@
 
     private SettingsConfiguration settingsConfiguration;
 
+    public SettingsManagerImpl(final ArtifactManager artifactManager) {
+        assert artifactManager != null;
+        
+        this.artifactManager = artifactManager;
+    }
+
     public Settings getSettings() {
         if (settingsConfiguration == null) {
             throw new IllegalStateException("Not configured");

Modified: geronimo/gshell/trunk/gshell-wisdom/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/src/main/resources/META-INF/spring/components.xml?rev=681614&r1=681613&r2=681614&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-wisdom/src/main/resources/META-INF/spring/components.xml Fri Aug  1 00:14:40 2008
@@ -27,8 +27,45 @@
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
 
-    <!--
-    TODO:
-    -->
+    <!-- Application -->
 
+    <bean id="applicationManager" class="org.apache.geronimo.gshell.wisdom.application.ApplicationManagerImpl">
+        <!--suppress SpringModelInspection -->
+        <constructor-arg ref="artifactManager"/>
+        <constructor-arg ref="settingsManager"/>
+    </bean>
+
+    <bean id="settingsManager" class="org.apache.geronimo.gshell.wisdom.application.SettingsManagerImpl">
+        <!--suppress SpringModelInspection -->
+        <constructor-arg ref="artifactManager"/>
+    </bean>
+
+    <!-- Command -->
+
+    <bean id="commandContainerFactory" class="org.apache.geronimo.gshell.wisdom.command.CommandContainerFactoryImpl">
+    </bean>
+
+    <bean id="commandResolver" class="org.apache.geronimo.gshell.wisdom.command.CommandResolverImpl">
+    </bean>
+
+    <!-- Shell -->
+
+    <bean id="commandLineBuilder" class="org.apache.geronimo.gshell.wisdom.shell.CommandLineBuilderImpl">
+    </bean>
+
+    <bean id="commandLineExecutor" class="org.apache.geronimo.gshell.wisdom.shell.CommandLineExecutorImpl">
+    </bean>
+
+    <bean id="history" class="org.apache.geronimo.gshell.wisdom.shell.HistoryImpl">
+    </bean>
+
+    <bean id="layoutManager" class="org.apache.geronimo.gshell.wisdom.shell.LayoutManagerImpl">
+    </bean>
+
+    <bean id="shell" class="org.apache.geronimo.gshell.wisdom.shell.ShellImpl">
+    </bean>
+
+    <bean id="shellInfo" class="org.apache.geronimo.gshell.wisdom.shell.ShellInfoImpl">
+    </bean>
+    
 </beans>
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/src/test/java/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/src/test/java/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest.java?rev=681614&r1=681613&r2=681614&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/src/test/java/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest.java (original)
+++ geronimo/gshell/trunk/gshell-wisdom/src/test/java/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest.java Fri Aug  1 00:14:40 2008
@@ -21,17 +21,24 @@
 
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
 import org.apache.geronimo.gshell.artifact.ArtifactManager;
+import org.apache.geronimo.gshell.application.settings.SettingsManager;
 
 /**
- * ???
+ * Basic tests to make sure we can inject the {@link ArtifactManager} which is a Plexus component.
  *
  * @version $Rev$ $Date$
  */
 public class ArtifactManagerTest
     extends PlexusInSpringTestCase
 {
-    public void testGetBean() throws Exception {
+    public void testDirect() throws Exception {
         ArtifactManager artifactManager = (ArtifactManager) applicationContext.getBean("artifactManager");
         assertNotNull(artifactManager);
     }
+
+    public void testAsDependency() throws Exception {
+        SettingsManager settingsManager = (SettingsManager) applicationContext.getBean("settingsManager");
+        assertNotNull(settingsManager);
+    }
+
 }
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/src/test/resources/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest-context.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/src/test/resources/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest-context.xml?rev=681614&r1=681613&r2=681614&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/src/test/resources/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest-context.xml (original)
+++ geronimo/gshell/trunk/gshell-wisdom/src/test/resources/org/apache/geronimo/gshell/wisdom/ArtifactManagerTest-context.xml Fri Aug  1 00:14:40 2008
@@ -27,4 +27,9 @@
             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
             http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
 
+    <bean id="settingsManager" class="org.apache.geronimo.gshell.wisdom.application.SettingsManagerImpl">
+        <!--suppress SpringModelInspection -->
+        <constructor-arg ref="artifactManager"/>
+    </bean>
+
 </beans>
\ No newline at end of file