[jboss-cvs] JBossAS SVN: r88059 - in projects/fresh/trunk: fresh-shell/src/main/java/org/jboss/fresh/deployer and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 30 07:22:19 EDT 2009


Author: alesj
Date: 2009-04-30 07:22:19 -0400 (Thu, 30 Apr 2009)
New Revision: 88059

Added:
   projects/fresh/trunk/etc/fresh-jboss-beans.xml
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/ExecutableRegistry.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/BeanFactoryExecutableRegistry.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/DefaultExecutableRegistry.java
Modified:
   projects/fresh/trunk/etc/fresh-service.xml
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellService.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellServiceMBean.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MCBeanInvokeExe.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellRuntime.java
   projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/SystemShellImpl.java
Log:
Add ExecutableRegistry, so we can use MC beans for Executables.

Added: projects/fresh/trunk/etc/fresh-jboss-beans.xml
===================================================================
--- projects/fresh/trunk/etc/fresh-jboss-beans.xml	                        (rev 0)
+++ projects/fresh/trunk/etc/fresh-jboss-beans.xml	2009-04-30 11:22:19 UTC (rev 88059)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <bean name="BeanFactoryExecutableRegistry" class="org.jboss.fresh.shell.impl.BeanFactoryExecutableRegistry">
+    <constructor>
+      <map keyClass="java.lang.String" valueClass="org.jboss.beans.metadata.spi.factory.BeanFactory">
+        <entry>
+          <key>mcinvoke</key>
+          <value><inject bean="MCBeanInvokeExe"/></value>
+        </entry>
+      </map>
+    </constructor>
+  </bean>
+
+  <beanfactory name="MCBeanInvokeExe" class="org.jboss.fresh.shell.commands.MCBeanInvokeExe">
+    <constructor>
+      <inject bean="jboss.kernel:service=KernelBus"/>
+    </constructor>
+  </beanfactory>
+
+</deployment>

Modified: projects/fresh/trunk/etc/fresh-service.xml
===================================================================
--- projects/fresh/trunk/etc/fresh-service.xml	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/etc/fresh-service.xml	2009-04-30 11:22:19 UTC (rev 88059)
@@ -44,6 +44,7 @@
         <attribute name="ThreadPoolJNDIName">java:/FRESH/ThreadPool</attribute>
         <attribute name="VFSJNDIName">java:/FRESH/VFS</attribute>
         <attribute name="GCInterval">10000</attribute>
+        <attribute name="ExecutableRegistry"><inject bean="BeanFactoryExecutableRegistry"/></attribute>
         <depends>FRESH:service=Cp2ConfigurationService</depends>
         <depends>FRESH:service=ThreadPool</depends>
         <depends>FRESH:service=VFS.Root</depends>

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellService.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellService.java	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellService.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -1,5 +1,6 @@
 package org.jboss.fresh.deployer;
 
+import org.jboss.fresh.shell.ExecutableRegistry;
 import org.jboss.fresh.shell.SystemShell;
 import org.jboss.fresh.shell.impl.SystemShellImpl;
 
@@ -12,9 +13,14 @@
 
     private long gcInterval = 10000L;
     private SystemShellImpl ss;
+    private ExecutableRegistry registry;
 
+   public void setExecutableRegistry(ExecutableRegistry registry)
+   {
+      this.registry = registry;
+   }
 
