diff --git a/hsarback/build.xml b/hsarback/build.xml
index 9386a6a..c2af7eb 100644
--- a/hsarback/build.xml
+++ b/hsarback/build.xml
@@ -40,6 +40,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/hsarback/src/de/hsadmin/core/qserv/QueueServer.java b/hsarback/src/de/hsadmin/core/qserv/QueueServer.java
index c709096..2785523 100644
--- a/hsarback/src/de/hsadmin/core/qserv/QueueServer.java
+++ b/hsarback/src/de/hsadmin/core/qserv/QueueServer.java
@@ -144,29 +144,27 @@ public class QueueServer extends QueueCommons implements
// execute processor within the message
task.getProcessor().process();
System.out.println("done");
-
- // mark done
- sendStatus(task);
- } catch (Exception receiveException) {
- System.err.println("exception " + receiveException); // TODO:
- // logging
- receiveException.printStackTrace(System.err);
- if (receiveException.getCause() != null) {
- System.err.println("caused by exception "
- + receiveException.getCause()); // TODO: logging
- receiveException.getCause().printStackTrace(System.err);
- } else
- System.err.println("no further cause available");
- task.setException(receiveException);
- sendStatus(task);
- } catch (Throwable t) {
- System.err.println("severe exception " + t); // TODO: logging
+ } catch (Throwable throwable) {
+ logException(throwable);
+ task.setException(throwable);
} finally {
+ sendStatus(task);
setNMessagesProcessed(getNMessagesProcessed() + 1);
notifyAll();
}
}
+ private void logException(Throwable t) {
+ System.err.println("exception " + t); // TODO: logging
+ t.printStackTrace(System.err);
+ if (t.getCause() != null) {
+ System.err.println("caused by exception "
+ + t.getCause()); // TODO: logging
+ t.getCause().printStackTrace(System.err);
+ } else
+ System.err.println("no further cause available");
+ }
+
@Override
public void onException(JMSException e) {
System.out.println("Exception: " + e.getMessage());
diff --git a/hsarback/src/de/hsadmin/core/qserv/QueueTask.java b/hsarback/src/de/hsadmin/core/qserv/QueueTask.java
index ff46f96..5b0c1aa 100644
--- a/hsarback/src/de/hsadmin/core/qserv/QueueTask.java
+++ b/hsarback/src/de/hsadmin/core/qserv/QueueTask.java
@@ -181,15 +181,14 @@ public class QueueTask extends AbstractEntity implements Serializable {
public String getException() {
return exception;
- };
+ }
public void setException(String exception) {
this.exception = exception;
}
- public void setException(Exception exception) {
- this.exception = exception.toString();
- // TODO: stack+cause
+ public void setException(Throwable exception) {
+ this.exception = exception.getMessage();
}
@Override
diff --git a/hsarback/src/de/hsadmin/core/qserv/TemplateProcessor.java b/hsarback/src/de/hsadmin/core/qserv/TemplateProcessor.java
index 08b312b..8a7f2eb 100644
--- a/hsarback/src/de/hsadmin/core/qserv/TemplateProcessor.java
+++ b/hsarback/src/de/hsadmin/core/qserv/TemplateProcessor.java
@@ -6,13 +6,14 @@ import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.util.Iterator;
import java.util.Map;
import net.sf.jtpl.Template;
public class TemplateProcessor extends AbstractProcessor {
- private static final long serialVersionUID = 4520635523274792876L;
+ private static final long serialVersionUID = 2L;
private String content = null;
private String targetPath = null;
@@ -34,6 +35,29 @@ public class TemplateProcessor extends AbstractProcessor {
}
}
+ public TemplateProcessor(String templateName, Map mainValues, Iterator