geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r706527 - in /geronimo/gshell/trunk: gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/ gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ gshell-application/src/main/java...
Date Tue, 21 Oct 2008 06:04:03 GMT
Author: jdillon
Date: Mon Oct 20 23:04:02 2008
New Revision: 706527

URL: http://svn.apache.org/viewvc?rev=706527&view=rev
Log:
Expose bundle and activation bits in the application API

Added:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationContext.java
  (contents, props changed)
      - copied, changed from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationContext.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationRule.java
  (contents, props changed)
      - copied, changed from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationRule.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationTask.java
  (contents, props changed)
      - copied, changed from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationTask.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/Bundle.java
  (contents, props changed)
      - copied, changed from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/Bundle.java
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.java
  (contents, props changed)
      - copied, changed from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/NoSuchBundleException.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/BundleSupport.java
  (with props)
Removed:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationContext.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationRule.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationTask.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/Bundle.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/NoSuchBundleException.java
Modified:
    geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java
    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/activation/BundleActivationRule.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/DefaultBundleActivationRule.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/CommandBundle.java

Modified: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/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?rev=706527&r1=706526&r2=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/Plugin.java
Mon Oct 20 23:04:02 2008
@@ -20,8 +20,14 @@
 package org.apache.geronimo.gshell.application.plugin;
 
 import org.apache.geronimo.gshell.application.ClassPath;
+import org.apache.geronimo.gshell.application.plugin.bundle.Bundle;
+import org.apache.geronimo.gshell.application.plugin.bundle.NoSuchBundleException;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationRule;
 import org.apache.geronimo.gshell.application.model.Artifact;
 
+import java.util.Collection;
+import java.util.List;
+
 /**
  * Plugin.
  *
@@ -35,13 +41,13 @@
 
     ClassPath getClassPath();
 
-    /*
-    boolean isEnabled();
+    Collection<String> getBundleNames();
+
+    Bundle getBundle(String name) throws NoSuchBundleException;
+
+    List<ActivationRule> getActivationRules();
 
-    void enable() throws Exception;
+    void setActivationRules(List<ActivationRule> rules);
 
-    void disable() throws Exception;
-    */
-    
     void activate();
 }
