geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r931826 - in /geronimo/server/trunk/framework/modules: geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java geronimo-shell-base/src/main/java/org/apache/geronimo/shell/BaseCommandSupport.java
Date Thu, 08 Apr 2010 07:58:43 GMT
Author: xuhaihong
Date: Thu Apr  8 07:58:43 2010
New Revision: 931826

URL: http://svn.apache.org/viewvc?rev=931826&view=rev
Log:
More update due to the change of ConsoleReader

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
    geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/BaseCommandSupport.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java?rev=931826&r1=931825&r2=931826&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
Thu Apr  8 07:58:43 2010
@@ -44,13 +44,17 @@ public class StreamConsoleReader impleme
     private boolean jlineConsoleEnabled = true;
 
     public StreamConsoleReader(InputStream in, PrintStream out) {
+        this(in, new PrintWriter(out, true));
+    }
+
+    public StreamConsoleReader(InputStream in, PrintWriter out) {
         try {
-            jlineConsoleReader = new jline.ConsoleReader(in, new PrintWriter(out, true));
+            jlineConsoleReader = new jline.ConsoleReader(in, out);
         } catch (IOException e) {
             logger.warn("Fail to create jline console, some features like password mask will
be disabled", e);
             jlineConsoleEnabled = false;
             keyboard = new BufferedReader(new InputStreamReader(in));
-            console = new PrintWriter(out, true);
+            console = out;
         }
     }
 

Modified: geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/BaseCommandSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/BaseCommandSupport.java?rev=931826&r1=931825&r2=931826&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/BaseCommandSupport.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-shell-base/src/main/java/org/apache/geronimo/shell/BaseCommandSupport.java
Thu Apr  8 07:58:43 2010
@@ -36,23 +36,23 @@ public abstract class BaseCommandSupport
 
     private PrintWriter printWriter = null;
     private BufferedReader lineReader = null;
-    
-    
+
+
     /**
      * Create printWriter and lineReader for the session
      *
      */
-    private void init(){    
-        
+    private void init(){
+
         if (printWriter == null)
             printWriter = new PrintWriter(session.getConsole(), true);
 
         if (lineReader == null)
             lineReader = new BufferedReader(new InputStreamReader(session.getKeyboard()));
     }
-    
-    
-    
+
+
+
     /**
      * Print an end-of-line marker.
      *
@@ -120,4 +120,14 @@ public abstract class BaseCommandSupport
         init();
         printWriter.flush();
     }
+
+    @Override
+    public String readPassword() throws IOException {
+       return readLine();
+    }
+
+    @Override
+    public String readPassword(String prompt) throws IOException {
+        return readLine(prompt);
+    }
 }



Mime
View raw message