Widening.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4756 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-07-12 20:30:51 +00:00
parent 1ea3195551
commit 102dd71f8d
3 changed files with 16 additions and 22 deletions
@@ -29,11 +29,9 @@ import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
/** /**
* Adapts the response from a {@link ResultListener} to a {@link * Adapts the response from a {@link ResultListener} to a {@link ConfirmListener} if the failure is
* ConfirmListener} if the failure is an instance fo {@link * an instance fo {@link InvocationException} the message will be passed on to the confirm
* InvocationException} the message will be passed on to the confirm * listener, otherwise they will be provided with {@link InvocationCodes#INTERNAL_ERROR}.
* listener, otherwise they will be provided with {@link
* InvocationCodes#INTERNAL_ERROR}.
*/ */
public class ConfirmAdapter implements ResultListener public class ConfirmAdapter implements ResultListener
{ {
@@ -29,11 +29,10 @@ import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationCodes; import com.threerings.presents.data.InvocationCodes;
/** /**
* Simplifies a common pattern which is to post an {@link Invoker} unit which * Simplifies a common pattern which is to post an {@link Invoker} unit which does some database
* does some database operation and then calls back to an {@link * operation and then calls back to an {@link InvocationService.InvocationListener} of some
* InvocationService.InvocationListener} of some sort. If the database operation * sort. If the database operation fails, the error will be logged and the result listener will be
* fails, the error will be logged and the result listener will be replied to * replied to with {@link InvocationCodes#INTERNAL_ERROR}.
* with {@link InvocationCodes#INTERNAL_ERROR}.
*/ */
public abstract class PersistingUnit extends Invoker.Unit public abstract class PersistingUnit extends Invoker.Unit
{ {
@@ -50,9 +49,8 @@ public abstract class PersistingUnit extends Invoker.Unit
} }
/** /**
* This method is where the unit performs its persistent actions. Any * This method is where the unit performs its persistent actions. Any persistence exception
* persistence exception will be caught and logged along with the output * will be caught and logged along with the output from {@link #getFailureMessage}, if any.
* from {@link #getFailureMessage}, if any.
*/ */
public abstract void invokePersistent () public abstract void invokePersistent ()
throws PersistenceException; throws PersistenceException;
@@ -65,8 +63,8 @@ public abstract class PersistingUnit extends Invoker.Unit
} }
/** /**
* Handles the failure case by logging the error and reporting an internal * Handles the failure case by logging the error and reporting an internal error to the
* error to the listener. * listener.
*/ */
public void handleFailure (PersistenceException error) public void handleFailure (PersistenceException error)
{ {
@@ -76,8 +74,8 @@ public abstract class PersistingUnit extends Invoker.Unit
} }
/** /**
* Provides a custom failure message in the event that the persistent * Provides a custom failure message in the event that the persistent action fails. This will
* action fails. This will be logged along with the exception. * be logged along with the exception.
*/ */
public String getFailureMessage () public String getFailureMessage ()
{ {
@@ -29,11 +29,9 @@ import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationException;
/** /**
* Adapts the response from a {@link ResultListener} to an * Adapts the response from a {@link ResultListener} to an InvocationService.ResultListener if the
* <code>InvocationService.ResultListener</code> if the failure is an * failure is an instance of {@link InvocationException} the message will be passed on to the
* instance fo {@link InvocationException} the message will be passed on * result listener, otherwise they will be provided with {@link InvocationCodes#INTERNAL_ERROR}.
* to the result listener, otherwise they will be provided with {@link
* InvocationCodes#INTERNAL_ERROR}.
*/ */
public class ResultAdapter<T> implements ResultListener<T> public class ResultAdapter<T> implements ResultListener<T>
{ {