geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r701226 [2/2] - in /geronimo/gshell/trunk: ./ gshell-assembly/ gshell-assembly/src/main/underlay/etc/ gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ gshell-remote/gshell-whisper/ gshell-re...
Date Thu, 02 Oct 2008 19:51:52 GMT
Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java?rev=701226&r1=701225&r2=701226&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java
Thu Oct  2 12:51:51 2008
@@ -127,10 +127,12 @@
         List<URL> classPath = createClassPath(artifacts);
 
         BeanContainer pluginContainer = container.createChild("gshell.plugin(" + artifact.getId()
+ ")", classPath);
-        pluginContainer.start();
-        
         log.debug("Created plugin container: {}", pluginContainer);
-        
+
+        pluginContainer.loadBeans(new String[] {
+            "classpath*:META-INF/spring/components.xml"
+        });
+    
         PluginImpl plugin = pluginContainer.getBean(PluginImpl.class);
 
         // Initialize the plugins artifact configuration

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=701226&r1=701225&r2=701226&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 Oct  2 12:51:51 2008
@@ -20,10 +20,7 @@
 package org.apache.geronimo.gshell.wisdom.shell;
 
 import jline.History;
-import org.apache.geronimo.gshell.event.Event;
-import org.apache.geronimo.gshell.event.EventListener;
-import org.apache.geronimo.gshell.event.EventManager;
-import org.apache.geronimo.gshell.wisdom.application.ApplicationConfiguredEvent;
+import org.apache.geronimo.gshell.application.Application;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -43,26 +40,13 @@
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Autowired
-    private EventManager eventManager;
-
-    @SuppressWarnings({"UnusedDeclaration"})
+    private Application application;
+    
     @PostConstruct
