public class D''''''iskService{ private Writer diskWriter = ...; private final E''''''rrorHandler ioErrorHandler = new E''''''rrorHandler(); ... public void writeToDisk(byte[] data){ try{ diskWriter.write(data); } catch(IOException error){ ioErrorHandler.toss(error); } } public E''''''rrorHandler onIOError(){ return ioErrorHandler; } } public class E''''''rrorHandler{ private List errorMethodObjects = new List(); public void toss(Throwable error){ Iterator eachMethod = errorMethodObjects.iterator(); while(eachMethod.hasNext()){ ((MethodObject) eachMethod.next()).invoke(error); //or however you decide to call it } } public void doThis(MethodObject errorHandlingMethodObject){ errorMethodObjects.add(errorHandlingMethodObject); } } public class ErrorHandledMethod extends MethodObject{ public final Object invoke(Object parameter){ try{ task(parameter); } catch(AbortTaskMessage abort){ throw abort; } catch(RetryTaskMessage retry){ invoke(retry.getParameter()); } catch(IgnoreFailureMessage ignore){ return ignore.getResult(); } } public abstract void task(Object parameter); } public class Client extends ErrorHandledMethod{ D''''''iskService service = new D''''''iskService(); { service.onIOError().doThis(new MethodObject(){ public void invoke(Object ioError){ throw new AbortTaskMessage(); } }); } ... public void task(Object parameter){ service.write((byte[]) parameter); } ... } Discuss :)