geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r696210 - in /geronimo/gshell/trunk: gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/ gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/
Date Wed, 17 Sep 2008 09:15:10 GMT
Author: jdillon
Date: Wed Sep 17 02:15:06 2008
New Revision: 696210

URL: http://svn.apache.org/viewvc?rev=696210&view=rev
Log:
Tidy things up a little more

Added:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java
  (contents, props changed)
      - copied, changed from r696206, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/Plugin.java
Removed:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/Plugin.java
Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginLoadedEvent.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginManagerImpl.java

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java
(from r696206, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/Plugin.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/Plugin.java&r1=696206&r2=696210&rev=696210&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/Plugin.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java
Wed Sep 17 02:15:06 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.wisdom.plugin;
+package org.apache.geronimo.gshell.application.plugin;
 
 /**
  * ???
@@ -31,4 +31,6 @@
     // TODO: Expose configured bundle names
     
     void activate();
+
+    // TODO: deactivate(), activate/deactiavate bundle?
 }
\ No newline at end of file

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

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

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

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

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginImpl.java?rev=696210&r1=696209&r2=696210&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginImpl.java
Wed Sep 17 02:15:06 2008
@@ -23,6 +23,7 @@
 import org.apache.geronimo.gshell.spring.BeanContainerAware;
 import org.apache.geronimo.gshell.command.CommandContainer;
 import org.apache.geronimo.gshell.command.CommandContainerRegistry;
+import org.apache.geronimo.gshell.application.plugin.Plugin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginLoadedEvent.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginLoadedEvent.java?rev=696210&r1=696209&r2=696210&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginLoadedEvent.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/PluginLoadedEvent.java
Wed Sep 17 02:15:06 2008
@@ -20,7 +20,8 @@
 package org.apache.geronimo.gshell.wisdom.plugin;
 
 import org.apache.geronimo.gshell.event.Event;
-import org.apache.geronimo.gshell.model.application.Plugin;
+import org.apache.geronimo.gshell.model.common.Artifact;
+import org.apache.geronimo.gshell.application.plugin.Plugin;
 
 /**
  * Event fired once a plugin has been loaded.
@@ -32,13 +33,20 @@
 {
     private final Plugin plugin;
 
-    public PluginLoadedEvent(final Plugin plugin) {
+    private final Artifact artifact;
+
+    public PluginLoadedEvent(final Plugin plugin, final Artifact artifact) {
         assert plugin != null;
 
         this.plugin = plugin;
+        this.artifact = artifact;
     }
 
     public Plugin getPlugin() {
         return plugin;
     }
+
+    public Artifact getArtifact() {
+        return artifact;
+    }
 }
\ No newline at end of file

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=696210&r1=696209&r2=696210&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
Wed Sep 17 02:15:06 2008
@@ -70,6 +70,8 @@
 
     private BeanContainer container;
 
+    private Set<org.apache.geronimo.gshell.application.plugin.Plugin> plugins = new
LinkedHashSet<org.apache.geronimo.gshell.application.plugin.Plugin>();
+
     public void setBeanContainer(final BeanContainer container) {
         assert container != null;
         
@@ -97,42 +99,40 @@
 
         log.debug("Loading plugins for application: {}", application.getId());
 
-        List<Plugin> plugins = application.getModel().getPlugins(true);
+        List<Plugin> artifacts = application.getModel().getPlugins(true);
 
-        for (Plugin plugin : plugins) {
+        for (Plugin artifact : artifacts) {
             try {
-                loadPlugin(plugin);
+                loadPlugin(artifact);
             }
             catch (Exception e) {
-                log.error("Failed to load plugin: " + plugin, e);
+                log.error("Failed to load plugin: " + artifact, e);
             }
         }
     }
 
-    private void loadPlugin(final Plugin plugin) throws Exception {
-        assert plugin != null;
+    private void loadPlugin(final Plugin artifact) throws Exception {
+        assert artifact != null;
 
-        log.debug("Loading plugin: {}", plugin.getId());
+        log.debug("Loading plugin: {}", artifact.getId());
 
-        List<URL> classPath = createClassPath(plugin);
+        List<URL> classPath = createClassPath(artifact);
 
-        BeanContainer pluginContainer = container.createChild("gshell.plugin[" + plugin.getId()
+ "]", classPath);
+        BeanContainer pluginContainer = container.createChild("gshell.plugin[" + artifact.getId()
+ "]", classPath);
 
         log.debug("Created plugin container: {}", pluginContainer);
 
         // TODO: Refactor to avoid needing this FQCN
         
-        org.apache.geronimo.gshell.wisdom.plugin.Plugin _plugin = pluginContainer.getBean(org.apache.geronimo.gshell.wisdom.plugin.Plugin.class);
+        org.apache.geronimo.gshell.application.plugin.Plugin plugin = pluginContainer.getBean(org.apache.geronimo.gshell.application.plugin.Plugin.class);
 
-        // TODO: Track _plugin
+        plugins.add(plugin);
 
-        log.debug("Activating plugin: {}", _plugin.getId());
+        log.debug("Activating plugin: {}", plugin.getId());
 
-        _plugin.activate();
+        plugin.activate();
 
-        // TODO: Publish the _plugin
-        
-        eventPublisher.publish(new PluginLoadedEvent(plugin));
+        eventPublisher.publish(new PluginLoadedEvent(plugin, artifact));
     }
 
     private List<URL> createClassPath(final Plugin plugin) throws Exception {



Mime
View raw message