geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r658602 - in /geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console: Console.java FileHistory.java JLineConsole.java TerminalFactory.java
Date Wed, 21 May 2008 08:44:48 GMT
Author: jdillon
Date: Wed May 21 01:44:48 2008
New Revision: 658602

URL: http://svn.apache.org/viewvc?rev=658602&view=rev
Log:
More tidy

Modified:
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/Console.java
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/FileHistory.java
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
    geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/TerminalFactory.java

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/Console.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/Console.java?rev=658602&r1=658601&r2=658602&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/Console.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/Console.java
Wed May 21 01:44:48 2008
@@ -19,11 +19,11 @@
 
 package org.apache.geronimo.gshell.console;
 
-import java.io.IOException;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+
 /**
  * Provides an abstraction of a console.
  *

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/FileHistory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/FileHistory.java?rev=658602&r1=658601&r2=658602&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/FileHistory.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/FileHistory.java
Wed May 21 01:44:48 2008
@@ -19,43 +19,61 @@
 
 package org.apache.geronimo.gshell.console;
 
-import java.io.File;
-import java.io.IOException;
 import jline.History;
 import org.apache.geronimo.gshell.branding.Branding;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.io.IOException;
 
+/**
+ * Preserves command history to a file.
+ *
+ * @version $Rev: 573669 $ $Date: 2007-09-07 11:47:20 -0700 (Fri, 07 Sep 2007) $
+ */
 @Component(role=History.class, hint="default")
-public class FileHistory extends History {
-	
+public class FileHistory
+    extends History
+{
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     @Requirement
     private Branding branding;
 
-    public FileHistory() {
-    }
+    public FileHistory() {}
 
     public FileHistory(final Branding branding) throws IOException {
         this.branding = branding;
+
         initialize();
     }
 
     public void initialize() throws IOException {
+        assert branding != null;
+
+        //
+        // FIXME: Branding should just expose getHistoryFile() that handles this
+        //
+        
         setHistoryFile(new File(branding.getUserDirectory(), branding.getHistoryFileName()));
     }
 
     public void setHistoryFile(final File file) throws IOException {
         assert file != null;
+
         File dir = file.getParentFile();
+
         if (!dir.exists()) {
             dir.mkdirs();
+
             log.debug("Created base directory for history file: {}", dir);
         }
+
         log.debug("Using history file: {}", file);
+
         super.setHistoryFile(file);
     }
 

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java?rev=658602&r1=658601&r2=658602&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/JLineConsole.java
Wed May 21 01:44:48 2008
@@ -19,15 +19,15 @@
 
 package org.apache.geronimo.gshell.console;
 
-import java.io.IOException;
-import java.io.PrintWriter;
-
 import jline.ConsoleReader;
 import jline.History;
 import jline.Terminal;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.shell.Shell;
 
+import java.io.IOException;
+import java.io.PrintWriter;
+
 /**
  * Support for running a {@link Shell} using the <a href="http://jline.sf.net">JLine</a>
library.
  *

Modified: geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/TerminalFactory.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/TerminalFactory.java?rev=658602&r1=658601&r2=658602&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/TerminalFactory.java
(original)
+++ geronimo/gshell/trunk/gshell-core/src/main/java/org/apache/geronimo/gshell/console/TerminalFactory.java
Wed May 21 01:44:48 2008
@@ -41,10 +41,7 @@
     protected Logger log = LoggerFactory.getLogger(getClass());
 
     public String getId() {
-        //
-        // FIXME: What is this supposed to return?
-        //
-        return null;
+        return getClass().getSimpleName();
     }
 
     public Object newInstance(ComponentDescriptor d, ClassRealm cr, PlexusContainer c) throws
ComponentInstantiationException {



Mime
View raw message