-    public String getName() {
+   public String getName() {
         return "CP2 SystemShell Binder Service";
     }
 
@@ -60,6 +66,7 @@
         try {
             ss = new SystemShellImpl(tpName, vfsName);
             ss.setGCInterval(gcInterval);
+            ss.setExecutableRegistry(registry);
 
             SystemShell ssold = (SystemShell) getServiceObject();
             if (ssold != null) ssold.shutdown();

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellServiceMBean.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellServiceMBean.java	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/deployer/SystemShellServiceMBean.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -1,5 +1,7 @@
 package org.jboss.fresh.deployer;
 
+import org.jboss.fresh.shell.ExecutableRegistry;
+
 public interface SystemShellServiceMBean extends RegistryNamingBinderMBean {
 
     public void setThreadPoolJNDIName(String name);
@@ -14,4 +16,5 @@
 
     public long getGCInterval();
 
+    public void setExecutableRegistry(ExecutableRegistry registry);
 }
\ No newline at end of file

Added: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/ExecutableRegistry.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/ExecutableRegistry.java	                        (rev 0)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/ExecutableRegistry.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.fresh.shell;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface ExecutableRegistry
+{
+   /**
+    * Get the executable.
+    *
+    * @param command the command
+    * @return found Executable instance or null if not matching to command
+    */
+   Executable getExecutable(String command);
+}

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MCBeanInvokeExe.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MCBeanInvokeExe.java	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/commands/MCBeanInvokeExe.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -30,7 +30,7 @@
 
    protected String getCmd()
    {
-      return "invoke";
+      return "mcinvoke";
    }
 
    protected void invoke(PrintWriter out, String beanName, String methodName, String[] sig, Object[] vals, BufferObjectWriter oout) throws Exception

Added: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/BeanFactoryExecutableRegistry.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/BeanFactoryExecutableRegistry.java	                        (rev 0)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/BeanFactoryExecutableRegistry.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.fresh.shell.impl;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import org.jboss.beans.metadata.spi.factory.BeanFactory;
+import org.jboss.fresh.shell.Executable;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class BeanFactoryExecutableRegistry extends DefaultExecutableRegistry
+{
+   private Map<String, BeanFactory> factories;
+
+   public BeanFactoryExecutableRegistry()
+   {
+   }
+
+   public BeanFactoryExecutableRegistry(Map<String, BeanFactory> factories)
+   {
+      this.factories = factories;
+   }
+
+   @Override
+   public Executable getExecutable(String command)
+   {
+      Executable executable = super.getExecutable(command);
+      if (executable != null)
+         return executable;
+
+      if (factories == null)
+         return null;
+
+      BeanFactory factory = factories.get(command);
+      if (factory != null)
+      {
+         try
+         {
+            Object result = factory.createBean();
+            return Executable.class.cast(result);
+         }
+         catch (Throwable t)
+         {
+            throw new RuntimeException(t);
+         }
+      }
+
+      return null;
+   }
+
+   public void setFactories(Map<String, BeanFactory> factories)
+   {
+      this.factories = factories;
+   }
+
+   public void setFactory(String command, BeanFactory factory)
+   {
+      if (command == null)
+         throw new IllegalArgumentException("Null command");
+
+      if (factory == null)
+      {
+         if (factories == null)
+            return;
+         else
+            factories.remove(command);
+      }
+
+      if (factories == null)
+         factories = new HashMap<String, BeanFactory>();
+
+      factories.put(command, factory);
+   }
+}

Added: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/DefaultExecutableRegistry.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/DefaultExecutableRegistry.java	                        (rev 0)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/DefaultExecutableRegistry.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -0,0 +1,91 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.fresh.shell.impl;
+
+import org.jboss.fresh.shell.ExecutableRegistry;
+import org.jboss.fresh.shell.Executable;
+import org.jboss.fresh.shell.commands.CDExe;
+import org.jboss.fresh.shell.commands.SetCommand;
+import org.jboss.fresh.shell.commands.RunExe;
+import org.jboss.fresh.shell.commands.LsExe;
+import org.jboss.fresh.shell.commands.CatExe;
+import org.jboss.fresh.shell.commands.MkDirExe;
+import org.jboss.fresh.shell.commands.LnExe;
+import org.jboss.fresh.shell.commands.TouchExe;
+import org.jboss.fresh.shell.commands.RmExe;
+import org.jboss.fresh.shell.commands.SetAttrExe;
+import org.jboss.fresh.shell.commands.InfoExe;
+import org.jboss.fresh.shell.commands.CpExe;
+import org.jboss.fresh.shell.commands.MvExe;
+import org.jboss.fresh.shell.commands.EchoExe;
+import org.jboss.fresh.shell.commands.PosExe;
+import org.jboss.fresh.shell.commands.LsLnsExe;
+import org.jboss.fresh.shell.commands.SetFileFieldExe;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class DefaultExecutableRegistry implements ExecutableRegistry
+{
+   public Executable getExecutable(String command)
+   {
+      if (command.equals("cd")) {
+         return new CDExe();
+      } else if ("set".equals(command)) {
+         return new SetCommand();
+      } else if ("run".equals(command)) {
+         return new RunExe();
+      } else if ("ls".equals(command)) {
+         return new LsExe();
+      } else if ("dir".equals(command)) {
+         return new LsExe();
+      } else if ("cat".equals(command)) {
+         return new CatExe();
+      } else if ("mkdir".equals(command)) {
+         return new MkDirExe();
+      } else if ("ln".equals(command)) {
+         return new LnExe();
+      } else if ("touch".equals(command)) {
+         return new TouchExe();
+      } else if ("rm".equals(command)) {
+         return new RmExe();
+      } else if ("setattr".equals(command)) {
+         return new SetAttrExe();
+      } else if ("info".equals(command)) {
+         return new InfoExe();
+      } else if ("cp".equals(command)) {
+         return new CpExe();
+      } else if ("mv".equals(command)) {
+         return new MvExe();
+      } else if ("echo".equals(command)) {
+         return new EchoExe();
+      } else if ("pos".equals(command)) {
+         return new PosExe();
+      } else if ("lslns".equals(command)) {
+         return new LsLnsExe();
+      } else if ("setffld".equals(command)) {
+         return new SetFileFieldExe();
+      } else {
+         return null;
+      }
+   }
+}

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellImpl.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -47,6 +47,7 @@
 import org.jboss.fresh.shell.ShellException;
 import org.jboss.fresh.shell.ShellIOException;
 import org.jboss.fresh.shell.SystemShell;
+import org.jboss.fresh.shell.ExecutableRegistry;
 import org.jboss.fresh.shell.events.ShellEvent;
 import org.jboss.fresh.shell.events.ShellEventBroadcaster;
 import org.jboss.fresh.shell.parser.Cmd;
@@ -119,10 +120,10 @@
 	// or we could save this satting with the process...
 
 	private ShellRuntime runtime;
+   private ExecutableRegistry registry;
 	//private HashMap procmap=new HashMap();
 	private Map procmap = Collections.synchronizedMap(new HashMap());
 
-
 	private long startTime;
 	private long lastUsed;
 	private boolean closed = false;
@@ -196,10 +197,16 @@
 		startTime = System.currentTimeMillis();
 	}
 
+   public void setRegistry(ExecutableRegistry registry)
+   {
+      if (registry != null)
+      {
+         runtime.setRegistry(registry);
+      }
+   }
 
+   private EventBroadcaster getEventBroadcaster() {
 
-	private EventBroadcaster getEventBroadcaster() {
-
 		Context ctx = getContext();
 		EventCentral evc = (EventCentral) ctx.get("EventCentral");
 		if (evc == ec) {

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellRuntime.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellRuntime.java	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/ShellRuntime.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -1,22 +1,25 @@
 package org.jboss.fresh.shell.impl;
 
-import org.jboss.fresh.vfs.FileInfo;
-import org.jboss.fresh.vfs.FileName;
-import org.jboss.fresh.vfs.VFSException;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.StringTokenizer;
+import java.util.TreeMap;
+
+import org.apache.log4j.Logger;
 import org.jboss.fresh.ctx.FlatContext;
 import org.jboss.fresh.io.Buffer;
 import org.jboss.fresh.io.BufferWriter;
+import org.jboss.fresh.shell.BadCommandException;
 import org.jboss.fresh.shell.Executable;
+import org.jboss.fresh.shell.ExecutableRegistry;
 import org.jboss.fresh.shell.ShellException;
-import org.jboss.fresh.shell.BadCommandException;
-import org.jboss.fresh.shell.commands.*;
+import org.jboss.fresh.vfs.FileInfo;
+import org.jboss.fresh.vfs.FileName;
+import org.jboss.fresh.vfs.VFSException;
 
-import java.io.PrintWriter;
-import java.util.*;
 
-import org.apache.log4j.Logger;
-
-
 public class ShellRuntime {
     private static final Logger log = Logger.getLogger(ShellRuntime.class);
 	public static final String PWD = "PWD";
@@ -32,12 +35,27 @@
 	//private LinkedList pathNames = new LinkedList();
     private HashMap aliases = new HashMap();
 
+   private ExecutableRegistry registry = new DefaultExecutableRegistry();
+
     public ShellRuntime(ShellImpl shell, boolean interactive) {
 		this.shell = shell;
 		this.interactive = interactive;
 	}
 
-	public void init(Buffer shellout) {
+   public void setRegistry(ExecutableRegistry registry)
+   {
+      this.registry = registry;
+   }
+
+   protected ExecutableRegistry getRegistry()
+   {
+      if (registry == null)
+         throw new IllegalArgumentException("Executable registry is null");
+
+      return registry;
+   }
+
+   public void init(Buffer shellout) {
 		try {
 
 			// create new Cache Object implementation
@@ -249,49 +267,9 @@
 	}
 
 	protected Executable getInternal(String command) {
-
-		if (command.equals("cd")) {
-			return new CDExe();
-		} else if (command.equals("set")) {
-			return new SetCommand();
-		} else if (command.equals("run")) {
-			return new RunExe();
-		} else if (command.equals("ls")) {
-			return new LsExe();
-		} else if (command.equals("dir")) {
-			return new LsExe();
-		} else if (command.equals("cat")) {
-			return new CatExe();
-		} else if (command.equals("mkdir")) {
-			return new MkDirExe();
-		} else if (command.equals("ln")) {
-			return new LnExe();
-		} else if (command.equals("touch")) {
-			return new TouchExe();
-		} else if (command.equals("rm")) {
-			return new RmExe();
-		} else if (command.equals("setattr")) {
-			return new SetAttrExe();
-		} else if (command.equals("info")) {
-			return new InfoExe();
-		} else if (command.equals("cp")) {
-			return new CpExe();
-		} else if (command.equals("mv")) {
-			return new MvExe();
-		} else if (command.equals("echo")) {
-			return new EchoExe();
-		} else if (command.equals("pos")) {
-			return new PosExe();
-		} else if (command.equals("lslns")) {
-			return new LsLnsExe();
-		} else if (command.equals("setffld")) {
-			return new SetFileFieldExe();
-		} else {
-			return null;
-		}
+      return getRegistry().getExecutable(command);
 	}
 
-
     public String unaliasCmdLine(String cmdline) {
 
         // break cmdline by |

Modified: projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/SystemShellImpl.java
===================================================================
--- projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/SystemShellImpl.java	2009-04-30 11:18:42 UTC (rev 88058)
+++ projects/fresh/trunk/fresh-shell/src/main/java/org/jboss/fresh/shell/impl/SystemShellImpl.java	2009-04-30 11:22:19 UTC (rev 88059)
@@ -1,25 +1,26 @@
 package org.jboss.fresh.shell.impl;
 
-import org.jboss.fresh.vfs.UserCtx;
-import org.jboss.fresh.vfs.VFS;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import javax.naming.NamingException;
+
 import org.jboss.fresh.cpii.services.PoolRunner;
 import org.jboss.fresh.pool.pool.Pool;
 import org.jboss.fresh.pool.pool.PoolException;
+import org.jboss.fresh.registry.RegistryContext;
 import org.jboss.fresh.shell.EnvProperties;
+import org.jboss.fresh.shell.ExecutableRegistry;
 import org.jboss.fresh.shell.Shell;
 import org.jboss.fresh.shell.ShellException;
 import org.jboss.fresh.shell.SystemShell;
-import org.jboss.fresh.registry.RegistryContext;
+import org.jboss.fresh.vfs.UserCtx;
+import org.jboss.fresh.vfs.VFS;
 
-import javax.naming.NamingException;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Timer;
-import java.util.TimerTask;
-
 //import org.jboss.pool.ObjectPool;
 
 // This class is a server. It has a set of Shell instances.
@@ -42,6 +43,7 @@
 
 	private Date startTime;
 
+   private ExecutableRegistry registry;
 
 //	GCThread gc;
 	Timer gc;
@@ -58,6 +60,10 @@
 		reinitGC();
 	}
 
+   public void setExecutableRegistry(ExecutableRegistry registry) {
+      this.registry = registry;
+   }
+
 	public void reinitGC() {
 
 		if (gc != null) gc.cancel();
@@ -124,11 +130,10 @@
 		// create new shell object
 		// assign id to it
 		// assign uctx to it
-		ShellImpl shell;
-
 		String id = newID();
 		VFS vfs = getVFS();
-		shell = new ShellImpl(id, interactive, this, uctx, vfs);
+		ShellImpl shell = new ShellImpl(id, interactive, this, uctx, vfs);
+      shell.setRegistry(registry);
 
 		// put it in shellmap
 		shellmap.put(id, shell);




More information about the jboss-cvs-commits mailing list