Commit 15e7de68 authored by Lubomir Bulej's avatar Lubomir Bulej

ObjectFreeTaskExecutor: added try block around the invocation of the analysis objectFree() method.

CloseHandler: added try block around the invocation of the analysis atExit() method.
parent ea149f5c
......@@ -38,7 +38,21 @@ class ObjectFreeTaskExecutor extends Thread {
// invoke object free
for (RemoteAnalysis ra : raSet) {
ra.objectFree(obj);
try {
ra.objectFree(obj);
} catch (final Exception e) {
// report error during analysis invocation
System.err.format (
"DiSL-RE: exception in analysis %s.objectFree(): %s\n",
ra.getClass ().getName (), e.getMessage ()
);
final Throwable cause = e.getCause ();
if (cause != null) {
cause.printStackTrace (System.err);
}
}
}
// release shadow object
......
......@@ -11,6 +11,7 @@ import ch.usi.dag.dislreserver.reqdispatch.RequestHandler;
public final class CloseHandler implements RequestHandler {
@Override
public void handle (
final DataInputStream is, final DataOutputStream os, final boolean debug
) {
......@@ -21,12 +22,27 @@ public final class CloseHandler implements RequestHandler {
// invoke atExit on all analyses
for (final RemoteAnalysis analysis : AnalysisResolver.getAllAnalyses ()) {
analysis.atExit ();
try {
analysis.atExit ();
} catch (final Exception e) {
// report error during analysis invocation
System.err.format (
"DiSL-RE: exception in analysis %s.atExit(): %s\n",
analysis.getClass ().getName (), e.getMessage ()
);
final Throwable cause = e.getCause ();
if (cause != null) {
cause.printStackTrace (System.err);
}
}
}
}
@Override
public void exit () {
// empty
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment