geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r693717 - in /geronimo/gshell/trunk: gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/ gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/ gshell-support/gshell-spring/src/test/java/org/apache/geronimo/gshel...
Date Wed, 10 Sep 2008 07:42:36 GMT
Author: jdillon
Date: Wed Sep 10 00:42:35 2008
New Revision: 693717

URL: http://svn.apache.org/viewvc?rev=693717&view=rev
Log:
Don't expose ClassWorlds at the ShellBuilder level, its mostly meaningless, just ask for a
ClassLoader
Added javadocs to gshell-spring muck

Modified:
    geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
    geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainer.java
    geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAware.java
    geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAwareProcessor.java
    geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerImpl.java
    geronimo/gshell/trunk/gshell-support/gshell-spring/src/test/java/org/apache/geronimo/gshell/spring/SpringTestSupport.java
    geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/ShellBuilder.java

Modified: geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
(original)
+++ geronimo/gshell/trunk/gshell-cli/src/main/java/org/apache/geronimo/gshell/cli/Main.java
Wed Sep 10 00:42:35 2008
@@ -31,6 +31,7 @@
 import org.apache.geronimo.gshell.model.application.Application;
 import org.apache.geronimo.gshell.model.settings.Settings;
 import org.apache.geronimo.gshell.application.settings.SettingsLocator;
+import org.apache.geronimo.gshell.wisdom.ShellBuilder;
 import org.codehaus.plexus.classworlds.ClassWorld;
 
 import java.util.ArrayList;
@@ -44,8 +45,6 @@
  */
 public class Main
 {
-    ///CLOVER:OFF
-
     //
     // NOTE: Do not use logging from this class, as it is used to configure
     //       the logging level with System properties, which will only get
@@ -205,7 +204,7 @@
 
         try {
             ShellBuilder builder = new ShellBuilder();
-            builder.setClassWorld(classWorld);
+            builder.setClassLoader(getClass().getClassLoader());
             builder.setIo(io);
 
             // Find our settings descriptor

Modified: geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainer.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainer.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainer.java
Wed Sep 10 00:42:35 2008
@@ -22,7 +22,7 @@
 import org.springframework.beans.BeansException;
 
 /**
- * ???
+ * An abstraction of a container of beans.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAware.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAware.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAware.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAware.java
Wed Sep 10 00:42:35 2008
@@ -19,10 +19,8 @@
 
 package org.apache.geronimo.gshell.spring;
 
-import org.springframework.beans.BeansException;
-
 /**
- * ???
+ * Allows beans to become aware of their {@link BeanContainer}.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAwareProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAwareProcessor.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAwareProcessor.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerAwareProcessor.java
Wed Sep 10 00:42:35 2008
@@ -23,7 +23,7 @@
 import org.springframework.beans.factory.config.BeanPostProcessor;
 
 /**
- * ???
+ * Spring bean post-processor to handle injection of beans which are {@link BeanContainerAware}.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerImpl.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-spring/src/main/java/org/apache/geronimo/gshell/spring/BeanContainerImpl.java
Wed Sep 10 00:42:35 2008
@@ -25,9 +25,10 @@
 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
 import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.codehaus.classworlds.ClassWorld;
 
 /**
- * ???
+ * Default {@link BeanContainer} implementation.
  *
  * @version $Rev$ $Date$
  */
@@ -41,7 +42,11 @@
 
     private ClassPathXmlApplicationContext context;
 
-    public BeanContainerImpl() {
+    private ClassWorld classWorld;
+    
+    public BeanContainerImpl(final ClassLoader classLoader) {
+        assert classLoader != null;
+
         context = new ClassPathXmlApplicationContext(CONFIG_LOCATIONS, false);
         context.registerShutdownHook();
 

Modified: geronimo/gshell/trunk/gshell-support/gshell-spring/src/test/java/org/apache/geronimo/gshell/spring/SpringTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-support/gshell-spring/src/test/java/org/apache/geronimo/gshell/spring/SpringTestSupport.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-support/gshell-spring/src/test/java/org/apache/geronimo/gshell/spring/SpringTestSupport.java
(original)
+++ geronimo/gshell/trunk/gshell-support/gshell-spring/src/test/java/org/apache/geronimo/gshell/spring/SpringTestSupport.java
Wed Sep 10 00:42:35 2008
@@ -22,7 +22,7 @@
 import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
 
 /**
- * ???
+ * Suport for Spring-based tests.
  *
  * @version $Rev$ $Date$
  */

Modified: geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/ShellBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/ShellBuilder.java?rev=693717&r1=693716&r2=693717&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/ShellBuilder.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/src/main/java/org/apache/geronimo/gshell/wisdom/ShellBuilder.java
Wed Sep 10 00:42:35 2008
@@ -36,7 +36,6 @@
 import org.apache.geronimo.gshell.spring.BeanContainerImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.codehaus.plexus.classworlds.ClassWorld;
 import org.springframework.beans.BeansException;
 
 /**
@@ -49,11 +48,9 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private static final String DEFAULT_REALM_ID = "gshell";
-
     private BeanContainer container;
 
-    private ClassWorld classWorld;
+    private ClassLoader classLoader;
     
     private SettingsManager settingsManager;
 
@@ -68,34 +65,22 @@
     public ShellBuilder() {}
 
     private BeanContainer createContainer() {
-        BeanContainer container = new BeanContainerImpl();
-        return container;
+        return new BeanContainerImpl(getClassLoader());
     }
 
-    public BeanContainer getContainer() {
+    private BeanContainer getContainer() {
         if (container == null) {
             container = createContainer();
         }
         return container;
     }
-
-    public void setContainer(final BeanContainer container) {
-        this.container = container;
-    }
-
-    private ClassWorld createClassWorld() {
-        return new ClassWorld(DEFAULT_REALM_ID, Thread.currentThread().getContextClassLoader());
-    }
-
-    public ClassWorld getClassWorld() {
-        if (classWorld == null) {
-            classWorld = createClassWorld();
-        }
-        return classWorld;
+    
+    public ClassLoader getClassLoader() {
+        return classLoader;
     }
 
-    public void setClassWorld(final ClassWorld classWorld) {
-        this.classWorld = classWorld;
+    public void setClassLoader(final ClassLoader classLoader) {
+        this.classLoader = classLoader;
     }
 
     public IO getIo() {



Mime
View raw message