servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r636261 - in /servicemix/smx4/kernel/trunk: ./ assembly/src/main/descriptors/ assembly/src/main/filtered-resources/etc/ gshell/gshell-core/ gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/ gshell/gshell-core/src/main/reso...
Date Wed, 12 Mar 2008 09:22:47 GMT
Author: gnodet
Date: Wed Mar 12 02:22:41 2008
New Revision: 636261

URL: http://svn.apache.org/viewvc?rev=636261&view=rev
Log:
SMX4KNL-5: Show gshell sub-shell name in prompt

Added:
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
Modified:
    servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml
    servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml
    servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties
    servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/OsgiLayoutManager.java
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/SpringCommandRegistry.java
    servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
    servicemix/smx4/kernel/trunk/pom.xml

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/unix-bin.xml Wed Mar 12 02:22:41
2008
@@ -132,7 +132,6 @@
 		        <!-- GShell -->
                 <include>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.mina-${mina.version}</include>
-                <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.xstream-${xstream.version}</include>
                 <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.core</include>
                 <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.osgi</include>
 

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml (original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/descriptors/windows-bin.xml Wed Mar 12
02:22:41 2008
@@ -124,7 +124,6 @@
 		        <!-- GShell -->
                 <include>org.apache.geronimo.specs:geronimo-stax-api_1.0_spec</include>
                 <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.mina-${mina.version}</include>
-                <include>org.apache.servicemix.bundles:org.apache.servicemix.bundles.xstream-${xstream.version}</include>
                 <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.core</include>
                 <include>org.apache.servicemix.kernel.gshell:org.apache.servicemix.kernel.gshell.osgi</include>
 

Modified: servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties
(original)
+++ servicemix/smx4/kernel/trunk/assembly/src/main/filtered-resources/etc/startup.properties
Wed Mar 12 02:22:41 2008
@@ -37,7 +37,6 @@
 org.apache.servicemix.bundles.aopalliance-${aopalliance.version}-${pom.version}.jar=50
 org.apache.servicemix.bundles.cglib-${cglib.version}-${pom.version}.jar=50
 org.apache.servicemix.bundles.mina-${mina.version}-${pom.version}.jar=50
-org.apache.servicemix.bundles.xstream-${xstream.version}-${pom.version}.jar=50
 geronimo-stax-api_1.0_spec-${geronimo.stax.version}.jar=50
 spring-aop-${spring.version}.jar=50
 spring-beans-${spring.version}.jar=50

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/pom.xml Wed Mar 12 02:22:41 2008
@@ -172,6 +172,11 @@
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.4.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
             <artifactId>slf4j-jdk14</artifactId>
             <version>1.4.3</version>
         </dependency>

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/OsgiLayoutManager.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/OsgiLayoutManager.java?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/OsgiLayoutManager.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/OsgiLayoutManager.java
Wed Mar 12 02:22:41 2008
@@ -89,7 +89,11 @@
         return node;        
 	}
 
-	public Layout getLayout() {
+    public Node findNode(String path, String searchPath) throws NotFoundException {
+        return findNode(path);
+    }
+
+    public Layout getLayout() {
 		return getLayoutForShell(shell);
 	}
 	
@@ -117,9 +121,13 @@
 				return OsgiLayoutManager.this.findNode(getLayoutForShell(shell), path);
 			}
 
