From 8f81893a0cf8bb60283c6a66063d7cbd72c0aaf1 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Mon, 8 Oct 2007 23:55:51 +0000 Subject: [PATCH] getFailureMessage() should be protected as it's not part of the persisting unit's public API. handleResult() and handleFailure() could also be protected but we're adapting Invoker.Unit to something that appears to provide a different (persistence friendly) public API even though the invoker doesn't actually call it, but rather the normal Unit public methods call the new public methods. But we still want to maintain the "feel" of these being the PersistingUnit's "main thing. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4839 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../presents/util/PersistingUnit.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/java/com/threerings/presents/util/PersistingUnit.java b/src/java/com/threerings/presents/util/PersistingUnit.java index ddbe4f99e..f0d8c48d0 100644 --- a/src/java/com/threerings/presents/util/PersistingUnit.java +++ b/src/java/com/threerings/presents/util/PersistingUnit.java @@ -41,8 +41,7 @@ public abstract class PersistingUnit extends Invoker.Unit this("UnknownPersistingUnit", listener); } - public PersistingUnit ( - String name, InvocationService.InvocationListener listener) + public PersistingUnit (String name, InvocationService.InvocationListener listener) { super(name); _listener = listener; @@ -73,15 +72,7 @@ public abstract class PersistingUnit extends Invoker.Unit _listener.requestFailed(InvocationCodes.INTERNAL_ERROR); } - /** - * Provides a custom failure message in the event that the persistent action fails. This will - * be logged along with the exception. - */ - public String getFailureMessage () - { - return this + " failed."; - } - + @Override // from Invoker.Unit public boolean invoke () { try { @@ -92,6 +83,7 @@ public abstract class PersistingUnit extends Invoker.Unit return true; } + @Override // from Invoker.Unit public void handleResult () { if (_error != null) { @@ -101,6 +93,15 @@ public abstract class PersistingUnit extends Invoker.Unit } } + /** + * Provides a custom failure message in the event that the persistent action fails. This will + * be logged along with the exception. + */ + protected String getFailureMessage () + { + return this + " failed."; + } + protected InvocationService.InvocationListener _listener; protected PersistenceException _error; }