geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r442300 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core: GeronimoServerBehaviourDelegate.java commands/SynchronizedDeploymentOp.java
Date Mon, 11 Sep 2006 19:26:14 GMT
Author: sppatel
Date: Mon Sep 11 12:26:13 2006
New Revision: 442300

URL: http://svn.apache.org/viewvc?view=rev&rev=442300
Log:
GERONIMODEVTOOLS-90 deployment error messages all on one line, reformat message by adding
IStatus for each line

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java?view=diff&rev=442300&r1=442299&r2=442300
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
Mon Sep 11 12:26:13 2006
@@ -50,6 +50,7 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Status;
@@ -467,7 +468,9 @@
 	}
 
 	protected void doFail(IStatus status, String message) throws CoreException {
-		throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, message, new
Exception(status.getMessage())));
+		MultiStatus ms = new MultiStatus(Activator.PLUGIN_ID, 0, message, null);
+		ms.addAll(status);
+		throw new CoreException(ms);
 	}
 
 	protected IStatus distribute(IModule module) throws Exception {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java?view=diff&rev=442300&r1=442299&r2=442300
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
Mon Sep 11 12:26:13 2006
@@ -15,6 +15,10 @@
  */
 package org.apache.geronimo.st.core.commands;
 
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.StringReader;
+
 import javax.enterprise.deploy.shared.CommandType;
 import javax.enterprise.deploy.spi.status.DeploymentStatus;
 import javax.enterprise.deploy.spi.status.ProgressEvent;
@@ -26,6 +30,7 @@
 import org.apache.geronimo.st.core.internal.Trace;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.server.core.IModule;
@@ -73,7 +78,7 @@
 
 	private synchronized ProgressObject run() throws Exception {
 		Trace.trace(Trace.INFO, "--> run()");
-
+		
 		IStatus ds = command.execute(_monitor);
 
 		ProgressObject po = null;
@@ -116,10 +121,12 @@
 			_monitor.subTask(dsm.toString());
 			if (command.getCommandType() == deploymentStatus.getCommand()) {
 				if (deploymentStatus.isCompleted()) {
-					status = new Status(IStatus.OK, Activator.PLUGIN_ID, 0, dsm.getMessage(), null);
+					status = new MultiStatus(Activator.PLUGIN_ID, 0, "", null);
+					messageToStatus((MultiStatus)status, dsm.getMessage());
 					sendNotification();
 				} else if (deploymentStatus.isFailed()) {
-					status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, dsm.getMessage(), null);
+					status = new MultiStatus(Activator.PLUGIN_ID, 0, "", null);
+					messageToStatus((MultiStatus) status, dsm.getMessage());
 					sendNotification();
 				}
 			}
@@ -143,5 +150,16 @@
 	public IModule getModule() {
 		return command.getModule();
 	}
+	
+    public static void messageToStatus(MultiStatus status, String source) {
+		try {
+			BufferedReader in = new BufferedReader(new StringReader(source));
+			String line;
+			while ((line = in.readLine()) != null) {
+				status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0,line, null));
+			}
+		} catch (IOException e) {
 
+		}
+    }
 }



Mime
View raw message