geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r694358 - /geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandContainerImpl.java
Date Thu, 11 Sep 2008 17:09:30 GMT
Author: jdillon
Date: Thu Sep 11 10:09:29 2008
New Revision: 694358

URL: http://svn.apache.org/viewvc?rev=694358&view=rev
Log:
Handle CommandContainerAware muck for children

Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandContainerImpl.java

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandContainerImpl.java?rev=694358&r1=694357&r2=694358&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandContainerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/command/CommandContainerImpl.java
Thu Sep 11 10:09:29 2008
@@ -30,6 +30,7 @@
 import org.apache.geronimo.gshell.command.CommandDocumenter;
 import org.apache.geronimo.gshell.command.CommandResult;
 import org.apache.geronimo.gshell.command.CommandContainerRegistry;
+import org.apache.geronimo.gshell.command.CommandContainerAware;
 import org.apache.geronimo.gshell.notification.Notification;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -101,14 +102,27 @@
 
     @PostConstruct
     public void init() {
-        // TODO: Validate properties
-        
+        // Validate properties
         assert registry != null;
         assert id != null;
         assert action != null;
+        assert documenter != null;
+        assert completer != null;
 
-        // TODO: Inject ourself into CommandContainerAware instances
+        // Inject ourself into CommandContainerAware instances
+        Object[] children = {
+            action,
+            documenter,
+            completer,
+        };
+
+        for (Object child : children) {
+            if (child instanceof CommandContainerAware) {
+                ((CommandContainerAware)child).setCommandContainer(this);
+            }
+        }
 
+        // Register ourselves
         registry.register(this);
     }
     



Mime
View raw message