From f753ce219881abea4b4a08aecf0f30d4a14a5240 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 17 May 2007 21:10:37 +0000 Subject: [PATCH] FailureListener, from Charlie Groves. A nice alternate to ComplainingListener. ComplainingListener has the wee downside of needing to compose your error text prior to making a request, even though the common case is to throw away the error string. This class has the downside of requiring a new anonymous class to be generated by the compiler every time you use it. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2103 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/FailureListener.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/java/com/samskivert/util/FailureListener.java diff --git a/src/java/com/samskivert/util/FailureListener.java b/src/java/com/samskivert/util/FailureListener.java new file mode 100644 index 00000000..4baaba19 --- /dev/null +++ b/src/java/com/samskivert/util/FailureListener.java @@ -0,0 +1,15 @@ +package com.samskivert.util; + +/** + * The pessimist's dream. This ResultListener silently eats requestCompleted but makes subclasses + * handle requestFailed. + */ +public abstract class FailureListener + implements ResultListener +{ + // documentation inherited from interface ResultListener + public void requestCompleted (Object result) + { + // Yeah, yeah, yeah. You did something. Good for you. + } +}