-    private void init() {
-        eventManager.addListener(new EventListener() {
-            public void onEvent(Event event) throws Exception {
-                assert event != null;
-
-                if (event instanceof ApplicationConfiguredEvent) {
-                    ApplicationConfiguredEvent targetEvent = (ApplicationConfiguredEvent)event;
-
-                    File file = targetEvent.getApplication().getModel().getBranding().getHistoryFile();
-
-                    log.debug("Application configured, setting history file: {}", file);
-
-                    setHistoryFile(file);
-                }
-            }
-        });
+    public void init() {
+        assert application != null;
+        File file = application.getModel().getBranding().getHistoryFile();
+        log.debug("Application configured, setting history file: {}", file);
     }
     
     public void setHistoryFile(final File file) throws IOException {

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=701226&r1=701225&r2=701226&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 Oct  2 12:51:51 2008
@@ -19,12 +19,11 @@
 
 package org.apache.geronimo.gshell.wisdom.shell;
 
-import jline.History;
 import jline.Completor;
-import org.apache.geronimo.gshell.ansi.Renderer;
+import jline.History;
 import org.apache.geronimo.gshell.ansi.Code;
+import org.apache.geronimo.gshell.ansi.Renderer;
 import org.apache.geronimo.gshell.application.Application;
-import org.apache.geronimo.gshell.application.ApplicationManager;
 import org.apache.geronimo.gshell.command.Variables;
 import org.apache.geronimo.gshell.commandline.CommandLineExecutor;
 import org.apache.geronimo.gshell.console.Console;
@@ -32,16 +31,12 @@
 import org.apache.geronimo.gshell.console.Console.Prompter;
 import org.apache.geronimo.gshell.console.JLineConsole;
 import org.apache.geronimo.gshell.console.completer.AggregateCompleter;
-import org.apache.geronimo.gshell.event.Event;
-import org.apache.geronimo.gshell.event.EventListener;
-import org.apache.geronimo.gshell.event.EventManager;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.model.application.Branding;
 import org.apache.geronimo.gshell.notification.ErrorNotification;
 import org.apache.geronimo.gshell.notification.ExitNotification;
 import org.apache.geronimo.gshell.shell.Shell;
 import org.apache.geronimo.gshell.shell.ShellContext;
-import org.apache.geronimo.gshell.wisdom.application.ApplicationConfiguredEvent;
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
@@ -66,10 +61,7 @@
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Autowired
-    private ApplicationManager applicationManager;
-
-    @Autowired
-    private EventManager eventManager;
+    private Application application;
 
     @Autowired
     private CommandLineExecutor executor;
@@ -100,12 +92,16 @@
         return context;
     }
 
+    //
+    // TODO: Add ensureOpened() and add checks
+    //
+    
     public boolean isOpened() {
         return true;
     }
 
     public void close() {
-        // Nothing
+        log.debug("Closing");
     }
 
     public boolean isInteractive() {
@@ -113,44 +109,36 @@
     }
 
     @PostConstruct
-    public void init() {
-        eventManager.addListener(new EventListener() {
-            public void onEvent(Event event) throws Exception {
-                assert event != null;
-
-                if (event instanceof ApplicationConfiguredEvent) {
-                    ApplicationConfiguredEvent targetEvent = (ApplicationConfiguredEvent)event;
-
-                    log.debug("Binding application io/variables/branding from context");
-
-                    // Dereference some bits from the applciation context
-                    final Application application = targetEvent.getApplication();
-                    context = new ShellContext() {
-                        public IO getIo() {
-                            return application.getIo();
-                        }
-
-                        public Variables 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.
-                            //
-
-                            return application.getVariables();
-                        }
-                    };
-                    
-                    branding = application.getModel().getBranding();
-
-                    //
-                    // TODO: Populate variables with some defaults, like the username/hostname/etc.
-                    //
+    public void init() throws Exception {
+        assert application != null;
 
-                    loadProfileScripts();
-                }
+        // Dereference some bits from the applciation context
+        final IO io = application.getIo();
+
+        //
+        // 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() {
+            public IO getIo() {
+                return io;
+            }
+
+            public Variables getVariables() {
+                return vars;
             }
-        });
+        };
+
+        branding = application.getModel().getBranding();
+
+        //
+        // TODO: Populate variables with some defaults, like the username/hostname/etc.
+        //
+
+        loadProfileScripts();
     }
 
     public Object execute(final String line) throws Exception {
@@ -279,14 +267,13 @@
             //
 
             public String prompt() {
-                assert applicationManager != null;
-                Application app = applicationManager.getApplication();
-                Branding branding = app.getModel().getBranding();
+                assert application != null;
+                Branding branding = application.getModel().getBranding();
                 
                 StringBuilder buff = new StringBuilder();
-                buff.append(Renderer.encode(app.getUserName(), Code.BOLD));
+                buff.append(Renderer.encode(application.getUserName(), Code.BOLD));
                 buff.append("@");
-                buff.append(app.getLocalHost().getHostName());
+                buff.append(application.getLocalHost().getHostName());
                 buff.append(":");
                 buff.append(Renderer.encode(branding.getName(), Code.BOLD));
                 buff.append("> ");

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/test/java/org/apache/geronimo/gshell/wisdom/config/PluginParserTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/test/java/org/apache/geronimo/gshell/wisdom/config/PluginParserTest.java?rev=701226&r1=701225&r2=701226&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/test/java/org/apache/geronimo/gshell/wisdom/config/PluginParserTest.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/test/java/org/apache/geronimo/gshell/wisdom/config/PluginParserTest.java
Thu Oct  2 12:51:51 2008
@@ -29,19 +29,10 @@
  */
 public class PluginParserTest
     extends SpringTestSupport
-{
-    /*
-    protected String[] getConfigLocations() {
-        return new String[] {
-            "classpath:META-INF/spring/components.xml",
-            "classpath:" + getClass().getName().replace('.', '/') + "-context.xml"
-        };
-    }
-    */
-    
+{   
     public void testParser() throws Exception {
         LoggingProcessor processor = new LoggingProcessor();
-        String xml = processor.render(applicationContext.getBeanFactory());
+        String xml = processor.render(getBeanContainer().getContext());
         assertNotNull(xml);
 
         System.out.println("XML:\n" + xml);

Modified: geronimo/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/pom.xml?rev=701226&r1=701225&r2=701226&view=diff
==============================================================================
--- geronimo/gshell/trunk/pom.xml (original)
+++ geronimo/gshell/trunk/pom.xml Thu Oct  2 12:51:51 2008
@@ -96,18 +96,6 @@
                     </exclusion>
                 </exclusions>
             </dependency>
-            
-            <dependency>
-                <groupId>org.codehaus.plexus</groupId>
-                <artifactId>plexus-component-annotations</artifactId>
-                <version>1.0-alpha-13</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>junit</groupId>
-                        <artifactId>junit</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
 
             <dependency>
                 <groupId>org.codehaus.plexus</groupId>
@@ -123,131 +111,17 @@
 
             <dependency>
                 <groupId>org.codehaus.plexus</groupId>
-                <artifactId>plexus-container-default</artifactId>
-                <version>1.0-alpha-48</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>junit</groupId>
-                        <artifactId>junit</artifactId>
-                    </exclusion>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging-api</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
-                <groupId>org.codehaus.plexus</groupId>
                 <artifactId>plexus-utils</artifactId>
                 <version>1.5.5</version>
             </dependency>
 
             <dependency>
-                <groupId>org.apache.maven.artifact</groupId>
-                <artifactId>maven-artifact</artifactId>
-                <version>3.0-alpha-1</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.apache.maven</groupId>
-                <artifactId>maven-project</artifactId>
-                <version>2.1.0-SNAPSHOT</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>org.apache.maven</groupId>
-                        <artifactId>maven-artifact</artifactId>
-                    </exclusion>
-                    <exclusion>
-                        <groupId>org.apache.maven</groupId>
-                        <artifactId>maven-artifact-manager</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
-                <groupId>org.apache.maven.wagon</groupId>
-                <artifactId>wagon-provider-api</artifactId>
-                <version>1.0-beta-4</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.apache.maven.wagon</groupId>
-                <artifactId>wagon-file</artifactId>
-                <version>1.0-beta-4</version>
-            </dependency>
-            
-            <dependency>
-                <groupId>org.apache.maven.wagon</groupId>
-                <artifactId>wagon-http-lightweight</artifactId>
-                <version>1.0-beta-4</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>jtidy</groupId>
-                        <artifactId>jtidy</artifactId>
-                    </exclusion>
-                    <exclusion>
-                        <groupId>xml-apis</groupId>
-                        <artifactId>xml-apis</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-            
-            <dependency>
                 <groupId>junit</groupId>
                 <artifactId>junit</artifactId>
                 <version>3.8.2</version>
             </dependency>
 
             <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-core</artifactId>
-                <version>2.5.5</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-context</artifactId>
-                <version>2.5.5</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-beans</artifactId>
-                <version>2.5.5</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
-                <groupId>org.springframework</groupId>
-                <artifactId>spring-test</artifactId>
-                <version>2.5.5</version>
-                <exclusions>
-                    <exclusion>
-                        <groupId>commons-logging</groupId>
-                        <artifactId>commons-logging</artifactId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
-
-            <dependency>
                 <groupId>org.jmock</groupId>
                 <artifactId>jmock-junit3</artifactId>
                 <version>2.5.1</version>



Mime
View raw message