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
This commit is contained in:
Michael Bayne
2007-10-08 23:55:51 +00:00
parent d4562ff806
commit 8f81893a0c
@@ -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;
}