geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r718965 - in /geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main: java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java resources/META-INF/gshell/components.xml
Date Wed, 19 Nov 2008 14:12:20 GMT
Author: gnodet
Date: Wed Nov 19 06:12:20 2008
New Revision: 718965

URL: http://svn.apache.org/viewvc?rev=718965&view=rev
Log:
Clean ConsoleErrorHandlerImpl class

Modified:
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
    geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java?rev=718965&r1=718964&r2=718965&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/java/org/apache/geronimo/gshell/wisdom/shell/ConsoleErrorHandlerImpl.java
Wed Nov 19 06:12:20 2008
@@ -25,6 +25,7 @@
 import org.apache.geronimo.gshell.event.EventManager;
 import org.apache.geronimo.gshell.io.IO;
 import org.apache.geronimo.gshell.notification.ErrorNotification;
+import org.apache.geronimo.gshell.shell.ShellContextHolder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -38,17 +39,7 @@
 {
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    private final EventManager eventManager;
-
-    private final Application application;
-
-    private AnsiRenderer renderer = new AnsiRenderer();
-
-    public ConsoleErrorHandlerImpl(final EventManager eventManager, final Application application)
{
-        assert eventManager != null;
-        this.eventManager = eventManager;
-        assert application != null;
-        this.application = application;
+    public ConsoleErrorHandlerImpl() {
     }
 
     public Result handleError(final Throwable error) {
@@ -68,16 +59,7 @@
             cause = error.getCause();
         }
 
-        //
-        // FIXME: Really should be the ShellContext here
-        //
-        
-        assert application != null;
-        IO io = application.getIo();
-
-        //
-        // TODO: Use the Render API
-        //
+        IO io = ShellContextHolder.get().getIo();
 
         // Spit out the terse reason why we've failed
         io.err.print("@|bold,red ERROR| ");

Modified: geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml?rev=718965&r1=718964&r2=718965&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml
(original)
+++ geronimo/gshell/trunk/gshell-wisdom/gshell-wisdom-core/src/main/resources/META-INF/gshell/components.xml
Wed Nov 19 06:12:20 2008
@@ -233,10 +233,7 @@
         </property>
 
         <property name="errorHandler">
-            <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsoleErrorHandlerImpl">
-                <constructor-arg ref="eventManager"/>
-                <constructor-arg ref="application"/>
-            </bean>
+            <bean class="org.apache.geronimo.gshell.wisdom.shell.ConsoleErrorHandlerImpl"
/>
         </property>
 
         <property name="history">



Mime
View raw message