aboutsummaryrefslogtreecommitdiffstats
path: root/tests/java5/ataspectj/MessageHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/java5/ataspectj/MessageHandler.java')
-rw-r--r--tests/java5/ataspectj/MessageHandler.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/java5/ataspectj/MessageHandler.java b/tests/java5/ataspectj/MessageHandler.java
new file mode 100644
index 000000000..111b32fc0
--- /dev/null
+++ b/tests/java5/ataspectj/MessageHandler.java
@@ -0,0 +1,27 @@
+import org.aspectj.bridge.AbortException;
+import org.aspectj.bridge.IMessage;
+import org.aspectj.bridge.IMessageHandler;
+import org.aspectj.bridge.IMessage.Kind;
+
+public class MessageHandler implements IMessageHandler {
+
+ public boolean handleMessage(IMessage message) throws AbortException {
+ System.out.println(message);
+ if (message.getKind() == IMessage.ERROR) {
+ System.exit(-1);
+ }
+ else if (message.getKind() == IMessage.ABORT) {
+ throw new AbortException(message.toString());
+ }
+ return true;
+ }
+
+ public boolean isIgnoring(IMessage.Kind kind) {
+ return false;
+ }
+
+ public void dontIgnore(IMessage.Kind kind) {
+
+ }
+
+} \ No newline at end of file