-			public Node findNode(Node node, String path) throws NotFoundException {
-				return OsgiLayoutManager.this.findNode(node, path);
-			}
+            public Node findNode(Node node, String path) throws NotFoundException {
+                return OsgiLayoutManager.this.findNode(node, path);
+            }
+
+            public Node findNode(String path, String searchPath) throws NotFoundException
{
+                return OsgiLayoutManager.this.findNode(path, searchPath);
+            }
 
 			public Layout getLayout() {
 				return getLayoutForShell(shell);

Added: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java?rev=636261&view=auto
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
(added)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/Prompter.java
Wed Mar 12 02:22:41 2008
@@ -0,0 +1,49 @@
+/*
+ * 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.spring;
+
+import org.apache.geronimo.gshell.ansi.Renderer;
+import org.apache.geronimo.gshell.console.Console;
+import org.apache.geronimo.gshell.layout.LayoutManager;
+import org.apache.geronimo.gshell.layout.model.Node;
+import org.apache.geronimo.gshell.shell.Environment;
+import org.apache.geronimo.gshell.shell.ShellInfo;
+
+public class Prompter implements Console.Prompter {
+
+    private Renderer renderer = new Renderer();
+    private ShellInfo shellInfo;
+    private Environment env;
+
+    public Prompter(ShellInfo shellInfo, Environment env) {
+        this.shellInfo = shellInfo;
+        this.env = env;
+    }
+
+    public String prompt() {
+        String userName = shellInfo.getUserName();
+        String hostName = shellInfo.getLocalHost().getHostName();
+
+        Node start = (Node) env.getVariables().get(LayoutManager.CURRENT_NODE);
+        String path = "/";
+        if (start != null) {
+            path = start.getPath();
+        }
+
+        return renderer.render("@|bold " + userName + "|@" + hostName + ":@|bold " + path
+ "|> ");
+    }
+}

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/SpringCommandRegistry.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/SpringCommandRegistry.java?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/SpringCommandRegistry.java
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/java/org/apache/geronimo/gshell/spring/SpringCommandRegistry.java
Wed Mar 12 02:22:41 2008
@@ -40,7 +40,7 @@
  * Time: 3:47:24 PM
  * To change this template use File | Settings | File Templates.
  */
-    public class SpringCommandRegistry extends DefaultCommandRegistry implements LayoutManager
{
+public class SpringCommandRegistry extends DefaultCommandRegistry implements LayoutManager
{
 
     public static final String SEPARATOR = ":";
 
@@ -176,6 +176,10 @@
         } else {
             throw new NotFoundException(s);
         }
+    }
+
+    public Node findNode(String path, String searchPath) throws NotFoundException {
+        return findNode(path);
     }
 
     public class GroupCommand implements Command {

Modified: servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
(original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-core/src/main/resources/META-INF/spring/gshell.xml
Wed Mar 12 02:22:41 2008
@@ -56,6 +56,7 @@
         <constructor-arg ref="terminal" />
         <constructor-arg ref="environment" />
         <constructor-arg ref="io" />
+        <property name="prompter" ref="prompter" />
     </bean>
 
     <bean id="shellInfo" class="org.apache.geronimo.gshell.DefaultShellInfo" init-method="initialize">
@@ -71,7 +72,6 @@
         <property name="executor" ref="commandExecutor" />
     </bean>
 
-    
     <bean id="environment" class="org.springframework.aop.framework.ProxyFactoryBean">
       <property name="targetSource">
           <bean class="org.apache.geronimo.gshell.spring.EnvironmentTargetSource" />
@@ -82,6 +82,11 @@
       <property name="targetSource">
           <bean class="org.apache.geronimo.gshell.spring.IOTargetSource" />
       </property>
+    </bean>
+
+    <bean id="prompter" class="org.apache.geronimo.gshell.spring.Prompter">
+        <constructor-arg ref="shellInfo" />
+        <constructor-arg ref="environment" />
     </bean>
     
 </beans>

Modified: servicemix/smx4/kernel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/pom.xml?rev=636261&r1=636260&r2=636261&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/pom.xml (original)
+++ servicemix/smx4/kernel/trunk/pom.xml Wed Mar 12 02:22:41 2008
@@ -75,7 +75,7 @@
       <felix.bundlerepository.version>1.0.2</felix.bundlerepository.version>
       <geronimo.servlet.version>1.1.2</geronimo.servlet.version>
       <geronimo.stax.version>1.0.1</geronimo.stax.version>
-      <gshell.version>1.0-alpha-1</gshell.version>
+      <gshell.version>1.0-alpha-2-SNAPSHOT</gshell.version>
       <junit.version>4.4</junit.version>
       <jline.version>0.9.93</jline.version>
       <log4j.version>1.2.14</log4j.version>



Mime
View raw message