\ No newline at end of file

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationContext.java
(from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationContext.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationContext.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationContext.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationContext.java&r1=706146&r2=706527&rev=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationContext.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationContext.java
Mon Oct 20 23:04:02 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.wisdom.plugin.activation;
+package org.apache.geronimo.gshell.application.plugin.activation;
 
 import org.apache.geronimo.gshell.application.plugin.Plugin;
 

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

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

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

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

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationRule.java
(from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationRule.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationRule.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationRule.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationRule.java&r1=706146&r2=706527&rev=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationRule.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationRule.java
Mon Oct 20 23:04:02 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.wisdom.plugin.activation;
+package org.apache.geronimo.gshell.application.plugin.activation;
 
 /**
  * An activation rule.  Rules optionally add tasks to the context to perform some action.

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

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

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

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

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationTask.java
(from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationTask.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationTask.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationTask.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationTask.java&r1=706146&r2=706527&rev=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/ActivationTask.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/activation/ActivationTask.java
Mon Oct 20 23:04:02 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.wisdom.plugin.activation;
+package org.apache.geronimo.gshell.application.plugin.activation;
 
 /**
  * An activation task, which is the basic unit of operation for "active" bits.

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

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

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

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

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/Bundle.java
(from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/Bundle.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/Bundle.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/Bundle.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/Bundle.java&r1=706146&r2=706527&rev=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/Bundle.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/Bundle.java
Mon Oct 20 23:04:02 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.wisdom.plugin.bundle;
+package org.apache.geronimo.gshell.application.plugin.bundle;
 
 /**
  * Plugin bundle.

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

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

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

Copied: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.java
(from r706146, geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/NoSuchBundleException.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.java?p2=geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.java&p1=geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/NoSuchBundleException.java&r1=706146&r2=706527&rev=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/NoSuchBundleException.java
(original)
+++ geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.java
Mon Oct 20 23:04:02 2008
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gshell.wisdom.plugin.bundle;
+package org.apache.geronimo.gshell.application.plugin.bundle;
 
 import org.apache.geronimo.gshell.command.CommandException;
 

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

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

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: geronimo/gshell/trunk/gshell-application/src/main/java/org/apache/geronimo/gshell/application/plugin/bundle/NoSuchBundleException.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=706527&r1=706526&r2=706527&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
Mon Oct 20 23:04:02 2008
@@ -22,13 +22,13 @@
 import org.apache.geronimo.gshell.application.ClassPath;
 import org.apache.geronimo.gshell.application.model.Artifact;
 import org.apache.geronimo.gshell.application.plugin.Plugin;
+import org.apache.geronimo.gshell.application.plugin.bundle.Bundle;
 import org.apache.geronimo.gshell.spring.BeanContainer;
 import org.apache.geronimo.gshell.spring.BeanContainerAware;
-import org.apache.geronimo.gshell.wisdom.plugin.activation.ActivationContext;
-import org.apache.geronimo.gshell.wisdom.plugin.activation.ActivationRule;
-import org.apache.geronimo.gshell.wisdom.plugin.activation.ActivationTask;
-import org.apache.geronimo.gshell.wisdom.plugin.bundle.Bundle;
-import org.apache.geronimo.gshell.wisdom.plugin.bundle.NoSuchBundleException;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationContext;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationRule;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationTask;
+import org.apache.geronimo.gshell.application.plugin.bundle.NoSuchBundleException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,10 +50,6 @@
 
     private final String name;
 
-    /*
-    private boolean enabled = false;
-    */
-    
     private Artifact artifact;
 
     private ClassPath classPath;
@@ -137,44 +133,14 @@
         return container.getBean(id, Bundle.class);
     }
 
-    /*
-    public synchronized boolean isEnabled() {
-        return enabled;
-    }
-
-    public synchronized void enable() throws Exception {
-        if (enabled) {
-            throw new IllegalStateException("Plugin already enabled: " + name);
-        }
-
-        log.debug("Enabling plugin: {}", name);
-
-        // TODO:
-
-        enabled = true;
-    }
-
-    public synchronized void disable() throws Exception {
-        if (!enabled) {
-            throw new IllegalStateException("Plugin not enabled: " + name);
-        }
-
-        log.debug("Disabling bundle: {}", name);
-
-        // TODO:
-
-        enabled = false;
-    }
-    */
-
     public List<ActivationRule> getActivationRules() {
         return activationRules;
     }
 
-    public void setActivationRules(final List<ActivationRule> activationRules) {
-        assert activationRules != null;
+    public void setActivationRules(final List<ActivationRule> rules) {
+        assert rules != null;
 
-        this.activationRules = activationRules;
+        this.activationRules = rules;
     }
 
     public void activate() {

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/BundleActivationRule.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/BundleActivationRule.java?rev=706527&r1=706526&r2=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/BundleActivationRule.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/BundleActivationRule.java
Mon Oct 20 23:04:02 2008
@@ -20,7 +20,10 @@
 package org.apache.geronimo.gshell.wisdom.plugin.activation;
 
 import org.apache.geronimo.gshell.wisdom.plugin.PluginImpl;
-import org.apache.geronimo.gshell.wisdom.plugin.bundle.Bundle;
+import org.apache.geronimo.gshell.application.plugin.bundle.Bundle;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationContext;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationRule;
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationTask;
 
 /**
  * Activation rule which will enable a named-bundle.

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/DefaultBundleActivationRule.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/DefaultBundleActivationRule.java?rev=706527&r1=706526&r2=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/DefaultBundleActivationRule.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/activation/DefaultBundleActivationRule.java
Mon Oct 20 23:04:02 2008
@@ -19,6 +19,8 @@
 
 package org.apache.geronimo.gshell.wisdom.plugin.activation;
 
+import org.apache.geronimo.gshell.application.plugin.activation.ActivationContext;
+
 /**
  * Activation rule which will enable a named-bundle only if no other activation rules have
added tasks.
  *

Added: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/BundleSupport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/BundleSupport.java?rev=706527&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/BundleSupport.java
(added)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/BundleSupport.java
Mon Oct 20 23:04:02 2008
@@ -0,0 +1,81 @@
+/*
+ * 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.wisdom.plugin.bundle;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.apache.geronimo.gshell.application.plugin.bundle.Bundle;
+
+/**
+ * Support for {@link org.apache.geronimo.gshell.application.plugin.bundle.Bundle} components.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class BundleSupport
+    implements Bundle
+{
+    protected final Logger log = LoggerFactory.getLogger(getClass());
+
+    private final String name;
+    
+    private boolean enabled = false;
+
+    protected BundleSupport(final String name) {
+        assert name != null;
+
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public synchronized boolean isEnabled() {
+        return enabled;
+    }
+
+    public synchronized void enable() throws Exception {
+        if (enabled) {
+            throw new IllegalStateException("Bundle already enabled: " + name);
+        }
+
+        log.debug("Enabling bundle: {}", name);
+
+        doEnable();
+
+        enabled = true;
+    }
+
+    protected abstract void doEnable() throws Exception;
+
+    public synchronized void disable() throws Exception {
+        if (!enabled) {
+            throw new IllegalStateException("Bundle not enabled: " + name);
+        }
+
+        log.debug("Disabling bundle: {}", name);
+
+        doDisable();
+
+        enabled = false;
+    }
+
+    protected abstract void doDisable() throws Exception;
+}
\ No newline at end of file

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/CommandBundle.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/CommandBundle.java?rev=706527&r1=706526&r2=706527&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/CommandBundle.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/plugin/bundle/CommandBundle.java
Mon Oct 20 23:04:02 2008
@@ -22,6 +22,7 @@
 import org.apache.geronimo.gshell.command.Command;
 import org.apache.geronimo.gshell.registry.AliasRegistry;
 import org.apache.geronimo.gshell.registry.CommandRegistry;
+import org.apache.geronimo.gshell.wisdom.plugin.bundle.BundleSupport;
 
 import java.util.List;
 import java.util.Map;
@@ -64,7 +65,7 @@
         return aliases;
     }
 
-    public void setAliases(final Map<String, String> aliases) {
+    public void setAliases(final Map<String,String> aliases) {
         assert aliases != null;
 
         this.aliases = aliases;



Mime
View raw message