Allow RepositoryUnit and RepositoryListenerUnit to throw any exception.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@2003 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -22,14 +22,13 @@ import com.samskivert.io.PersistenceException;
|
||||
import com.samskivert.util.ResultListener;
|
||||
|
||||
/**
|
||||
* Extends the {@link RepositoryUnit} and integrates with a {@link
|
||||
* ResultListener}.
|
||||
* Extends the {@link RepositoryUnit} and integrates with a {@link ResultListener}.
|
||||
*/
|
||||
public abstract class RepositoryListenerUnit<T> extends RepositoryUnit
|
||||
{
|
||||
/**
|
||||
* Creates a repository listener unit that will report its results to the
|
||||
* supplied result listener.
|
||||
* Creates a repository listener unit that will report its results to the supplied result
|
||||
* listener.
|
||||
*/
|
||||
public RepositoryListenerUnit (ResultListener<T> listener)
|
||||
{
|
||||
@@ -37,9 +36,8 @@ public abstract class RepositoryListenerUnit<T> extends RepositoryUnit
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a repository listener unit that will report its results to the
|
||||
* supplied result listener and report the supplied name in
|
||||
* {@link #toString}.
|
||||
* Creates a repository listener unit that will report its results to the supplied result
|
||||
* listener and report the supplied name in {@link #toString}.
|
||||
*/
|
||||
public RepositoryListenerUnit (String name, ResultListener<T> listener)
|
||||
{
|
||||
@@ -51,11 +49,11 @@ public abstract class RepositoryListenerUnit<T> extends RepositoryUnit
|
||||
* Called to perform our persistent action and generate our result.
|
||||
*/
|
||||
public abstract T invokePersistResult ()
|
||||
throws PersistenceException;
|
||||
throws Exception;
|
||||
|
||||
@Override // from RepositoryUnit
|
||||
public void invokePersist ()
|
||||
throws PersistenceException
|
||||
throws Exception
|
||||
{
|
||||
_result = invokePersistResult();
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ import com.samskivert.io.PersistenceException;
|
||||
import com.samskivert.util.Invoker;
|
||||
|
||||
/**
|
||||
* Extends the {@link com.samskivert.util.Invoker.Unit} and specializes it for
|
||||
* doing database repository manipulation.
|
||||
* Extends the {@link com.samskivert.util.Invoker.Unit} and specializes it for doing database
|
||||
* repository manipulation.
|
||||
*/
|
||||
public abstract class RepositoryUnit extends Invoker.Unit
|
||||
{
|
||||
@@ -33,8 +33,7 @@ public abstract class RepositoryUnit extends Invoker.Unit
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a RepositoryUnit which will report the supplied name
|
||||
* in {@link #toString}.
|
||||
* Create a RepositoryUnit which will report the supplied name in {@link #toString}.
|
||||
*/
|
||||
public RepositoryUnit (String name)
|
||||
{
|
||||
@@ -66,18 +65,17 @@ public abstract class RepositoryUnit extends Invoker.Unit
|
||||
* Called to perform our persistent actions.
|
||||
*/
|
||||
public abstract void invokePersist ()
|
||||
throws PersistenceException;
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Called if our persistent actions have succeeded, back on the non-invoker
|
||||
* thread.
|
||||
* Called if our persistent actions have succeeded, back on the non-invoker thread.
|
||||
*/
|
||||
public abstract void handleSuccess ();
|
||||
|
||||
/**
|
||||
* Called if our persistent actions failed, back on the non-invoker thread.
|
||||
* Note that this may be either a {@link PersistenceException} thrown by
|
||||
* {@link #invokePersist} or a {@link RuntimeException} thrown by same.
|
||||
* Called if our persistent actions failed, back on the non-invoker thread. Note that this may
|
||||
* be either an {@link Exception} thrown by {@link #invokePersist} or a {@link
|
||||
* RuntimeException} thrown by same.
|
||||
*/
|
||||
public abstract void handleFailure (Exception pe);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user